M0033 manifest-homepage¶
Rule: The shared package keys set repository, and homepage is the book's site_url when it has one.
| Code | M0033 (stable, never reused) |
| Id | manifest-homepage |
| Category | manifest |
| Source | spirit_level |
| Fix | exact: spl check --fix applies it |
Level per tier¶
| Tier | Level | Reason |
|---|---|---|
| small | warn |
crates.io and docs.rs link to repository and homepage; when there is a book, it is the homepage a reader wants |
| small-workspace | warn |
crates.io and docs.rs link to repository and homepage; when there is a book, it is the homepage a reader wants |
| medium | warn |
crates.io and docs.rs link to repository and homepage; when there is a book, it is the homepage a reader wants |
| big | warn |
crates.io and docs.rs link to repository and homepage; when there is a book, it is the homepage a reader wants |
| ai | off | |
| embedded | off | |
| ui | off | |
| egui | off | |
| units-strict | off | |
| units-paranoid | off |
Why¶
crates.io and docs.rs show a crate's repository and homepage as its links. Without repository, a reader of crates.io cannot find the source, and the README's CI badge has no address to point at. When the project publishes a book, the book is the homepage a reader wants; a homepage that names something else, or nothing, sends them past it.
The keys are read where they are written once: [workspace.package] in a workspace, the root [package] for one crate. The book's address is site_url in zensical.toml or mkdocs.yml; without one, only repository is checked.
[workspace.package]
repository = "https://github.com/OWNER/REPO"
homepage = "https://book.example.org/"
How to fix¶
Add repository. Set homepage to the book's site_url; spl check --fix writes it. Members inherit both with repository.workspace = true and homepage.workspace = true.
Configure¶
Allow one finding in the code with // spirit-level: allow(manifest-homepage) <reason> (waivers); the code works there too, as in [lints.M0033].