stern4rust/lib.rs
1// Copyright 2025 Umberto Gotti <umberto.gotti@umbertogotti.dev>
2// Licensed under the MIT License
3// SPDX-License-Identifier: MIT
4
5//! Holds a Rust workspace to its house coding rules and names every file that
6//! breaks one.
7//!
8//! **This library is not a public API. Depend on the binary,
9//! `cargo stern4rust`.**
10//!
11//! Module paths, type names and signatures may move in any release, including a
12//! patch, and no change to them is treated as breaking. Everything here is
13//! `pub` for one reason: this repository forbids unit tests, so every test lives
14//! in `tests/` and can only reach what is public. The surface is exactly as wide
15//! as the test suite needs, and it is reshaped whenever the rules require it --
16//! `directory-file-count` has already forced two restructures that moved public
17//! paths.
18//!
19//! What *is* promised is the binary: its exit codes (`0` clean, `1` could not
20//! run, `2` rule broken) and the shape of its `--format json` report. See
21//! `docs/ADRs/ADR-LibrarySurfaceIsNotAnApi.md`.
22
23pub mod adoption;
24pub mod finding;
25pub mod reporting;
26pub mod rule;
27pub mod rule_registry;
28pub mod rules;
29pub mod runner;
30pub mod settings;
31pub mod source_file;
32pub mod source_reader;
33pub mod source_walker;
34pub mod test_file_rewriter;