cargo_ratchet/lib.rs
1//! Prevent resolved versions in `Cargo.lock` from regressing below a
2//! committed baseline that only ratchets up.
3//!
4//! The binary (`cargo ratchet`) is a thin wrapper over this library. Embed
5//! the library when you want the same check inside another tool:
6//!
7//! - [`compute_violations`] is the pure comparison: two parsed lockfiles in,
8//! violations out.
9//! - [`check_and_advance`] adds the file orchestration: compare, and copy the
10//! lockfile over the baseline on a passing check.
11//! - [`check_fail_on_change`] is the read-only CI variant: pass only when the
12//! baseline is byte-identical to the lockfile.
13
14mod check_and_advance;
15mod check_fail_on_change;
16mod compute_violations;
17mod ratchet_paths;
18mod violation;
19
20pub use check_and_advance::check_and_advance;
21pub use check_fail_on_change::check_fail_on_change;
22pub use compute_violations::compute_violations;
23pub use ratchet_paths::RatchetPaths;
24pub use violation::Violation;