Skip to content

Conversation

@uttam282005
Copy link
Contributor

Fixes #4530

added a new rule for agpl or gpl licenses.

Tasks

  • Reviewed contribution guidelines
  • PR is descriptively titled 📑 and links the original issue above 🔗
  • Tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR
    Run tests locally to check for errors.
  • Commits are in uniquely-named feature branch and has no merge conflicts 📁
  • Updated documentation pages (if applicable)
  • Updated CHANGELOG.rst (if applicable)

Signed-off-by: uttam282005 <uttam282005@gmail.com>
Copilot AI review requested due to automatic review settings January 6, 2026 09:50
Copy link

Copilot AI left a 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>
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.

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
Copy link
Member

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.

Copy link
Contributor Author

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.

@uttam282005
Copy link
Contributor Author

@AyanSinhaMahapatra thanks for the review. I will do the requested changes.

@uttam282005
Copy link
Contributor Author

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:

(gpl-2.0 OR agpl-3.0) AND agpl-3.0

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>
Signed-off-by: uttam282005 <uttam282005@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.

New license rule for AGPL or GPL

2 participants