-
-
Notifications
You must be signed in to change notification settings - Fork 659
New license rule gpl or agpl #4668
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?
New license rule gpl or agpl #4668
Conversation
Signed-off-by: uttam282005 <uttam282005@gmail.com>
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.
Pull request overview
This PR introduces a new license rule file (gpl-2.0_or_agpl-3.0_1.RULE) to support detection of dual licensing under both GPLv2 and AGPLv3. The rule references its usage in the eloqkv project and includes the full text of both licenses for matching purposes.
- Adds support for dual-license detection (GPLv2 OR AGPLv3)
- Includes complete license texts and metadata configuration
- Provides minimum coverage threshold and ignorable copyright/holder information
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: uttam282005 <uttam282005@gmail.com>
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.
Thanks for the PR @uttam282005
Please do a license detection with diagnostics and only add relevant portions of the license text which is not detected properly as seperate rules.
scancode -l --license-text --license-diagnostics --license-text-diagnostics LICENSE --json-pp -
| --- | ||
|
|
||
|
|
||
| GNU GENERAL PUBLIC LICENSE |
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.
Please check if this GNU GPL license text matches well seperately, if not create a rule for this seperately from the previous intro "OR" license part.
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.
The GNU GPL license text matches correctly when tested separately using gpl-2.0_1433.RULE. However, when scanning the complete eloqkv license, this rule doesn't trigger. Instead, I get a false positive for tanuki-community-sla-1.3.LICENSE.
|
@AyanSinhaMahapatra thanks for the review. I will do the requested changes. |
|
I have implemented the requested changes and added a false-positive rule for the Tansuki rule. However, in addition to the OR license rule being detected, the individual AGPL license is also being triggered. As a result, the detected license expression becomes:
output.json {
"detected_license_expression": "(gpl-2.0 OR agpl-3.0) AND agpl-3.0",
"license_detections": [
{
"identifier": "agpl_3_0-4b6ba9e0-97bd-d731-4bf8-39162ec944d7",
"license_expression": "agpl-3.0",
"license_expression_spdx": "AGPL-3.0-only",
"detection_count": 1,
"reference_matches": [
{
"license_expression": "agpl-3.0",
"license_expression_spdx": "AGPL-3.0-only",
"from_file": "test.txt",
"start_line": 98,
"end_line": 279,
"matcher": "2-aho",
"score": 95.0,
"matched_length": 5030,
"match_coverage": 100.0,
"rule_relevance": 95,
"rule_identifier": "agpl-3.0_157.RULE",
"rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/agpl-3.0_157.RULE"
}
]
},
{
"identifier": "gpl_2_0_or_agpl_3_0-2c5ef08c-a421-ca24-9b98-b201138d8ba6",
"license_expression": "gpl-2.0 OR agpl-3.0",
"license_expression_spdx": "GPL-2.0-only OR AGPL-3.0-only",
"detection_count": 1,
"reference_matches": [
{
"license_expression": "gpl-2.0 OR agpl-3.0",
"license_expression_spdx": "GPL-2.0-only OR AGPL-3.0-only",
"from_file": "test.txt",
"start_line": 3,
"end_line": 6,
"matcher": "2-aho",
"score": 100.0,
"matched_length": 36,
"match_coverage": 100.0,
"rule_relevance": 100,
"rule_identifier": "gpl-2.0_or_agpl-3.0_1.RULE",
"rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/gpl-2.0_or_agpl-3.0_1.RULE"
}
]
}
]
} |
Signed-off-by: uttam282005 <uttam282005@gmail.com>
Signed-off-by: uttam282005 <uttam282005@gmail.com>
Fixes #4530
added a new rule for agpl or gpl licenses.
Tasks
Run tests locally to check for errors.