Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix curation validation #1223

Merged
merged 1 commit into from
Nov 6, 2024

Conversation

qtomlinson
Copy link
Collaborator

@qtomlinson qtomlinson commented Nov 1, 2024

When the curated license contains NOASSERTION (e.g., MIT AND NOASSERTION), the curation should be invalid. In addition, when the curated license is not normalized, include the normalized license expression in the error message.

In the future, we can consider ignoring the cases of SPDX identifiers as per SPDX specification. For example, "MIT, Mit and mIt should all be treated as the same identifier".

When the curated license contains NOASSERTION (MIT AND NOASSERTION), the curation should be invalid
In addition, when the curated license is not normalized, include the normalized license expression in the error message.
@qtomlinson
Copy link
Collaborator Author

This is related to #1181

@qtomlinson qtomlinson marked this pull request as ready for review November 5, 2024 22:10
@qtomlinson qtomlinson requested a review from elrayle November 5, 2024 22:11
Copy link
Collaborator

@elrayle elrayle left a comment

Choose a reason for hiding this comment

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

Thanks for making it easier for the curator to understand, not just that something went wrong, but what went wrong.

expect(curation.errors[0].error).to.equal(
'/foo in 4.17.4 files with value "mit and apache-2.0" is not SPDX compliant'
)
describe('declared licenses', () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I appreciate all the tests. Makes it very clear what is happening.

errors.push(`${source} with value "${license}" is not SPDX compliant`)
} else if (parsed !== license) {
errors.push(`${source} with value "${license}" is not normalized. Suggest using "${parsed}"`)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is excellent feedback to the creator of the curation.

@qtomlinson qtomlinson merged commit f8e77ad into clearlydefined:master Nov 6, 2024
4 checks passed
@qtomlinson qtomlinson deleted the qt/validate_curation branch November 6, 2024 19:06
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants