G0005 external-form¶
Rule: Crates of other projects come by git as the map lists them, used only where their role allows.
| Code | G0005 (stable, never reused) |
| Id | external-form |
| Category | graph |
| Source | spirit_level |
| Fix | by hand |
| Needs | the crate map ([map] or map-file) |
Level per tier¶
| Tier | Level | Reason |
|---|---|---|
| small | off | |
| small-workspace | off | |
| medium | off | |
| big | deny |
outside projects come by git on a branch, listed once, used where their role allows |
| ai | off | |
| embedded | off | |
| ui | off | |
| egui | off | |
| units-strict | off | |
| units-paranoid | off |
Why¶
Crates of other projects come in by git; Cargo.lock fixes the commit. A different URL brings a second copy, another branch than the listed one brings another line of work; a crate used from a layer that may not see its role leaks a dependency upward. Every git dependency is listed in [map.external], so the set of outside projects is visible in one place.
How to fix¶
Take it by git with the URL the map lists (and its branch, when the entry names one), from a crate whose layer may see the crate's role. A new outside crate gets an entry first.
Whether it may name a rev, tag or branch is the project's pin policy, checked by git-dependency-pins.
Configure¶
Allow one finding in the code with // spirit-level: allow(external-form) <reason> (waivers); the code works there too, as in [lints.G0005].