-
-
Notifications
You must be signed in to change notification settings - Fork 27
Determine whether license info added/removed #29 #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
f0ba69c
Determine whether license info added/removed #29
johnmhoran 0f97600
Refactor _license_diff() #29
johnmhoran 76131bb
Refactor '_license_diff()' #29
johnmhoran 3690fb3
Redefine new_licenses and old_licenses #29
johnmhoran c36b72b
Fine tune '_license_diff()' and related tests #29
johnmhoran File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 @@ | ||
| Type of delta,Path,Name,Type,Size | ||
| license info added,some/path/a/a1.py,a1.py,file,350 | ||
| unmodified,some/path/b/b1.py,b1.py,file,290 |
This file contains hidden or 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 @@ | ||
| Type of delta,Path,Name,Type,Size | ||
| license info added,some/path/a/a1.py,a1.py,file,350 | ||
| unmodified,some/path/b/b1.py,b1.py,file,290 |
This file contains hidden or 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 @@ | ||
| Type of delta,Path,Name,Type,Size | ||
| license info removed,some/path/a/a1.py,a1.py,file,350 | ||
| unmodified,some/path/b/b1.py,b1.py,file,290 |
This file contains hidden or 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 @@ | ||
| Type of delta,Path,Name,Type,Size | ||
| license info removed,some/path/a/a1.py,a1.py,file,350 | ||
| unmodified,some/path/b/b1.py,b1.py,file,290 |
This file contains hidden or 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,41 @@ | ||
| { | ||
| "scancode_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.", | ||
| "scancode_version": "2.1.0", | ||
| "scancode_options": { | ||
| "--license": true, | ||
| "--info": true | ||
| }, | ||
| "files_count": 2, | ||
| "files": [ | ||
| { | ||
| "path": "some/path/a/a1.py", | ||
| "type": "file", | ||
| "name": "a1.py", | ||
| "size": 350, | ||
| "sha1": "222647771481d39dd3a53f6dc210c26abac37748", | ||
| "licenses": [ | ||
| { | ||
| "key": "apache-2.0", | ||
| "score": 80.0, | ||
| "short_name": "Apache 2.0", | ||
| "category": "Permissive" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "path": "some/path/b/b1.py", | ||
| "type": "file", | ||
| "name": "b1.py", | ||
| "size": 290, | ||
| "sha1": "333647771481d39dd3a53f6dc210c26abac37748", | ||
| "licenses": [ | ||
| { | ||
| "key": "mit", | ||
| "score": 100.0, | ||
| "short_name": "MIT License", | ||
| "category": "Permissive" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
41 changes: 41 additions & 0 deletions
41
tests/data/cli/scan_new_license_info_added_below_cutoff_score.json
This file contains hidden or 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,41 @@ | ||
| { | ||
| "scancode_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.", | ||
| "scancode_version": "2.1.0", | ||
| "scancode_options": { | ||
| "--license": true, | ||
| "--info": true | ||
| }, | ||
| "files_count": 2, | ||
| "files": [ | ||
| { | ||
| "path": "some/path/a/a1.py", | ||
| "type": "file", | ||
| "name": "a1.py", | ||
| "size": 350, | ||
| "sha1": "222647771481d39dd3a53f6dc210c26abac37748", | ||
| "licenses": [ | ||
| { | ||
| "key": "apache-2.0", | ||
| "score": 49.0, | ||
| "short_name": "Apache 2.0", | ||
| "category": "Permissive" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "path": "some/path/b/b1.py", | ||
| "type": "file", | ||
| "name": "b1.py", | ||
| "size": 290, | ||
| "sha1": "333647771481d39dd3a53f6dc210c26abac37748", | ||
| "licenses": [ | ||
| { | ||
| "key": "mit", | ||
| "score": 100.0, | ||
| "short_name": "MIT License", | ||
| "category": "Permissive" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
This file contains hidden or 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,34 @@ | ||
| { | ||
| "scancode_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.", | ||
| "scancode_version": "2.1.0", | ||
| "scancode_options": { | ||
| "--license": true, | ||
| "--info": true | ||
| }, | ||
| "files_count": 2, | ||
| "files": [ | ||
| { | ||
| "path": "some/path/a/a1.py", | ||
| "type": "file", | ||
| "name": "a1.py", | ||
| "size": 350, | ||
| "sha1": "222647771481d39dd3a53f6dc210c26abac37748", | ||
| "licenses": [] | ||
| }, | ||
| { | ||
| "path": "some/path/b/b1.py", | ||
| "type": "file", | ||
| "name": "b1.py", | ||
| "size": 290, | ||
| "sha1": "333647771481d39dd3a53f6dc210c26abac37748", | ||
| "licenses": [ | ||
| { | ||
| "key": "mit", | ||
| "score": 100.0, | ||
| "short_name": "MIT License", | ||
| "category": "Permissive" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
34 changes: 34 additions & 0 deletions
34
tests/data/cli/scan_new_license_info_removed_below_cutoff_score.json
This file contains hidden or 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,34 @@ | ||
| { | ||
| "scancode_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.", | ||
| "scancode_version": "2.1.0", | ||
| "scancode_options": { | ||
| "--license": true, | ||
| "--info": true | ||
| }, | ||
| "files_count": 2, | ||
| "files": [ | ||
| { | ||
| "path": "some/path/a/a1.py", | ||
| "type": "file", | ||
| "name": "a1.py", | ||
| "size": 350, | ||
| "sha1": "222647771481d39dd3a53f6dc210c26abac37748", | ||
| "licenses": [] | ||
| }, | ||
| { | ||
| "path": "some/path/b/b1.py", | ||
| "type": "file", | ||
| "name": "b1.py", | ||
| "size": 290, | ||
| "sha1": "333647771481d39dd3a53f6dc210c26abac37748", | ||
| "licenses": [ | ||
| { | ||
| "key": "mit", | ||
| "score": 100.0, | ||
| "short_name": "MIT License", | ||
| "category": "Permissive" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
This file contains hidden or 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,34 @@ | ||
| { | ||
| "scancode_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.", | ||
| "scancode_version": "2.1.0", | ||
| "scancode_options": { | ||
| "--license": true, | ||
| "--info": true | ||
| }, | ||
| "files_count": 2, | ||
| "files": [ | ||
| { | ||
| "path": "some/path/a/a1.py", | ||
| "type": "file", | ||
| "name": "a1.py", | ||
| "size": 300, | ||
| "sha1": "000647771481d39dd3a53f6dc210c26abac37748", | ||
| "licenses": [] | ||
| }, | ||
| { | ||
| "path": "some/path/b/b1.py", | ||
| "type": "file", | ||
| "name": "b1.py", | ||
| "size": 290, | ||
| "sha1": "333647771481d39dd3a53f6dc210c26abac37748", | ||
| "licenses": [ | ||
| { | ||
| "key": "mit", | ||
| "score": 100.0, | ||
| "short_name": "MIT License", | ||
| "category": "Permissive" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
34 changes: 34 additions & 0 deletions
34
tests/data/cli/scan_old_license_info_added_below_cutoff_score.json
This file contains hidden or 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,34 @@ | ||
| { | ||
| "scancode_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.", | ||
| "scancode_version": "2.1.0", | ||
| "scancode_options": { | ||
| "--license": true, | ||
| "--info": true | ||
| }, | ||
| "files_count": 2, | ||
| "files": [ | ||
| { | ||
| "path": "some/path/a/a1.py", | ||
| "type": "file", | ||
| "name": "a1.py", | ||
| "size": 300, | ||
| "sha1": "000647771481d39dd3a53f6dc210c26abac37748", | ||
| "licenses": [] | ||
| }, | ||
| { | ||
| "path": "some/path/b/b1.py", | ||
| "type": "file", | ||
| "name": "b1.py", | ||
| "size": 290, | ||
| "sha1": "333647771481d39dd3a53f6dc210c26abac37748", | ||
| "licenses": [ | ||
| { | ||
| "key": "mit", | ||
| "score": 100.0, | ||
| "short_name": "MIT License", | ||
| "category": "Permissive" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
This file contains hidden or 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,41 @@ | ||
| { | ||
| "scancode_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.", | ||
| "scancode_version": "2.1.0", | ||
| "scancode_options": { | ||
| "--license": true, | ||
| "--info": true | ||
| }, | ||
| "files_count": 2, | ||
| "files": [ | ||
| { | ||
| "path": "some/path/a/a1.py", | ||
| "type": "file", | ||
| "name": "a1.py", | ||
| "size": 300, | ||
| "sha1": "000647771481d39dd3a53f6dc210c26abac37748", | ||
| "licenses": [ | ||
| { | ||
| "key": "apache-2.0", | ||
| "score": 80.0, | ||
| "short_name": "Apache 2.0", | ||
| "category": "Permissive" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "path": "some/path/b/b1.py", | ||
| "type": "file", | ||
| "name": "b1.py", | ||
| "size": 290, | ||
| "sha1": "333647771481d39dd3a53f6dc210c26abac37748", | ||
| "licenses": [ | ||
| { | ||
| "key": "mit", | ||
| "score": 100.0, | ||
| "short_name": "MIT License", | ||
| "category": "Permissive" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
41 changes: 41 additions & 0 deletions
41
tests/data/cli/scan_old_license_info_removed_below_cutoff_score.json
This file contains hidden or 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,41 @@ | ||
| { | ||
| "scancode_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.", | ||
| "scancode_version": "2.1.0", | ||
| "scancode_options": { | ||
| "--license": true, | ||
| "--info": true | ||
| }, | ||
| "files_count": 2, | ||
| "files": [ | ||
| { | ||
| "path": "some/path/a/a1.py", | ||
| "type": "file", | ||
| "name": "a1.py", | ||
| "size": 300, | ||
| "sha1": "000647771481d39dd3a53f6dc210c26abac37748", | ||
| "licenses": [ | ||
| { | ||
| "key": "apache-2.0", | ||
| "score": 49.0, | ||
| "short_name": "Apache 2.0", | ||
| "category": "Permissive" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "path": "some/path/b/b1.py", | ||
| "type": "file", | ||
| "name": "b1.py", | ||
| "size": 290, | ||
| "sha1": "333647771481d39dd3a53f6dc210c26abac37748", | ||
| "licenses": [ | ||
| { | ||
| "key": "mit", | ||
| "score": 100.0, | ||
| "short_name": "MIT License", | ||
| "category": "Permissive" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not need to worry about info add or removed at this point in the code; this is already taken care of on line 187-190