Skip to content

Commit ecf3dc5

Browse files
committed
Rename precise_license_detection field #2967
* Update expected test results Signed-off-by: Jono Yang <jyang@nexb.com>
1 parent 19d77e9 commit ecf3dc5

41 files changed

Lines changed: 19 additions & 1315 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/summarycode/score.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ def compute_license_score(codebase):
148148
if scoring_elements.declared_license:
149149
scoring_elements.score += 40
150150

151-
scoring_elements.precise_license_detection = check_declared_licenses(declared_licenses)
152-
if scoring_elements.precise_license_detection:
151+
scoring_elements.identification_precision = check_declared_licenses(declared_licenses)
152+
if scoring_elements.identification_precision:
153153
scoring_elements.score += 40
154154

155155
scoring_elements.has_license_text = check_for_license_texts(declared_licenses)
@@ -203,7 +203,7 @@ def unique(objects):
203203
class ScoringElements:
204204
score = attr.ib(default=0)
205205
declared_license = attr.ib(default=False)
206-
precise_license_detection = attr.ib(default=False)
206+
identification_precision = attr.ib(default=False)
207207
has_license_text = attr.ib(default=False)
208208
declared_copyrights = attr.ib(default=False)
209209
conflicting_license_categories = attr.ib(default=False)
@@ -213,7 +213,7 @@ def to_dict(self):
213213
return {
214214
'score': self.score,
215215
'declared_license': self.declared_license,
216-
'precise_license_detection': self.precise_license_detection,
216+
'identification_precision': self.identification_precision,
217217
'has_license_text': self.has_license_text,
218218
'declared_copyrights': self.declared_copyrights,
219219
'conflicting_license_categories': self.conflicting_license_categories,

tests/summarycode/data/classify/cli.expected.json

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,4 @@
11
{
2-
"headers": [
3-
{
4-
"tool_name": "scancode-toolkit",
5-
"options": {
6-
"input": "<path>",
7-
"--classify": true,
8-
"--info": true,
9-
"--json-pp": "<file>"
10-
},
11-
"notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.",
12-
"output_format_version": "2.0.0",
13-
"message": null,
14-
"errors": [],
15-
"warnings": [],
16-
"extra_data": {
17-
"system_environment": {
18-
"operating_system": "linux",
19-
"cpu_architecture": "64",
20-
"platform": "Linux-5.4.0-109-generic-x86_64-with-Ubuntu-18.04-bionic",
21-
"platform_version": "#123~18.04.1-Ubuntu SMP Fri Apr 8 09:48:52 UTC 2022",
22-
"python_version": "3.6.9 (default, Mar 15 2022, 13:55:28) \n[GCC 8.4.0]"
23-
},
24-
"spdx_license_list_version": "3.16",
25-
"files_count": 8
26-
}
27-
}
28-
],
292
"files": [
303
{
314
"path": "cli",

tests/summarycode/data/facet/cli.expected.json

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,4 @@
11
{
2-
"headers": [
3-
{
4-
"tool_name": "scancode-toolkit",
5-
"options": {
6-
"input": "<path>",
7-
"--facet": [
8-
"dev=*.c",
9-
"tests=*/tests/*",
10-
"data=*.json",
11-
"docs=*/docs/*"
12-
],
13-
"--json-pp": "<file>"
14-
},
15-
"notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.",
16-
"output_format_version": "2.0.0",
17-
"message": null,
18-
"errors": [],
19-
"warnings": [],
20-
"extra_data": {
21-
"system_environment": {
22-
"operating_system": "linux",
23-
"cpu_architecture": "64",
24-
"platform": "Linux-5.4.0-109-generic-x86_64-with-Ubuntu-18.04-bionic",
25-
"platform_version": "#123~18.04.1-Ubuntu SMP Fri Apr 8 09:48:52 UTC 2022",
26-
"python_version": "3.6.9 (default, Mar 15 2022, 13:55:28) \n[GCC 8.4.0]"
27-
},
28-
"spdx_license_list_version": "3.16",
29-
"files_count": 56
30-
}
31-
}
32-
],
332
"files": [
343
{
354
"path": "cli",

tests/summarycode/data/generated/cli.expected.json

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,4 @@
11
{
2-
"headers": [
3-
{
4-
"tool_name": "scancode-toolkit",
5-
"options": {
6-
"input": "<path>",
7-
"--generated": true,
8-
"--json-pp": "<file>"
9-
},
10-
"notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.",
11-
"output_format_version": "2.0.0",
12-
"message": null,
13-
"errors": [],
14-
"warnings": [],
15-
"extra_data": {
16-
"system_environment": {
17-
"operating_system": "linux",
18-
"cpu_architecture": "64",
19-
"platform": "Linux-5.4.0-109-generic-x86_64-with-Ubuntu-18.04-bionic",
20-
"platform_version": "#123~18.04.1-Ubuntu SMP Fri Apr 8 09:48:52 UTC 2022",
21-
"python_version": "3.6.9 (default, Mar 15 2022, 13:55:28) \n[GCC 8.4.0]"
22-
},
23-
"spdx_license_list_version": "3.16",
24-
"files_count": 7
25-
}
26-
}
27-
],
282
"files": [
293
{
304
"path": "simple",

tests/summarycode/data/plugin_consolidate/component-package-build-expected.json

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,4 @@
11
{
2-
"headers": [
3-
{
4-
"tool_name": "scancode-toolkit",
5-
"options": {
6-
"input": "<path>",
7-
"--consolidate": true,
8-
"--copyright": true,
9-
"--info": true,
10-
"--json": "<file>",
11-
"--license": true,
12-
"--package": true
13-
},
14-
"notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.",
15-
"output_format_version": "2.0.0",
16-
"message": null,
17-
"errors": [],
18-
"warnings": [
19-
"The --consolidate option will be deprecated in a future version of scancode-toolkit."
20-
],
21-
"extra_data": {
22-
"system_environment": {
23-
"operating_system": "linux",
24-
"cpu_architecture": "64",
25-
"platform": "Linux-5.4.0-109-generic-x86_64-with-Ubuntu-18.04-bionic",
26-
"platform_version": "#123~18.04.1-Ubuntu SMP Fri Apr 8 09:48:52 UTC 2022",
27-
"python_version": "3.6.9 (default, Mar 15 2022, 13:55:28) \n[GCC 8.4.0]"
28-
},
29-
"spdx_license_list_version": "3.16",
30-
"files_count": 8
31-
}
32-
}
33-
],
342
"dependencies": [],
353
"packages": [
364
{

tests/summarycode/data/plugin_consolidate/component-package-expected.json

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,4 @@
11
{
2-
"headers": [
3-
{
4-
"tool_name": "scancode-toolkit",
5-
"options": {
6-
"input": "<path>",
7-
"--copyright": true,
8-
"--info": true,
9-
"--json": "<file>",
10-
"--license": true,
11-
"--package": true
12-
},
13-
"notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.",
14-
"output_format_version": "2.0.0",
15-
"message": null,
16-
"errors": [],
17-
"warnings": [],
18-
"extra_data": {
19-
"system_environment": {
20-
"operating_system": "linux",
21-
"cpu_architecture": "64",
22-
"platform": "Linux-5.4.0-109-generic-x86_64-with-Ubuntu-18.04-bionic",
23-
"platform_version": "#123~18.04.1-Ubuntu SMP Fri Apr 8 09:48:52 UTC 2022",
24-
"python_version": "3.6.9 (default, Mar 15 2022, 13:55:28) \n[GCC 8.4.0]"
25-
},
26-
"spdx_license_list_version": "3.16",
27-
"files_count": 7
28-
}
29-
},
30-
{
31-
"tool_name": "scancode-toolkit",
32-
"options": {
33-
"input": "<path>",
34-
"--consolidate": true,
35-
"--from-json": true,
36-
"--json": "<file>"
37-
},
38-
"notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.",
39-
"output_format_version": "2.0.0",
40-
"message": null,
41-
"errors": [],
42-
"warnings": [
43-
"The --consolidate option will be deprecated in a future version of scancode-toolkit."
44-
],
45-
"extra_data": {
46-
"system_environment": {
47-
"operating_system": "linux",
48-
"cpu_architecture": "64",
49-
"platform": "Linux-5.4.0-109-generic-x86_64-with-Ubuntu-18.04-bionic",
50-
"platform_version": "#123~18.04.1-Ubuntu SMP Fri Apr 8 09:48:52 UTC 2022",
51-
"python_version": "3.6.9 (default, Mar 15 2022, 13:55:28) \n[GCC 8.4.0]"
52-
},
53-
"spdx_license_list_version": "3.16",
54-
"files_count": 7
55-
}
56-
}
57-
],
582
"dependencies": [],
593
"packages": [
604
{

tests/summarycode/data/plugin_consolidate/e2fsprogs-expected.json

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,4 @@
11
{
2-
"headers": [
3-
{
4-
"tool_name": "scancode-toolkit",
5-
"options": {
6-
"input": [
7-
"e2fsprogs-1.45.4"
8-
],
9-
"--copyright": true,
10-
"--email": true,
11-
"--info": true,
12-
"--json-pp": "e2fsprogs-1.45.4-a-no-configure.json",
13-
"--license": true,
14-
"--max-in-memory": 0,
15-
"--package": true,
16-
"--processes": "6",
17-
"--url": true
18-
},
19-
"notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.",
20-
"output_format_version": null,
21-
"message": null,
22-
"errors": [],
23-
"warnings": [],
24-
"extra_data": {
25-
"files_count": 2183
26-
}
27-
},
28-
{
29-
"tool_name": "scancode-toolkit",
30-
"options": {
31-
"input": "<path>",
32-
"--consolidate": true,
33-
"--from-json": true,
34-
"--json": "<file>"
35-
},
36-
"notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.",
37-
"output_format_version": "2.0.0",
38-
"message": null,
39-
"errors": [],
40-
"warnings": [
41-
"The --consolidate option will be deprecated in a future version of scancode-toolkit."
42-
],
43-
"extra_data": {
44-
"system_environment": {
45-
"operating_system": "linux",
46-
"cpu_architecture": "64",
47-
"platform": "Linux-5.4.0-109-generic-x86_64-with-Ubuntu-18.04-bionic",
48-
"platform_version": "#123~18.04.1-Ubuntu SMP Fri Apr 8 09:48:52 UTC 2022",
49-
"python_version": "3.6.9 (default, Mar 15 2022, 13:55:28) \n[GCC 8.4.0]"
50-
},
51-
"spdx_license_list_version": "3.16",
52-
"files_count": 2183
53-
}
54-
}
55-
],
562
"consolidated_components": [
573
{
584
"type": "holders",

tests/summarycode/data/plugin_consolidate/license-holder-rollup-expected.json

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,4 @@
11
{
2-
"headers": [
3-
{
4-
"tool_name": "scancode-toolkit",
5-
"options": {
6-
"input": "<path>",
7-
"--consolidate": true,
8-
"--copyright": true,
9-
"--info": true,
10-
"--json": "<file>",
11-
"--license": true,
12-
"--package": true
13-
},
14-
"notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.",
15-
"output_format_version": "2.0.0",
16-
"message": null,
17-
"errors": [],
18-
"warnings": [
19-
"The --consolidate option will be deprecated in a future version of scancode-toolkit."
20-
],
21-
"extra_data": {
22-
"system_environment": {
23-
"operating_system": "linux",
24-
"cpu_architecture": "64",
25-
"platform": "Linux-5.4.0-109-generic-x86_64-with-Ubuntu-18.04-bionic",
26-
"platform_version": "#123~18.04.1-Ubuntu SMP Fri Apr 8 09:48:52 UTC 2022",
27-
"python_version": "3.6.9 (default, Mar 15 2022, 13:55:28) \n[GCC 8.4.0]"
28-
},
29-
"spdx_license_list_version": "3.16",
30-
"files_count": 3
31-
}
32-
}
33-
],
342
"dependencies": [],
353
"packages": [],
364
"consolidated_components": [

tests/summarycode/data/plugin_consolidate/multiple-same-holder-and-license-expected.json

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,4 @@
11
{
2-
"headers": [
3-
{
4-
"tool_name": "scancode-toolkit",
5-
"options": {
6-
"input": "<path>",
7-
"--consolidate": true,
8-
"--copyright": true,
9-
"--info": true,
10-
"--json": "<file>",
11-
"--license": true,
12-
"--package": true
13-
},
14-
"notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.",
15-
"output_format_version": "2.0.0",
16-
"message": null,
17-
"errors": [],
18-
"warnings": [
19-
"The --consolidate option will be deprecated in a future version of scancode-toolkit."
20-
],
21-
"extra_data": {
22-
"system_environment": {
23-
"operating_system": "linux",
24-
"cpu_architecture": "64",
25-
"platform": "Linux-5.4.0-109-generic-x86_64-with-Ubuntu-18.04-bionic",
26-
"platform_version": "#123~18.04.1-Ubuntu SMP Fri Apr 8 09:48:52 UTC 2022",
27-
"python_version": "3.6.9 (default, Mar 15 2022, 13:55:28) \n[GCC 8.4.0]"
28-
},
29-
"spdx_license_list_version": "3.16",
30-
"files_count": 2
31-
}
32-
}
33-
],
342
"dependencies": [],
353
"packages": [],
364
"consolidated_components": [

tests/summarycode/data/plugin_consolidate/package-files-not-counted-in-license-holders-expected.json

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,4 @@
11
{
2-
"headers": [
3-
{
4-
"tool_name": "scancode-toolkit",
5-
"options": {
6-
"input": "<path>",
7-
"--consolidate": true,
8-
"--copyright": true,
9-
"--info": true,
10-
"--json": "<file>",
11-
"--license": true,
12-
"--package": true
13-
},
14-
"notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.",
15-
"output_format_version": "2.0.0",
16-
"message": null,
17-
"errors": [],
18-
"warnings": [
19-
"The --consolidate option will be deprecated in a future version of scancode-toolkit."
20-
],
21-
"extra_data": {
22-
"system_environment": {
23-
"operating_system": "linux",
24-
"cpu_architecture": "64",
25-
"platform": "Linux-5.4.0-109-generic-x86_64-with-Ubuntu-18.04-bionic",
26-
"platform_version": "#123~18.04.1-Ubuntu SMP Fri Apr 8 09:48:52 UTC 2022",
27-
"python_version": "3.6.9 (default, Mar 15 2022, 13:55:28) \n[GCC 8.4.0]"
28-
},
29-
"spdx_license_list_version": "3.16",
30-
"files_count": 6
31-
}
32-
}
33-
],
342
"dependencies": [],
353
"packages": [
364
{

0 commit comments

Comments
 (0)