Compiler lints for Rust rules that are hard to enforce consistently in review. Dylints adds deterministic, type-aware checks for APIs, project policy and maintenance patterns that otherwise depend on a reviewer remembering every edge case. That makes the checks useful for human and AI-assisted changes alike. They complement compiler diagnostics, Clippy, tests and code review.
The catalog contains 297 lints in nine general groups and 13
crate-specific groups. Every lint has examples, known limits and a default
Warn level. The optional crates/sagan-lints aggregate selects every group,
including the stricter policy checks.
Lint catalog · Guide · Coverage · Benchmarks
Install Dylint's command-line tools using the
upstream installation guide.
The examples below use Dylint 6.0.3 and the compiler used to validate this
repository, nightly-2026-07-15:
rustup toolchain install nightly-2026-07-15 --component rustc-dev --component llvm-tools-preview
cargo install --locked --version 6.0.3 cargo-dylint dylint-linkInstall the CLI tools with your normal Cargo toolchain. The lint libraries and Dylint driver use rustc's unstable compiler interfaces, so run Dylint with the pinned nightly shown above. The target workspace and its dependencies must compile under that nightly when Dylint checks them; ordinary application builds can continue using stable Rust. The repository development environment and compatibility details are in the usage guide.
In the root Cargo.toml of the workspace you want to lint, add a library
entry under workspace.metadata.dylint. Keep any entries already there. This
example selects the three recommended general groups:
[[workspace.metadata.dylint.libraries]]
git = "https://github.com/sagan-software/dylints"
branch = "main"
pattern = ["crates/correctness", "crates/perf", "crates/suspicious"]Run Dylint from that workspace root:
cargo +nightly-2026-07-15 dylint --all --workspace -- --all-targetsTo try only the Bevy-specific group without changing the workspace manifest, run this from the target workspace:
cargo +nightly-2026-07-15 dylint \
--git https://github.com/sagan-software/dylints \
--branch main \
--pattern crates/bevy \
--workspace -- \
--all-targetsChoose a Git tag or exact rev instead of branch = "main" for
reproducible builds. Do not load a parent group and its child libraries
together: that registers the same lints more than once.
Each general group is a Dylint library. Its directory is selected through the
pattern field above. The crates group contains the crate-specific groups;
select the parent or a child, never both.
cargochecks Cargo manifests, workspace dependencies and toolchain configuration.complexityfinds control flow and iteration that can be simplified.correctnesscatches likely bugs and failure-prone behavior.cratesregisters the crate-specific groups described below.maintainabilitymeasures complexity, coupling and public surface size.perfflags unnecessary allocations, copies and repeated work.restrictionenforces stricter project policies that may not suit every codebase.stylechecks Rust conventions and consistent implementations.suspicioushighlights error handling and constructs that deserve review.
Each linked name is the crate's canonical spelling and points to its official project or documentation.
axumchecks router paths, nesting and service configuration for the Axum web framework.bevychecks ECS queries, systems, schedules and selected engine API usage in Bevy.clapchecks derive attributes and command-line argument configuration for Clap.instachecks snapshot assertions, filters and snapshot file handling in Insta.reqwestchecks HTTP client construction, request loops, retries and TLS settings in reqwest.schemarschecks derives and schema metadata for Schemars, a Rust library for generating JSON Schema.serdechecks serialization and deserialization attributes and round-trip behavior in Serde.sqlxchecks query-builder use, row access and connection-pool settings in SQLx.strumchecks enum representation and derive behavior in Strum.test-casechecks parameterized test declarations and case matrices in test-case.thiserrorchecks error derives, source fields and display formatting in thiserror.tokiochecks runtime, task, channel and blocking-call patterns in Tokio.tracingchecks spans, fields and instrumentation in tracing.
Use the pinned environment for repository development and its compiler-based UI tests:
nix --accept-flake-config develop
cargo xtask --helpSee contributing, performance
and metric interpretation for validation and report details.
The catalog and guide are built as one Pages artifact by cargo xtask site.
The catalog's crates/sagan-lints-web/static/ assets and
crates/sagan-lints-web/templates/index.html.jinja adapt the Clippy lint list.
Clippy releases those assets under MIT or Apache-2.0. See the Clippy MIT
license.