Skip to content

Support NONE and NOASSERTION in license expressions #307

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

goneall
Copy link
Member

@goneall goneall commented Apr 11, 2025

No description provided.

return new NoAssertionLicense();
} else if (SpdxConstantsCompatV2.NONE_VALUE.equals(token)) {
return new NoneLicense();
}else {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
}else {
} else {

Comment on lines +235 to +236
AnyLicenseInfo result = LicenseInfoFactory.parseSPDXLicenseStringCompatV2("MIT AND NOASSERTION AND NONE");
assertEquals("(MIT AND NOASSERTION AND NONE)",result.toString());
Copy link
Collaborator

Choose a reason for hiding this comment

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

@pmonks This part of the code targets SPDX 2.x. So it has to be separately resolved.

@goneall
Copy link
Member Author

goneall commented Apr 12, 2025

@pmonks @bact - thanks for the review and comments.

You're correct in that these are not officially part of the spec. There's a tool out there that's generating these expressions and the library creates a really bad error message.

I should probably change the code to just generate a decent error message rather than succeeding - hopefully we can add this to 3.1.

@bact
Copy link
Collaborator

bact commented Apr 12, 2025

It is possible that the code for 3.0 here (and its expression) will become valid, if eventually at some point NOASSERTION and NONE are added to the SPDX License List (without the need of spec amendment (3.1?)).

Alternatively, if it is not preferred to have NOASSERTION and NONE as a license-id in the SPDX License List,
it maybe possible to:

  1. define "LicenseRef-NOASSERTION" and "LicenseRef-NONE" as special instances of LicenseRef, to represent NOASSERTION and NONE; or
  2. define NOASSERTION and NONE as a special token in the expression syntax

Both (1) and (2) require the spec amendment.

@goneall
Copy link
Member Author

goneall commented Apr 14, 2025

Fixing the error message turned out to be problematic.

I'll switch this PR to draft mode awaiting the outcome of the discussion on license expressions.

@goneall goneall marked this pull request as draft April 14, 2025 17:40
@bact bact added enhancement New feature or request question Further information is requested labels Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants