-
Notifications
You must be signed in to change notification settings - Fork 372
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
opam lint: Add support for the full SPDX license expression when checking the license #4768
Merged
+24
−500
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 task
03507a1
to
8d76894
Compare
This PR requires #4770 to be merged first. I've updated the description for a summary of the changes. This is ready to review. Current checklist for merging this includes:
|
AltGr
approved these changes
Aug 10, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, thanks !
mooreryan
added a commit
to mooreryan/bio_io
that referenced
this pull request
Mar 12, 2022
The current opam release cannot handle full SPDX license parsing. Work around it for now by specifying licenses in a list. See ocaml/opam#4768 for more info.
yawaramin
added a commit
to yawaramin/ocaml-decimal
that referenced
this pull request
Jul 29, 2023
As opam<2.2.0 doesn't support PSF-2.0 license and only 2.1.5 is released as non-alpha at the time of writing. Per ocaml/opam#4768
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #4598 and #4747
Implementation details at https://github.com/kit-ty-kate/spdx_licenses
Currently during linting, opam checks that the license field is a valid SPDX license. However:
The best one can do is to use the list format to say un implicit AND/OR (e.g.
license: ["MIT" "ISC"]
) and simply ignore the warning when the license isn't supported.This PR fixes all of those issues by allowing the complete SPDX license syntax: https://spdx.github.io/spdx-spec/appendix-IV-SPDX-license-expressions/
The syntax supports:
LicenseRef-custom-name
)Compared to the current state, apart from the new feature added, this changes:
WITH
operator is parsed. Currently opam parses it in a case-insensitive manner, but the SPDX standard requires it to be case-sensitive (see https://spdx.github.io/spdx-spec/appendix-IV-SPDX-license-expressions/#case-sensitivity). So licenses such asLGPL-2.1-or-later with OCaml-LGPL-linking-exception
will have to be renamedLGPL-2.1-or-later WITH OCaml-LGPL-linking-exception
to fit the standard.