Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/licensedcode/data/rules/apache-2.0_and_mit_2.RULE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
license_expression: apache-2.0 AND mit
is_license_reference: yes
relevance: 100
minimum_coverage: 100
---
licensed under Apache-2.0 AND MIT
7 changes: 7 additions & 0 deletions src/licensedcode/data/rules/apache-2.0_or_mit_55.RULE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
license_expression: apache-2.0 OR mit
is_license_reference: yes
relevance: 100
minimum_coverage: 100
---
licensed under Apache-2.0 OR MIT
9 changes: 5 additions & 4 deletions tests/formattedcode/data/common/manifests-expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ headers:
--license-references: yes
--license-text: yes
--package: yes
--processes: -1
--summary: yes
--url: yes
--yaml: <file>
Expand All @@ -21,17 +22,17 @@ headers:
for any legal advice.
ScanCode is a free software code scanning tool from nexB Inc. and others.
Visit https://github.com/nexB/scancode-toolkit/ for support and download.
output_format_version: 4.0.0
output_format_version: 4.1.0
message:
errors: []
warnings: []
extra_data:
system_environment:
operating_system: linux
cpu_architecture: 64
platform: Linux-5.15.0-141-generic-x86_64-with-glibc2.35
platform_version: '#151-Ubuntu SMP Sun May 18 21:35:19 UTC 2025'
python_version: 3.10.12 (main, Feb 4 2025, 14:57:36) [GCC 11.4.0]
platform: Linux-6.6.87.2-microsoft-standard-WSL2-x86_64-with-glibc2.39
platform_version: '#1 SMP PREEMPT_DYNAMIC Thu Jun 5 18:30:46 UTC 2025'
python_version: 3.12.3 (main, Jan 8 2026, 11:30:50) [GCC 13.3.0]
spdx_license_list_version: '3.27'
files_count: 4
summary:
Expand Down
111 changes: 30 additions & 81 deletions tests/formattedcode/data/yaml/package-and-licenses-expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ headers:
--license-references: yes
--license-text: yes
--package: yes
--processes: -1
--summary: yes
--url: yes
--yaml: <file>
Expand All @@ -21,17 +22,17 @@ headers:
for any legal advice.
ScanCode is a free software code scanning tool from nexB Inc. and others.
Visit https://github.com/nexB/scancode-toolkit/ for support and download.
output_format_version: 4.0.0
output_format_version: 4.1.0
message:
errors: []
warnings: []
extra_data:
system_environment:
operating_system: linux
cpu_architecture: 64
platform: Linux-5.15.0-141-generic-x86_64-with-glibc2.35
platform_version: '#151-Ubuntu SMP Sun May 18 21:35:19 UTC 2025'
python_version: 3.10.12 (main, Feb 4 2025, 14:57:36) [GCC 11.4.0]
platform: Linux-6.6.87.2-microsoft-standard-WSL2-x86_64-with-glibc2.39
platform_version: '#1 SMP PREEMPT_DYNAMIC Thu Jun 5 18:30:46 UTC 2025'
python_version: 3.12.3 (main, Jan 8 2026, 11:30:50) [GCC 13.3.0]
spdx_license_list_version: '3.27'
files_count: 4
summary:
Expand All @@ -47,7 +48,7 @@ summary:
declared_holder: Example Corp.
primary_language: Python
other_license_expressions:
- value: apache-2.0 AND (apache-2.0 OR mit)
- value: apache-2.0 OR mit
count: 1
- value: mit
count: 1
Expand Down Expand Up @@ -316,36 +317,23 @@ license_detections:
rule_identifier: apache-2.0_65.RULE
rule_url: https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_65.RULE
matched_text: license = Apache-2.0
- identifier: apache_2_0_and__apache_2_0_or_mit-ab5115d2-1eff-af76-1473-34378a32b2bb
license_expression: apache-2.0 AND (apache-2.0 OR mit)
license_expression_spdx: Apache-2.0 AND (Apache-2.0 OR MIT)
- identifier: apache_2_0_or_mit-63aee60b-3389-cc69-da5a-7dd28d1b8e2e
license_expression: apache-2.0 OR mit
license_expression_spdx: Apache-2.0 OR MIT
detection_count: 1
reference_matches:
- license_expression: apache-2.0
license_expression_spdx: Apache-2.0
from_file: package-and-licenses/README.txt
start_line: 3
end_line: 3
matcher: 2-aho
score: '100.0'
matched_length: 5
match_coverage: '100.0'
rule_relevance: 100
rule_identifier: apache-2.0_1109.RULE
rule_url: https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_1109.RULE
matched_text: This is licensed under Apache-2.0 or MIT
- license_expression: apache-2.0 OR mit
license_expression_spdx: Apache-2.0 OR MIT
from_file: package-and-licenses/README.txt
start_line: 3
end_line: 3
matcher: 2-aho
score: '100.0'
matched_length: 5
matched_length: 7
match_coverage: '100.0'
rule_relevance: 100
rule_identifier: apache-2.0_or_mit_36.RULE
rule_url: https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_or_mit_36.RULE
rule_identifier: apache-2.0_or_mit_55.RULE
rule_url: https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_or_mit_55.RULE
matched_text: This is licensed under Apache-2.0 or MIT
- identifier: mit-cacd5c0c-204a-85c2-affc-e4c125b2492a
license_expression: mit
Expand All @@ -356,7 +344,7 @@ license_detections:
license_expression_spdx: MIT
from_file: package-and-licenses/mit.LICENSE
start_line: 2
end_line: '19'
end_line: 19
matcher: 1-hash
score: '100.0'
matched_length: 161
Expand Down Expand Up @@ -846,33 +834,6 @@ license_rule_references:
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
- license_expression: apache-2.0
identifier: apache-2.0_1109.RULE
language: en
rule_url: https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_1109.RULE
is_license_text: no
is_license_notice: yes
is_license_reference: no
is_license_tag: no
is_license_intro: no
is_license_clue: no
is_required_phrase: no
skip_for_required_phrase_generation: no
is_continuous: no
is_builtin: yes
is_from_license: no
is_synthetic: no
length: 5
relevance: 100
minimum_coverage: 80
referenced_filenames: []
notes:
ignorable_copyrights: []
ignorable_holders: []
ignorable_authors: []
ignorable_urls: []
ignorable_emails: []
text: licenced under {{Apache 2.0}}
- license_expression: apache-2.0
identifier: apache-2.0_65.RULE
language: en
Expand Down Expand Up @@ -901,22 +862,22 @@ license_rule_references:
ignorable_emails: []
text: license="Apache-2.0
- license_expression: apache-2.0 OR mit
identifier: apache-2.0_or_mit_36.RULE
identifier: apache-2.0_or_mit_55.RULE
language: en
rule_url: https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_or_mit_36.RULE
rule_url: https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_or_mit_55.RULE
is_license_text: no
is_license_notice: no
is_license_reference: yes
is_license_tag: no
is_license_intro: no
is_license_clue: no
is_required_phrase: yes
is_required_phrase: no
skip_for_required_phrase_generation: no
is_continuous: no
is_builtin: yes
is_from_license: no
is_synthetic: no
length: 5
length: 7
relevance: 100
minimum_coverage: 80
referenced_filenames: []
Expand All @@ -926,7 +887,8 @@ license_rule_references:
ignorable_authors: []
ignorable_urls: []
ignorable_emails: []
text: apache-2.0 OR MIT
text: |
licensed under Apache-2.0 OR MIT
- license_expression: mit
identifier: mit.LICENSE
language: en
Expand Down Expand Up @@ -1069,39 +1031,26 @@ files:
package_data: []
for_packages:
- pkg:pypi/codebase?uuid=fixed-uid-done-for-testing-5642512d1758
detected_license_expression: apache-2.0 AND (apache-2.0 OR mit)
detected_license_expression_spdx: Apache-2.0 AND (Apache-2.0 OR MIT)
detected_license_expression: apache-2.0 OR mit
detected_license_expression_spdx: Apache-2.0 OR MIT
license_detections:
- license_expression: apache-2.0 AND (apache-2.0 OR mit)
license_expression_spdx: Apache-2.0 AND (Apache-2.0 OR MIT)
- license_expression: apache-2.0 OR mit
license_expression_spdx: Apache-2.0 OR MIT
matches:
- license_expression: apache-2.0
license_expression_spdx: Apache-2.0
from_file: package-and-licenses/README.txt
start_line: 3
end_line: 3
matcher: 2-aho
score: '100.0'
matched_length: 5
match_coverage: '100.0'
rule_relevance: 100
rule_identifier: apache-2.0_1109.RULE
rule_url: https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_1109.RULE
matched_text: This is licensed under Apache-2.0 or MIT
- license_expression: apache-2.0 OR mit
license_expression_spdx: Apache-2.0 OR MIT
from_file: package-and-licenses/README.txt
start_line: 3
end_line: 3
matcher: 2-aho
score: '100.0'
matched_length: 5
matched_length: 7
match_coverage: '100.0'
rule_relevance: 100
rule_identifier: apache-2.0_or_mit_36.RULE
rule_url: https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_or_mit_36.RULE
rule_identifier: apache-2.0_or_mit_55.RULE
rule_url: https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_or_mit_55.RULE
matched_text: This is licensed under Apache-2.0 or MIT
identifier: apache_2_0_and__apache_2_0_or_mit-ab5115d2-1eff-af76-1473-34378a32b2bb
identifier: apache_2_0_or_mit-63aee60b-3389-cc69-da5a-7dd28d1b8e2e
license_clues: []
percentage_of_license_text: '50.0'
copyrights:
Expand Down Expand Up @@ -1324,8 +1273,8 @@ files:
start_line: 4
end_line: 4
- url: http://www.apache.org/licenses/LICENSE-2.0
start_line: '196'
end_line: '196'
start_line: 196
end_line: 196
files_count: '0'
dirs_count: '0'
size_count: '0'
Expand Down Expand Up @@ -1368,7 +1317,7 @@ files:
license_expression_spdx: MIT
from_file: package-and-licenses/mit.LICENSE
start_line: 2
end_line: '19'
end_line: 19
matcher: 1-hash
score: '100.0'
matched_length: 161
Expand Down
9 changes: 5 additions & 4 deletions tests/formattedcode/data/yaml/simple-expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ headers:
--info: yes
--license: yes
--package: yes
--processes: -1
--yaml: <file>
notice: |
Generated with ScanCode and provided on an "AS IS" BASIS, WITHOUT WARRANTIES
Expand All @@ -14,17 +15,17 @@ headers:
for any legal advice.
ScanCode is a free software code scanning tool from nexB Inc. and others.
Visit https://github.com/nexB/scancode-toolkit/ for support and download.
output_format_version: 4.0.0
output_format_version: 4.1.0
message:
errors: []
warnings: []
extra_data:
system_environment:
operating_system: linux
cpu_architecture: 64
platform: Linux-5.15.0-141-generic-x86_64-with-glibc2.35
platform_version: '#151-Ubuntu SMP Sun May 18 21:35:19 UTC 2025'
python_version: 3.10.12 (main, Feb 4 2025, 14:57:36) [GCC 11.4.0]
platform: Linux-6.6.87.2-microsoft-standard-WSL2-x86_64-with-glibc2.39
platform_version: '#1 SMP PREEMPT_DYNAMIC Thu Jun 5 18:30:46 UTC 2025'
python_version: 3.12.3 (main, Jan 8 2026, 11:30:50) [GCC 13.3.0]
spdx_license_list_version: '3.27'
files_count: 1
packages: []
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
licensed under Apache-2.0 AND MIT
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
license_expressions:
- apache-2.0 AND mit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
licensed under Apache-2.0 OR MIT
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
license_expressions:
- apache-2.0 OR mit
Loading