diff options
| -rw-r--r-- | README.md | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -120,6 +120,7 @@ Two tools keep this honest, and both are meant to be run, not read once: ``` cargo test --test architecture # ranks, no cycles, no globs, interface budgets python3 tools/arch-census.py # the numbers; --list-dead names them, --budget checks the ratchet +python3 tools/arch-census.py --list-overwide # pub(crate) items wider than anything reaches ``` ## Testing without root, network, or a real chroot @@ -260,3 +261,17 @@ These are not suggestions: `--list-dead` names every item behind them. A `pub` item that stays `pub` without an outside reader is allowed only by name, in the same budget file, with the reason beside it. +* `pub(crate)` is not the narrow state just because it is not `pub`. A + `pub(crate)` item nothing outside its own file names is **over-wide**: it + offers the whole crate a thing only its own file reaches, and it is one + keystroke from being a hole. `overwide` counts them per module and is held to + a budget exactly the way `deadonly` is — it may only shrink, and an item that + stays `pub(crate)` is allowed only by name in `over_visibility.allowlist`, + with the compiler fact that forces it beside it: a `pub(crate)` field cannot + carry a private type, privacy does not reach up to a parent or across to a + sibling module, and `pub(super)` is not a form this crate admits. + `--list-overwide` names them. The count is a grep, so it is a lead and the + compiler gives the verdict — and the verdict is asked under **both** profiles, + because the `cfg(not(feature = "test-support"))` half of a feature-conditional + declaration is never compiled by `cargo check --all-targets` and only a release + build ever says whether it can go private. |
