M0010 package-license¶
Rule: Every crate states its licence.
| Code | M0010 (stable, never reused) |
| Id | package-license |
| Category | manifest |
| Source | spirit_level |
| Fix | by hand |
Level per tier¶
| Tier | Level | Reason |
|---|---|---|
| small | warn |
a crate without a licence cannot be reused or published |
| small-workspace | warn |
a crate without a licence cannot be reused or published |
| medium | warn |
a crate without a licence cannot be reused or published |
| big | warn |
a crate without a licence cannot be reused or published |
| ai | off | |
| embedded | off | |
| ui | off | |
| egui | off | |
| units-strict | off | |
| units-paranoid | off |
Why¶
A crate without a license (or license-file) cannot be reused, vendored or published, and licence checks such as cargo deny check licenses cannot judge it.
How to fix¶
Add license = "MIT OR Apache-2.0" (or the project's licence) to [package], or license.workspace = true in a workspace.
Configure¶
Allow one finding in the code with // spirit-level: allow(package-license) <reason> (waivers); the code works there too, as in [lints.M0010].