Architecture linter for Rust: TOML-declared layer, scope and dependency rules, enforced in cargo test and CI
// readme
arch-lint
Architecture linter for Rust projects and cross-language layer enforcement.
What it is
arch-lint catches the architectural mistake a PR review already caught once,
every time it happens again. Declare layering, scope, and dependency rules
in arch-lint.toml — no Rust code required — or write a custom Rule when
TOML is not enough. Rules run inside cargo test via arch_lint::check!(),
from the cargo arch-lint CLI, or embedded through the Session SDK. A
dual engine covers Rust (syn) today and other languages (Tree-sitter,
Kotlin first) for cross-language layering.
Install
- CLI:
cargo install --locked arch-lint-cli— installs botharch-lintandcargo-arch-lint(socargo arch-lint ...works too). cargo testroute:cargo add --dev arch-lint, then addarch_lint::check!();to a test file (see Quick Start below).- Prebuilt binaries /
cargo binstall: not yet — tracked in #14.
Quick Start (30 seconds)
cargo add --dev arch-lint
// tests/architecture.rs
arch_lint::check!(); // expands to a #[test] function
cargo install --locked arch-lint-cli
cargo arch-lint init
This creates…