Skip to content

Add new rule for public domain license #4127

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

alok1304
Copy link
Collaborator

@alok1304 alok1304 commented Feb 2, 2025

Fixes #3997

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: Alok Kumar alokkumarjipura9973@gmail.com

@alok1304 alok1304 force-pushed the add_new_rule_for_public-domain branch from 92d6b35 to af36c8d Compare February 2, 2025 18:28
@alok1304
Copy link
Collaborator Author

alok1304 commented Feb 2, 2025

Now, we detects the correct license expression.

"files": [
    {
      "path": "pom.xml",
      "type": "file",
      "detected_license_expression": "public-domain",
      "detected_license_expression_spdx": "LicenseRef-scancode-public-domain",
      "license_detections": [
        {
          "license_expression": "public-domain",
          "license_expression_spdx": "LicenseRef-scancode-public-domain",
          "matches": [
            {
              "license_expression": "public-domain",
              "license_expression_spdx": "LicenseRef-scancode-public-domain",
              "from_file": "pom.xml",
              "start_line": 36,
              "end_line": 42,
              "matcher": "2-aho",
              "score": 100.0,
              "matched_length": 22,
              "match_coverage": 100.0,
              "rule_relevance": 100,
              "rule_identifier": "public-domain_537.RULE",
              "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/public-domain_537.RULE",
              "matched_text": "    <licenses>\r\n        <license>\r\n            <name>Public Domain</name>\r\n            <url>https://github.com/stleary/JSON-java/blob/master/LICENSE</url>\r\n            <distribution>repo</distribution>\r\n        </license>\r\n    </licenses>",
              "matched_text_diagnostics": "licenses>\r\n        <license>\r\n            <name>Public Domain</name>\r\n            <url>https://github.com/stleary/JSON-java/blob/master/LICENSE</url>\r\n            <distribution>repo</distribution>\r\n        </license>\r\n    </licenses>"
            }
          ],
          "identifier": "public_domain-208c1387-6950-7abe-1990-a436120d6de1"
        }
      ],
      "license_clues": [],
      "percentage_of_license_text": 4.2,
      "scan_errors": []
    }
  ]

@AyanSinhaMahapatra can you review this PR, simply I add a new rule for public-domain.

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.

@alok1304 Thanks++ See comments for your consideration

---

<licenses>
<license>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a required phrases from license to public domain
These type of rules often generate false positives based on the other words matched

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alok1304 this is not resolved yet, we need the whole required phrase: <license> <name> public domain because otherwise this might get wrongly detected to just public domain phrases which might be present in other contexts than software license.

@alok1304 alok1304 force-pushed the add_new_rule_for_public-domain branch 2 times, most recently from 6b0a615 to e05538d Compare May 30, 2025 14:27
@alok1304 alok1304 closed this May 30, 2025
@alok1304 alok1304 force-pushed the add_new_rule_for_public-domain branch from e05538d to 1250647 Compare May 30, 2025 14:28
@alok1304 alok1304 reopened this May 30, 2025
Reference: aboutcode-org#3997
Signed-off-by: Alok Kumar <alokkumarjipura9973@gmail.com>
@alok1304 alok1304 force-pushed the add_new_rule_for_public-domain branch from d979a55 to 944496a Compare May 30, 2025 14:53
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.

Comments not resolved, see #4127 (comment) for your consideration @alok1304 thanks!

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.

License is not being detected
2 participants