Skip to content

Commit a314fa3

Browse files
authored
Merge pull request #2968 from nexB/2967-rename-precise-license-detection
Rename precise_license_detection field #2967
2 parents 99b85b1 + 90fc2f2 commit a314fa3

42 files changed

Lines changed: 46 additions & 1322 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.

CHANGELOG.rst

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ Summary Plugin Update
238238

239239
- The summary plugin's behavior has been changed. Previously, it provided a
240240
count of the detected license expressions, copyrights, holders, authors, and
241-
programming languages from a scan.
241+
programming languages from a scan.
242242

243243
We have preserved this functionality by creating a new plugin called ``tallies``.
244244
All functionality of the previous summary plugin have been preserved in the
@@ -248,7 +248,7 @@ Summary Plugin Update
248248
declared holder, and the primary programming language from a scan. And the
249249
updated license clarity score provides context on the quality of the license
250250
information provided in the codebase key files.
251-
251+
252252
- The new summary plugin also returns lists of tallies for the other "secondary"
253253
detected license expressions, copyright holders, and programming languages.
254254

@@ -273,11 +273,31 @@ Scancode Data Output Version is now 2.0.0.
273273

274274
Changes:
275275

276-
- rename resource level attribute `packages` to `package_data`.
277-
- add top-level attribute `packages`.
278-
- add top-level attribute `dependencies`.
279-
- add resource-level attribute `for_packages`.
280-
- remove `package-data` attribute `root_path`.
276+
- Rename resource level attribute `packages` to `package_data`.
277+
- Add top-level attribute `packages`.
278+
- Add top-level attribute `dependencies`.
279+
- Add resource-level attribute `for_packages`.
280+
- Remove `package-data` attribute `root_path`.
281+
- The fields of the license clarity scoring plugin have been replaced with the
282+
following fields. An overview of the new fields can be found in the "License
283+
Clarity Scoring Update" section above.
284+
- `score`
285+
- `declared_license`
286+
- `identification_precision`
287+
- `has_license_text`
288+
- `declared_copyrights`
289+
- `conflicting_license_categories`
290+
- `ambigious_compound_licensing`
291+
- The fields of the summary plugin have been replaced with the following fields.
292+
An overview of the new fields can be found in the "Summary Plugin Update"
293+
section above.
294+
- `declared_license_expression`
295+
- `license_clarity_score`
296+
- `declared_holder`
297+
- `primary_language`
298+
- `other_license_expressions`
299+
- `other_holders`
300+
- `other_languages`
281301

282302

283303
Documentation Update

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": [

0 commit comments

Comments
 (0)