tooling.mdMarkdown, rendered
Tooling
Use Rust-native tooling and enforce a reproducible quality pipeline.
Core Setup
- Install toolchain with
rustup; prefer stable by default. - Ensure required components are installed (for example
rustfmt,clippy). - For project consistency, use
rust-toolchain.tomlwhen teams need pinned channel/components. - Set
editionto the latest stable value supported by project constraints. - Set
rust-versioninCargo.tomlto declare MSRV policy.
CI Quality Gates
Use this sequence in CI:
cargo fmt --checkcargo clippy --all-targets --all-features -- -D warningscargo test --all-targets --all-features- Optional:
cargo test --doc
Cargo Patterns
- Use workspaces for multi-crate repos and shared lint/profile configuration.
- Build/test with relevant feature matrices for crates with optional features.
- Keep dependencies minimal and reviewed (
cargo treeand regular dependency maintenance checks).
Linting Practices
- Treat warnings as failures in CI for high-signal quality.
- Use targeted
#[allow]only with rationale; avoid broad lint suppression. - Prefer fixing root causes over suppressing clippy findings.