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

Lax parsing of Cargo-flavored SPDX #18

Closed
kornelski opened this issue Jan 25, 2020 · 2 comments · Fixed by #19
Closed

Lax parsing of Cargo-flavored SPDX #18

kornelski opened this issue Jan 25, 2020 · 2 comments · Fixed by #19
Labels
enhancement New feature or request

Comments

@kornelski
Copy link
Contributor

Cargo/crates-io is not strict about SPDX syntax, so it allows crates with licenses such as "MIT/Apache".

Currently this crate parses SPDX strictly, so many "Cargo-flavored" can't be parsed.

Would you be interested in expanding the parser to be more relaxed about the syntax and allow / as a synonym for OR and fix incomplete SPDX identifiers?

@kornelski kornelski added the enhancement New feature or request label Jan 25, 2020
@Jake-Shadle
Copy link
Member

I think it makes sense due to cargo's behavior, though if I recall correctly, it doesn't allow / in newly published crates at least. Since the expression parser always keeps its own copy of the original expression, it should be easy to correct malformed expressions before starting the parse like we do eg here

@Jake-Shadle
Copy link
Member

Quick follow up, as noted in #21 I accidentally released this change as a patch even though the minimum rust version was increased due to the use of #[non_exhaustive], so I've published a new version without #[non_exhaustive] and yanked 0.3.1, I hope that's ok!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants