M0011 publish-false¶
Rule: Workspace crates are publish = false unless listed as published.
| Code | M0011 (stable, never reused) |
| Id | publish-false |
| Category | manifest |
| Source | spirit_level |
| Fix | by hand |
Level per tier¶
| Tier | Level | Reason |
|---|---|---|
| small | off | |
| small-workspace | off | |
| medium | warn |
internal crates are a build unit, not an API; only listed crates are published |
| big | warn |
internal crates are a build unit, not an API; only listed crates are published |
| ai | off | |
| embedded | off | |
| ui | off | |
| egui | off | |
| units-strict | off | |
| units-paranoid | off |
Parameters¶
| Name | Type | Default | Meaning |
|---|---|---|---|
published |
list of strings | [] |
crates that are published (stable API) |
Why¶
In a workspace, crates are a build unit, not a published API. With publish = false they can be split, renamed and merged freely, and cargo publish cannot push one by accident. The few crates that are published (a stable API) are listed in the parameter published.
How to fix¶
Add publish = false under [package], or list the crate in published when it really is released.
Configure¶
[lints.publish-false]
level = "deny"
published = []
reason = "why this project wants it at this level"
Allow one finding in the code with // spirit-level: allow(publish-false) <reason> (waivers); the code works there too, as in [lints.M0011].