Skip to content

Follow LICENSE.md for npm LicenseRef-LICENSE.md #2872 - #5383

Open
nikhilkumarpanigrahi wants to merge 1 commit into
aboutcode-org:developfrom
nikhilkumarpanigrahi:npm-licenseref-license-2872
Open

nikhilkumarpanigrahi wants to merge 1 commit into
aboutcode-org:developfrom
nikhilkumarpanigrahi:npm-licenseref-license-2872

Conversation

@nikhilkumarpanigrahi

Copy link
Copy Markdown

Fixes #2872

I checked the legacy npm "license": "LicenseRef-LICENSE" convention on current develop.
It already works: proprietary-license_720.RULE (added in 936b3a4) has
referenced_filenames: LICENSE, so the license in the sibling LICENSE file is followed.
This works for the string, dict and list forms, and for bower.json.

The LicenseRef-LICENSE.md variant did not work. LicenseRef-LICENSE.md is listed in
other_spdx_license_keys of proprietary-license, so it was matched by the
auto-generated SPDX identifier rule. That rule has no referenced_filenames, so
LICENSE.md was never followed and the package was reported as proprietary-license.

Changes

  • Add proprietary-license_1064.RULE for LicenseRef-LICENSE.md with
    referenced_filenames: LICENSE.md, same as proprietary-license_720.RULE.
  • Add regression tests in tests/packagedcode/test_license_detection.py for both
    LicenseRef-LICENSE and LicenseRef-LICENSE.md in a package.json, with an MIT
    license in the sibling file.
  • Add a CHANGELOG entry.

Results

package.json license Sibling file Before After
LicenseRef-LICENSE LICENSE (MIT) mit mit
LicenseRef-LICENSE.md LICENSE.md (MIT) proprietary-license mit
LicenseRef-LICENSE none proprietary-license proprietary-license

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
  • 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: nikhilkumarpanigrahi <nikhilkumarpanigrahi29@gmail.com>
Copilot AI balanced review requested due to automatic review settings October 22, 2026 08:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@nikhilkumarpanigrahi

Copy link
Copy Markdown
Author

@AyanSinhaMahapatra this PR is ready for review.

The license_validate_ignorables_2 failure is not related to this PR. It is the same pre-existing failure on fsl-1.1_1.RULE and fsl-1.1_2.RULE (from #5121), which are missing ignorable_urls: https://fsl.software/FSL-1.1-ALv2.template.md.

See also #5382 and #5364.

This branch has not been deployed

No deployments
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.

Ensure the "licenseref-license" convention of npm before 3.10 is detected correctly

2 participants