Skip to content
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

utils/spdx: correctly detect non-deprecated licenses with plus #10685

Merged
merged 1 commit into from
Feb 24, 2021

Conversation

kthchew
Copy link
Contributor

@kthchew kthchew commented Feb 23, 2021

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?
    • NOTE: ran brew tests --online --only=utils/spdx, not brew tests

When running brew audit --strict FORMULA, it will warn you that a license is deprecated if it ends in a "+", even if it is not deprecated. When I tested an example from the documentation that was given as an example of a valid license (license "EPL-1.0+"), it was also showing this warning.

I found this over in Homebrew/homebrew-core#71682, when I found that "MPL-1.1+" was incorrectly showing a deprecated SPDX license warning. Essentially, valid_license? in utils/spdx.rb removed the "+" suffix when checking for validity, but deprecated_license? did not, causing something like "MPL-1.1+" to be marked as valid but deprecated.

These changes prevent the false positive and add tests related to this behavior.

Copy link
Member

@Bo98 Bo98 left a comment

Choose a reason for hiding this comment

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

Thanks @kthchew for the fix and the extra tests too!

@Bo98 Bo98 merged commit 9b94234 into Homebrew:master Feb 24, 2021
@BrewTestBot BrewTestBot added the outdated PR was locked due to age label Mar 27, 2021
@Homebrew Homebrew locked as resolved and limited conversation to collaborators Mar 27, 2021
@kthchew kthchew deleted the licenses-with-plus branch March 27, 2021 02:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants