Skip to content

Commit

Permalink
Merge pull request #2968 from nexB/2967-rename-precise-license-detection
Browse files Browse the repository at this point in the history
Rename precise_license_detection field #2967
  • Loading branch information
JonoYang authored May 20, 2022
2 parents 99b85b1 + 90fc2f2 commit a314fa3
Show file tree
Hide file tree
Showing 42 changed files with 46 additions and 1,322 deletions.
34 changes: 27 additions & 7 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ Summary Plugin Update

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

We have preserved this functionality by creating a new plugin called ``tallies``.
All functionality of the previous summary plugin have been preserved in the
Expand All @@ -248,7 +248,7 @@ Summary Plugin Update
declared holder, and the primary programming language from a scan. And the
updated license clarity score provides context on the quality of the license
information provided in the codebase key files.

- The new summary plugin also returns lists of tallies for the other "secondary"
detected license expressions, copyright holders, and programming languages.

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

Changes:

- rename resource level attribute `packages` to `package_data`.
- add top-level attribute `packages`.
- add top-level attribute `dependencies`.
- add resource-level attribute `for_packages`.
- remove `package-data` attribute `root_path`.
- Rename resource level attribute `packages` to `package_data`.
- Add top-level attribute `packages`.
- Add top-level attribute `dependencies`.
- Add resource-level attribute `for_packages`.
- Remove `package-data` attribute `root_path`.
- The fields of the license clarity scoring plugin have been replaced with the
following fields. An overview of the new fields can be found in the "License
Clarity Scoring Update" section above.
- `score`
- `declared_license`
- `identification_precision`
- `has_license_text`
- `declared_copyrights`
- `conflicting_license_categories`
- `ambigious_compound_licensing`
- The fields of the summary plugin have been replaced with the following fields.
An overview of the new fields can be found in the "Summary Plugin Update"
section above.
- `declared_license_expression`
- `license_clarity_score`
- `declared_holder`
- `primary_language`
- `other_license_expressions`
- `other_holders`
- `other_languages`


Documentation Update
Expand Down
8 changes: 4 additions & 4 deletions src/summarycode/score.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ def compute_license_score(codebase):
if scoring_elements.declared_license:
scoring_elements.score += 40

scoring_elements.precise_license_detection = check_declared_licenses(declared_licenses)
if scoring_elements.precise_license_detection:
scoring_elements.identification_precision = check_declared_licenses(declared_licenses)
if scoring_elements.identification_precision:
scoring_elements.score += 40

scoring_elements.has_license_text = check_for_license_texts(declared_licenses)
Expand Down Expand Up @@ -203,7 +203,7 @@ def unique(objects):
class ScoringElements:
score = attr.ib(default=0)
declared_license = attr.ib(default=False)
precise_license_detection = attr.ib(default=False)
identification_precision = attr.ib(default=False)
has_license_text = attr.ib(default=False)
declared_copyrights = attr.ib(default=False)
conflicting_license_categories = attr.ib(default=False)
Expand All @@ -213,7 +213,7 @@ def to_dict(self):
return {
'score': self.score,
'declared_license': self.declared_license,
'precise_license_detection': self.precise_license_detection,
'identification_precision': self.identification_precision,
'has_license_text': self.has_license_text,
'declared_copyrights': self.declared_copyrights,
'conflicting_license_categories': self.conflicting_license_categories,
Expand Down
27 changes: 0 additions & 27 deletions tests/summarycode/data/classify/cli.expected.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,4 @@
{
"headers": [
{
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--classify": true,
"--info": true,
"--json-pp": "<file>"
},
"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.",
"output_format_version": "2.0.0",
"message": null,
"errors": [],
"warnings": [],
"extra_data": {
"system_environment": {
"operating_system": "linux",
"cpu_architecture": "64",
"platform": "Linux-5.4.0-109-generic-x86_64-with-Ubuntu-18.04-bionic",
"platform_version": "#123~18.04.1-Ubuntu SMP Fri Apr 8 09:48:52 UTC 2022",
"python_version": "3.6.9 (default, Mar 15 2022, 13:55:28) \n[GCC 8.4.0]"
},
"spdx_license_list_version": "3.16",
"files_count": 8
}
}
],
"files": [
{
"path": "cli",
Expand Down
31 changes: 0 additions & 31 deletions tests/summarycode/data/facet/cli.expected.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,4 @@
{
"headers": [
{
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--facet": [
"dev=*.c",
"tests=*/tests/*",
"data=*.json",
"docs=*/docs/*"
],
"--json-pp": "<file>"
},
"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.",
"output_format_version": "2.0.0",
"message": null,
"errors": [],
"warnings": [],
"extra_data": {
"system_environment": {
"operating_system": "linux",
"cpu_architecture": "64",
"platform": "Linux-5.4.0-109-generic-x86_64-with-Ubuntu-18.04-bionic",
"platform_version": "#123~18.04.1-Ubuntu SMP Fri Apr 8 09:48:52 UTC 2022",
"python_version": "3.6.9 (default, Mar 15 2022, 13:55:28) \n[GCC 8.4.0]"
},
"spdx_license_list_version": "3.16",
"files_count": 56
}
}
],
"files": [
{
"path": "cli",
Expand Down
26 changes: 0 additions & 26 deletions tests/summarycode/data/generated/cli.expected.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,4 @@
{
"headers": [
{
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--generated": true,
"--json-pp": "<file>"
},
"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.",
"output_format_version": "2.0.0",
"message": null,
"errors": [],
"warnings": [],
"extra_data": {
"system_environment": {
"operating_system": "linux",
"cpu_architecture": "64",
"platform": "Linux-5.4.0-109-generic-x86_64-with-Ubuntu-18.04-bionic",
"platform_version": "#123~18.04.1-Ubuntu SMP Fri Apr 8 09:48:52 UTC 2022",
"python_version": "3.6.9 (default, Mar 15 2022, 13:55:28) \n[GCC 8.4.0]"
},
"spdx_license_list_version": "3.16",
"files_count": 7
}
}
],
"files": [
{
"path": "simple",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,36 +1,4 @@
{
"headers": [
{
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--consolidate": true,
"--copyright": true,
"--info": true,
"--json": "<file>",
"--license": true,
"--package": true
},
"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.",
"output_format_version": "2.0.0",
"message": null,
"errors": [],
"warnings": [
"The --consolidate option will be deprecated in a future version of scancode-toolkit."
],
"extra_data": {
"system_environment": {
"operating_system": "linux",
"cpu_architecture": "64",
"platform": "Linux-5.4.0-109-generic-x86_64-with-Ubuntu-18.04-bionic",
"platform_version": "#123~18.04.1-Ubuntu SMP Fri Apr 8 09:48:52 UTC 2022",
"python_version": "3.6.9 (default, Mar 15 2022, 13:55:28) \n[GCC 8.4.0]"
},
"spdx_license_list_version": "3.16",
"files_count": 8
}
}
],
"dependencies": [],
"packages": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,60 +1,4 @@
{
"headers": [
{
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--copyright": true,
"--info": true,
"--json": "<file>",
"--license": true,
"--package": true
},
"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.",
"output_format_version": "2.0.0",
"message": null,
"errors": [],
"warnings": [],
"extra_data": {
"system_environment": {
"operating_system": "linux",
"cpu_architecture": "64",
"platform": "Linux-5.4.0-109-generic-x86_64-with-Ubuntu-18.04-bionic",
"platform_version": "#123~18.04.1-Ubuntu SMP Fri Apr 8 09:48:52 UTC 2022",
"python_version": "3.6.9 (default, Mar 15 2022, 13:55:28) \n[GCC 8.4.0]"
},
"spdx_license_list_version": "3.16",
"files_count": 7
}
},
{
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--consolidate": true,
"--from-json": true,
"--json": "<file>"
},
"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.",
"output_format_version": "2.0.0",
"message": null,
"errors": [],
"warnings": [
"The --consolidate option will be deprecated in a future version of scancode-toolkit."
],
"extra_data": {
"system_environment": {
"operating_system": "linux",
"cpu_architecture": "64",
"platform": "Linux-5.4.0-109-generic-x86_64-with-Ubuntu-18.04-bionic",
"platform_version": "#123~18.04.1-Ubuntu SMP Fri Apr 8 09:48:52 UTC 2022",
"python_version": "3.6.9 (default, Mar 15 2022, 13:55:28) \n[GCC 8.4.0]"
},
"spdx_license_list_version": "3.16",
"files_count": 7
}
}
],
"dependencies": [],
"packages": [
{
Expand Down
54 changes: 0 additions & 54 deletions tests/summarycode/data/plugin_consolidate/e2fsprogs-expected.json
Original file line number Diff line number Diff line change
@@ -1,58 +1,4 @@
{
"headers": [
{
"tool_name": "scancode-toolkit",
"options": {
"input": [
"e2fsprogs-1.45.4"
],
"--copyright": true,
"--email": true,
"--info": true,
"--json-pp": "e2fsprogs-1.45.4-a-no-configure.json",
"--license": true,
"--max-in-memory": 0,
"--package": true,
"--processes": "6",
"--url": true
},
"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.",
"output_format_version": null,
"message": null,
"errors": [],
"warnings": [],
"extra_data": {
"files_count": 2183
}
},
{
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--consolidate": true,
"--from-json": true,
"--json": "<file>"
},
"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.",
"output_format_version": "2.0.0",
"message": null,
"errors": [],
"warnings": [
"The --consolidate option will be deprecated in a future version of scancode-toolkit."
],
"extra_data": {
"system_environment": {
"operating_system": "linux",
"cpu_architecture": "64",
"platform": "Linux-5.4.0-109-generic-x86_64-with-Ubuntu-18.04-bionic",
"platform_version": "#123~18.04.1-Ubuntu SMP Fri Apr 8 09:48:52 UTC 2022",
"python_version": "3.6.9 (default, Mar 15 2022, 13:55:28) \n[GCC 8.4.0]"
},
"spdx_license_list_version": "3.16",
"files_count": 2183
}
}
],
"consolidated_components": [
{
"type": "holders",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,36 +1,4 @@
{
"headers": [
{
"tool_name": "scancode-toolkit",
"options": {
"input": "<path>",
"--consolidate": true,
"--copyright": true,
"--info": true,
"--json": "<file>",
"--license": true,
"--package": true
},
"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.",
"output_format_version": "2.0.0",
"message": null,
"errors": [],
"warnings": [
"The --consolidate option will be deprecated in a future version of scancode-toolkit."
],
"extra_data": {
"system_environment": {
"operating_system": "linux",
"cpu_architecture": "64",
"platform": "Linux-5.4.0-109-generic-x86_64-with-Ubuntu-18.04-bionic",
"platform_version": "#123~18.04.1-Ubuntu SMP Fri Apr 8 09:48:52 UTC 2022",
"python_version": "3.6.9 (default, Mar 15 2022, 13:55:28) \n[GCC 8.4.0]"
},
"spdx_license_list_version": "3.16",
"files_count": 3
}
}
],
"dependencies": [],
"packages": [],
"consolidated_components": [
Expand Down
Loading

0 comments on commit a314fa3

Please sign in to comment.