Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3299 from nexB/license-detection-follow-up
Fix misc license detection related bugs
- Loading branch information
Showing
48 changed files
with
108,784 additions
and
136,249 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
path,type,declared_license_expression,scan_errors | ||
apache-2.0.LICENSE,file,apache-2.0 AND mit, | ||
path,type,declared_license_expression,declared_license_expression_spdx,scan_errors | ||
apache-2.0.LICENSE,file,apache-2.0 AND mit,Apache-2.0 AND MIT, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
tests/licensedcode/data/plugin_license_policy/file_with_multiple_licenses.expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
{ | ||
"license_detections": [ | ||
{ | ||
"identifier": "apache_2_0_and_gpl_3_0-494ca0ae-1282-09a2-139f-a52c04fde6dc", | ||
"license_expression": "apache-2.0 AND gpl-3.0", | ||
"detection_count": 1 | ||
} | ||
], | ||
"files": [ | ||
{ | ||
"path": "file_with_multiple_licenses.txt", | ||
"type": "file", | ||
"name": "file_with_multiple_licenses.txt", | ||
"base_name": "file_with_multiple_licenses", | ||
"extension": ".txt", | ||
"size": 38, | ||
"sha1": "92bb9a9fbe881166541fb395dc29501851405892", | ||
"md5": "1dcb636e0d184b1c85a47245ec6ef8ca", | ||
"sha256": "1f9e9d483e71691f5d0a5aa2ad89b07cc7f52ed0ff18b9ab641527c6c2974203", | ||
"mime_type": "text/plain", | ||
"file_type": "ASCII text", | ||
"programming_language": null, | ||
"is_binary": false, | ||
"is_text": true, | ||
"is_archive": false, | ||
"is_media": false, | ||
"is_source": false, | ||
"is_script": false, | ||
"detected_license_expression": "apache-2.0 AND gpl-3.0", | ||
"detected_license_expression_spdx": "Apache-2.0 AND GPL-3.0-only", | ||
"license_detections": [ | ||
{ | ||
"license_expression": "apache-2.0 AND gpl-3.0", | ||
"matches": [ | ||
{ | ||
"score": 100.0, | ||
"start_line": 1, | ||
"end_line": 1, | ||
"matched_length": 4, | ||
"match_coverage": 100.0, | ||
"matcher": "2-aho", | ||
"license_expression": "apache-2.0", | ||
"rule_identifier": "apache-2.0_65.RULE", | ||
"rule_relevance": 100, | ||
"rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_65.RULE" | ||
}, | ||
{ | ||
"score": 100.0, | ||
"start_line": 3, | ||
"end_line": 3, | ||
"matched_length": 4, | ||
"match_coverage": 100.0, | ||
"matcher": "2-aho", | ||
"license_expression": "gpl-3.0", | ||
"rule_identifier": "gpl-3.0_173.RULE", | ||
"rule_relevance": 100, | ||
"rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/gpl-3.0_173.RULE" | ||
} | ||
], | ||
"identifier": "apache_2_0_and_gpl_3_0-494ca0ae-1282-09a2-139f-a52c04fde6dc" | ||
} | ||
], | ||
"license_clues": [], | ||
"percentage_of_license_text": 100.0, | ||
"license_policy": [ | ||
{ | ||
"license_key": "apache-2.0", | ||
"label": "Approved License", | ||
"color_code": "#008000", | ||
"icon": "icon-ok-circle" | ||
}, | ||
{ | ||
"license_key": "gpl-3.0", | ||
"label": "Restricted License", | ||
"color_code": "#FFcc33", | ||
"icon": "icon-warning-sign" | ||
} | ||
], | ||
"files_count": 0, | ||
"dirs_count": 0, | ||
"size_count": 0, | ||
"scan_errors": [] | ||
} | ||
] | ||
} |
3 changes: 3 additions & 0 deletions
3
tests/licensedcode/data/plugin_license_policy/file_with_multiple_licenses.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
License: apache-2.0 | ||
|
||
License: gpl-3.0 |
Oops, something went wrong.