-
-
Notifications
You must be signed in to change notification settings - Fork 681
Fix: Remove a confusing rule that misidentified 'See LICENSE' text #4671
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
base: develop
Are you sure you want to change the base?
Fix: Remove a confusing rule that misidentified 'See LICENSE' text #4671
Conversation
59456d8 to
bc9144d
Compare
|
Hi! I've completed the fix for issue #4481 by removing unknown_10.RULE which was causing false positive unknown-license-reference detections. Verification: ✅ Tested locally with node-cookie-signature v1.2.2 - now correctly shows only mit license ImportError: cannot import name 'py36' from 'commoncode.system' |
Signed-off-by: Jayan <jayantmcom@example.com> Signed-off-by: Jayan <jayantmcom@gmail.com>
c554c10 to
ab2908a
Compare
|
@Loki-Afro sir |
fe125b6 to
dfe568c
Compare
|
Hi Hi @pombredanne @JonoYang @AyanSinhaMahapatra This PR has been open for 2 weeks with all CI tests passing. Quick summary: Problem: Fixes #4481. Would appreciate a review when you have time!.. |
|
Hi Hi @pombredanne @JonoYang @AyanSinhaMahapatra This PR has been open for 2 weeks with all CI tests passing. Quick summary: Would appreciate a review when you have time!.. |
AyanSinhaMahapatra
left a comment
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.
@Jayant-kernel see my comment, this is not the solution which is needed.
| minimum_coverage: 100 | ||
| --- | ||
|
|
||
| "See LICENSE file for details" No newline at end of file |
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.
Why remove this?
The issue is not that we are detecting this piece of text incorrectly/generating false-positives, but that there is no referenced_filenames present so that we can follow the reference to a local file and then get the license detected from there.
Add a referenced_filenames: LICENSE to the rule frontmatter data.
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.
I've updated the rule to add the referenced_filenames
field pointing to LICENSE as you suggested.
c5dbc60 to
b4ca654
Compare
|
@AyanSinhaMahapatra , |
Add referenced_filenames field pointing to LICENSE file and detect the actual license. Signed-off-by: Jayant Saxena <jayantmcom@gmail.com>
b4ca654 to
3c197b2
Compare
Problem
The rule unknown_10.RULE was flagging "See LICENSE file for details" text as unknown-license-reference, which caused false positives in projects like node-cookie-signature that have valid LICENSE file references.
I##nvestigation
This rule was added back in Aug 2017 for a specific license pattern
Got updated in Mar 2021 to match "See LICENSE file for details" with quotes
The problem is it only matches the exact quoted phrase, which is too specific
Other existing rules already handle "See LICENSE" patterns without needing quotes
##Solution
Instead of removing the rule, I added a referenced_filenames field pointing to LICENSE. Now ScanCode can follow the reference and detect the actual license from the LICENSE file.
Testing
✅ No test files are affected
✅ The change is focused and minimal
Related Issues
Fixes #4481
Related to #4387 (similar issue with same rule)
Signed-off-by: Jayant Saxena jayantmcom@gmail.com