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: fix invalid SPDX syntax for symbols #18169

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

cho-m
Copy link
Member

@cho-m cho-m commented Aug 26, 2024

Also use more common uppercase operators for backwards compatibility.

  • 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?

https://spdx.github.io/spdx-spec/v2.3/SPDX-license-expressions/#d1-overview - Spaces are invalid (e.g. Cannot Represent) and non-official SPDX entries must at least have LicenseRef- (could also have DocumentRef-<name>:LicenseRef- but I doubt we would ever need this in Homebrew).

SPDX expressions operators should be case-sensitive uppercase - https://spdx.github.io/spdx-spec/v2.3/SPDX-license-expressions/#d2-case-sensitivity (In PR, for backwards compatibility with existing JSON API, need to match both for now). EDIT: Lowercase is allowed in newer spec, but uppercase is more common so okay either way but switching seems better for compatibility.

WITH allows for a compound expression

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Makes sense, thanks @cho-m!

Library/Homebrew/utils/spdx.rb Outdated Show resolved Hide resolved
@cho-m cho-m marked this pull request as draft August 26, 2024 15:12
@cho-m cho-m force-pushed the spdx-case-sensitive branch from 65e6e4e to 66d25a5 Compare August 26, 2024 15:19
@cho-m cho-m marked this pull request as ready for review August 26, 2024 15:19
Library/Homebrew/utils/spdx.rb Outdated Show resolved Hide resolved
@cho-m cho-m changed the title utils/spdx: fix invalid SPDX syntax utils/spdx: fix invalid SPDX syntax and use more common uppercase operators Aug 26, 2024
Also use more common uppercase operators for backwards compatibility
@cho-m cho-m changed the title utils/spdx: fix invalid SPDX syntax and use more common uppercase operators utils/spdx: fix invalid SPDX syntax for symbols Aug 26, 2024
@cho-m cho-m force-pushed the spdx-case-sensitive branch from 66d25a5 to 82fbbcc Compare August 26, 2024 17:57
@cho-m
Copy link
Member Author

cho-m commented Aug 26, 2024

Updated to use LicenseRef-Homebrew-public-domain and LicenseRef-Homebrew-cannot-represent. Main reason is for simplicity of translation (since we could add other "allowed" symbols) and there isn't really a standard for these.

For public domain, if any identifier becomes well adopted, then we can consider switching. Currently, it is all over the place:

@MikeMcQuaid
Copy link
Member

Thanks again @cho-m!

@MikeMcQuaid MikeMcQuaid merged commit 81d26f8 into Homebrew:master Aug 27, 2024
27 checks passed
@cho-m cho-m deleted the spdx-case-sensitive branch August 27, 2024 12:32
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.

4 participants