Skip to content

Commit 9128744

Browse files
Regen test expectations and update clues detection
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
1 parent 16789e8 commit 9128744

File tree

7 files changed

+51
-49
lines changed

7 files changed

+51
-49
lines changed

src/licensedcode/detection.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1556,7 +1556,9 @@ def analyze_detection(license_matches, package_license=False):
15561556
):
15571557
return DetectionCategory.FALSE_POSITVE.value
15581558

1559-
elif has_correct_license_clue_matches(license_matches=license_matches):
1559+
elif not package_license and has_correct_license_clue_matches(
1560+
license_matches=license_matches
1561+
):
15601562
return DetectionCategory.LICENSE_CLUES.value
15611563

15621564
# Case where all matches have `matcher` as `1-hash` or `4-spdx-id`

tests/licensedcode/data/datadriven/external/glc/MIT-NoAd.t1.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
license_expressions:
2-
- x11-fsf
2+
- x11-xconsortium
33
notes: |
44
License test derived from a file of the BSD-licensed repository at:
55
https://raw.githubusercontent.com/google/licensecheck/v0.3.1/testdata/MIT-NoAd.t1

tests/packagedcode/data/debian/basic-rootfs-expected.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
"identifier": "bsd_new-ccc98c3a-92d4-e7a3-e0ba-798328cb6b98"
9898
},
9999
{
100-
"license_expression": "x11-fsf",
100+
"license_expression": "x11-xconsortium",
101101
"matches": [
102102
{
103103
"score": 100.0,
@@ -106,14 +106,14 @@
106106
"matched_length": 199,
107107
"match_coverage": 100.0,
108108
"matcher": "2-aho",
109-
"license_expression": "x11-fsf",
110-
"rule_identifier": "x11-fsf_7.RULE",
109+
"license_expression": "x11-xconsortium",
110+
"rule_identifier": "x11-xconsortium_41.RULE",
111111
"rule_relevance": 100,
112-
"rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/x11-fsf_7.RULE",
112+
"rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/x11-xconsortium_41.RULE",
113113
"matched_text": "Permission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name(s) of the above copyright\nholders shall not be used in advertising or otherwise to promote the\nsale, use or other dealings in this Software without prior written\nauthorization."
114114
}
115115
],
116-
"identifier": "x11_fsf-c2b8535e-1b81-42d8-945b-b026f349228d"
116+
"identifier": "x11_xconsortium-4a366de0-e107-017e-0783-8145953fe45e"
117117
}
118118
],
119119
"other_license_expression": null,
@@ -440,7 +440,7 @@
440440
"identifier": "bsd_new-ccc98c3a-92d4-e7a3-e0ba-798328cb6b98"
441441
},
442442
{
443-
"license_expression": "x11-fsf",
443+
"license_expression": "x11-xconsortium",
444444
"matches": [
445445
{
446446
"score": 100.0,
@@ -449,14 +449,14 @@
449449
"matched_length": 199,
450450
"match_coverage": 100.0,
451451
"matcher": "2-aho",
452-
"license_expression": "x11-fsf",
453-
"rule_identifier": "x11-fsf_7.RULE",
452+
"license_expression": "x11-xconsortium",
453+
"rule_identifier": "x11-xconsortium_41.RULE",
454454
"rule_relevance": 100,
455-
"rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/x11-fsf_7.RULE",
455+
"rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/x11-xconsortium_41.RULE",
456456
"matched_text": "Permission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name(s) of the above copyright\nholders shall not be used in advertising or otherwise to promote the\nsale, use or other dealings in this Software without prior written\nauthorization."
457457
}
458458
],
459-
"identifier": "x11_fsf-c2b8535e-1b81-42d8-945b-b026f349228d"
459+
"identifier": "x11_xconsortium-4a366de0-e107-017e-0783-8145953fe45e"
460460
}
461461
],
462462
"other_license_expression": null,

tests/packagedcode/data/debian/copyright/debian-2019-11-15/main/n/ncurses/stable_copyright-detailed.expected.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
declared_license:
2-
declared_license_expression: x11-fsf AND x11-xconsortium AND bsd-new AND x11-fsf
2+
declared_license_expression: x11-fsf AND x11-xconsortium AND bsd-new AND x11-xconsortium
33
declared_license_expression_spdx: X11-distribute-modifications-variant AND X11 AND BSD-3-Clause
4-
AND X11-distribute-modifications-variant
4+
AND X11
55
other_license_expression:
66
other_license_expression_spdx:
77
license_detections:
@@ -114,18 +114,18 @@ license_detections:
114114
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
115115
SUCH DAMAGE.
116116
identifier: bsd_new-ccc98c3a-92d4-e7a3-e0ba-798328cb6b98
117-
- license_expression: x11-fsf
117+
- license_expression: x11-xconsortium
118118
matches:
119119
- score: '100.0'
120120
start_line: 105
121121
end_line: 127
122122
matched_length: '199'
123123
match_coverage: '100.0'
124124
matcher: 2-aho
125-
license_expression: x11-fsf
126-
rule_identifier: x11-fsf_7.RULE
125+
license_expression: x11-xconsortium
126+
rule_identifier: x11-xconsortium_41.RULE
127127
rule_relevance: 100
128-
rule_url: https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/x11-fsf_7.RULE
128+
rule_url: https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/x11-xconsortium_41.RULE
129129
matched_text: |
130130
Permission is hereby granted, free of charge, to any person obtaining a
131131
copy of this software and associated documentation files (the
@@ -150,7 +150,7 @@ license_detections:
150150
holders shall not be used in advertising or otherwise to promote the
151151
sale, use or other dealings in this Software without prior written
152152
authorization.
153-
identifier: x11_fsf-c2b8535e-1b81-42d8-945b-b026f349228d
153+
identifier: x11_xconsortium-4a366de0-e107-017e-0783-8145953fe45e
154154
other_license_detections: []
155155
copyright: |
156156
Copyright (c) 1998-2018 Free Software Foundation, Inc.

tests/packagedcode/data/debian/debian-container-layer.tar.xz.get-installed-expected.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
"identifier": "bsd_new-ccc98c3a-92d4-e7a3-e0ba-798328cb6b98"
9797
},
9898
{
99-
"license_expression": "x11-fsf",
99+
"license_expression": "x11-xconsortium",
100100
"matches": [
101101
{
102102
"score": 100.0,
@@ -105,14 +105,14 @@
105105
"matched_length": 199,
106106
"match_coverage": 100.0,
107107
"matcher": "2-aho",
108-
"license_expression": "x11-fsf",
109-
"rule_identifier": "x11-fsf_7.RULE",
108+
"license_expression": "x11-xconsortium",
109+
"rule_identifier": "x11-xconsortium_41.RULE",
110110
"rule_relevance": 100,
111-
"rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/x11-fsf_7.RULE",
111+
"rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/x11-xconsortium_41.RULE",
112112
"matched_text": "Permission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name(s) of the above copyright\nholders shall not be used in advertising or otherwise to promote the\nsale, use or other dealings in this Software without prior written\nauthorization."
113113
}
114114
],
115-
"identifier": "x11_fsf-c2b8535e-1b81-42d8-945b-b026f349228d"
115+
"identifier": "x11_xconsortium-4a366de0-e107-017e-0783-8145953fe45e"
116116
}
117117
],
118118
"other_license_expression": null,
@@ -268,7 +268,7 @@
268268
"identifier": "bsd_new-ccc98c3a-92d4-e7a3-e0ba-798328cb6b98"
269269
},
270270
{
271-
"license_expression": "x11-fsf",
271+
"license_expression": "x11-xconsortium",
272272
"matches": [
273273
{
274274
"score": 100.0,
@@ -277,14 +277,14 @@
277277
"matched_length": 199,
278278
"match_coverage": 100.0,
279279
"matcher": "2-aho",
280-
"license_expression": "x11-fsf",
281-
"rule_identifier": "x11-fsf_7.RULE",
280+
"license_expression": "x11-xconsortium",
281+
"rule_identifier": "x11-xconsortium_41.RULE",
282282
"rule_relevance": 100,
283-
"rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/x11-fsf_7.RULE",
283+
"rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/x11-xconsortium_41.RULE",
284284
"matched_text": "Permission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name(s) of the above copyright\nholders shall not be used in advertising or otherwise to promote the\nsale, use or other dealings in this Software without prior written\nauthorization."
285285
}
286286
],
287-
"identifier": "x11_fsf-c2b8535e-1b81-42d8-945b-b026f349228d"
287+
"identifier": "x11_xconsortium-4a366de0-e107-017e-0783-8145953fe45e"
288288
}
289289
],
290290
"other_license_expression": null,

tests/packagedcode/data/debian/debian-container-layer.tar.xz.scan-expected.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
"identifier": "bsd_new-ccc98c3a-92d4-e7a3-e0ba-798328cb6b98"
9898
},
9999
{
100-
"license_expression": "x11-fsf",
100+
"license_expression": "x11-xconsortium",
101101
"matches": [
102102
{
103103
"score": 100.0,
@@ -106,14 +106,14 @@
106106
"matched_length": 199,
107107
"match_coverage": 100.0,
108108
"matcher": "2-aho",
109-
"license_expression": "x11-fsf",
110-
"rule_identifier": "x11-fsf_7.RULE",
109+
"license_expression": "x11-xconsortium",
110+
"rule_identifier": "x11-xconsortium_41.RULE",
111111
"rule_relevance": 100,
112-
"rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/x11-fsf_7.RULE",
112+
"rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/x11-xconsortium_41.RULE",
113113
"matched_text": "Permission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name(s) of the above copyright\nholders shall not be used in advertising or otherwise to promote the\nsale, use or other dealings in this Software without prior written\nauthorization."
114114
}
115115
],
116-
"identifier": "x11_fsf-c2b8535e-1b81-42d8-945b-b026f349228d"
116+
"identifier": "x11_xconsortium-4a366de0-e107-017e-0783-8145953fe45e"
117117
}
118118
],
119119
"other_license_expression": null,
@@ -454,7 +454,7 @@
454454
"identifier": "bsd_new-ccc98c3a-92d4-e7a3-e0ba-798328cb6b98"
455455
},
456456
{
457-
"license_expression": "x11-fsf",
457+
"license_expression": "x11-xconsortium",
458458
"matches": [
459459
{
460460
"score": 100.0,
@@ -463,14 +463,14 @@
463463
"matched_length": 199,
464464
"match_coverage": 100.0,
465465
"matcher": "2-aho",
466-
"license_expression": "x11-fsf",
467-
"rule_identifier": "x11-fsf_7.RULE",
466+
"license_expression": "x11-xconsortium",
467+
"rule_identifier": "x11-xconsortium_41.RULE",
468468
"rule_relevance": 100,
469-
"rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/x11-fsf_7.RULE",
469+
"rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/x11-xconsortium_41.RULE",
470470
"matched_text": "Permission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nExcept as contained in this notice, the name(s) of the above copyright\nholders shall not be used in advertising or otherwise to promote the\nsale, use or other dealings in this Software without prior written\nauthorization."
471471
}
472472
],
473-
"identifier": "x11_fsf-c2b8535e-1b81-42d8-945b-b026f349228d"
473+
"identifier": "x11_xconsortium-4a366de0-e107-017e-0783-8145953fe45e"
474474
}
475475
],
476476
"other_license_expression": null,

0 commit comments

Comments
 (0)