Skip to content

Conversation

@Jayant-kernel
Copy link

@Jayant-kernel Jayant-kernel commented Jan 9, 2026

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

@Jayant-kernel Jayant-kernel force-pushed the fix-unknown-license-rule branch 2 times, most recently from 59456d8 to bc9144d Compare January 10, 2026 04:26
@Jayant-kernel
Copy link
Author

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
✅ All 474 local license tests pass
✅ DCO signed
CI Failures: The failing CI jobs (Ubuntu 22/24, macOS 13/14) all have the same error:

ImportError: cannot import name 'py36' from 'commoncode.system'

Signed-off-by: Jayan <jayantmcom@example.com>
Signed-off-by: Jayan <jayantmcom@gmail.com>
@Jayant-kernel Jayant-kernel force-pushed the fix-unknown-license-rule branch 2 times, most recently from c554c10 to ab2908a Compare January 19, 2026 14:31
@Jayant-kernel
Copy link
Author

@Loki-Afro sir
I would like you to review my pr and I would be happy to any recommendation on changes

@Jayant-kernel Jayant-kernel force-pushed the fix-unknown-license-rule branch 2 times, most recently from fe125b6 to dfe568c Compare January 20, 2026 19:09
@Jayant-kernel Jayant-kernel reopened this Jan 20, 2026
@Jayant-kernel Jayant-kernel reopened this Jan 20, 2026
@Jayant-kernel
Copy link
Author

Hi Hi @pombredanne @JonoYang @AyanSinhaMahapatra

This PR has been open for 2 weeks with all CI tests passing. Quick summary:

Problem: unknown_10.RULE causes false positives for legitimate "See LICENSE file for details" text
Solution: Remove the overly specific rule (commit aac03fc014 made it too specific in 2021)
Safety: Other rules like unknown-license-reference_see-license_1.RULE already handle this pattern correctly

Fixes #4481. Would appreciate a review when you have time!..

@Jayant-kernel
Copy link
Author

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!..

Copy link
Member

@AyanSinhaMahapatra AyanSinhaMahapatra left a 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
Copy link
Member

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.

Copy link
Author

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.

@Jayant-kernel Jayant-kernel force-pushed the fix-unknown-license-rule branch 2 times, most recently from c5dbc60 to b4ca654 Compare January 29, 2026 04:53
@Jayant-kernel
Copy link
Author

@AyanSinhaMahapatra ,
Thanks for the feedback.I've updated the rule to add the referenced_filenames
field pointing to LICENSE as you suggested.

Add referenced_filenames field pointing to LICENSE file and detect the actual license.

Signed-off-by: Jayant Saxena <jayantmcom@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Obvious mit text is detected as unknown-license-reference

2 participants