You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not actually sure, it might be that crates.io check the license field to be a valid expression. Even if that's the case, then it would still be nice to catch this sort of mistake earlier.
The lint should probably also deny specifying multiple licenses with /, which according to the documentation (see link above) is still accepted but not recommended:
Previously multiple licenses could be separated with a /, but that usage is deprecated.
Drawbacks
None that I can think of.
Example
E.g. MIT OR XD would be denied, since the XD license is not known. MIT/Apache-2.0 would get denied due to the deprecated slash syntax. An empty string would also get denied.
The text was updated successfully, but these errors were encountered:
The only drawback that I can think of is that alternative crate registries may not require respecting this standard as the documentation states that this is enforced by crates.io.
What it does
If a
license
field is defined inCargo.toml
, checks the contents to be a valid SPDX 2.1 license expression.https://doc.rust-lang.org/cargo/reference/manifest.html#the-license-and-license-file-fields
https://spdx.org/spdx-specification-21-web-version#h.jxpfx0ykyb60 (Appendix IV: SPDX License Expressions)
https://github.com/spdx/license-list-data/tree/v3.6
Categories (optional)
clippy::cargo
I'm not actually sure, it might be that crates.io check the license field to be a valid expression. Even if that's the case, then it would still be nice to catch this sort of mistake earlier.
The lint should probably also deny specifying multiple licenses with
/
, which according to the documentation (see link above) is still accepted but not recommended:Drawbacks
None that I can think of.
Example
E.g.
MIT OR XD
would be denied, since theXD
license is not known.MIT/Apache-2.0
would get denied due to the deprecated slash syntax. An empty string would also get denied.The text was updated successfully, but these errors were encountered: