rust-clippy: A collection of lints for catching common mistakes and improving Rust code.
What problem it solves
Rust projects need a way to identify common mistakes, suspicious patterns, and opportunities to write more idiomatic code. Lint categories and configurable levels let teams adopt these checks according to their own coding and CI requirements.
Key features
Categorized lints — Lints are organized into categories covering correctness, suspicious code, style, complexity, performance, pedantic checks, restrictions, nursery lints, and Cargo manifests. Each category has a default lint level.
Source: README
Cargo integration — Clippy runs as a Cargo subcommand, supports workspace package selection, and can automatically apply some lint suggestions with `--fix`.
Source: README, src/main.rs
Direct compiler-driver use — Projects that do not use Cargo can invoke `clippy-driver` with the same arguments used for `rustc`.
Source: README, src/driver.rs
Configurable lint behavior — Developers can allow, warn on, or deny lint groups and individual lints in source code or through command-line flags. Some lint behavior can also be set in `clippy.toml` or `.clippy.toml`.
Source: README, clippy.toml
Minimum supported Rust version — Projects can specify their minimum supported Rust version to disable lints that apply only to newer Rust features. The version can be supplied through configuration, `Cargo.toml`, or a Clippy attribute.
Source: README
Quick start
Copied verbatim from the project's README.
rustup updaterustup component add clippycargo clippyWho it may suit
This may suit Rust developers and teams that want to catch common mistakes, improve code style, or introduce lint checks into local development and CI workflows.
Topics to discuss
Which lint categories should be enabled by default in a shared project configuration?
How can CI distinguish Clippy warnings from warnings emitted by rustc?
Which configurable lints are most useful for enforcing project-specific conventions?
Written by ReadmeX AI from the project's README, source and public GitHub data; it may contain mistakes.
Read the original README https://github.com/rust-lang/rust-clippy#readme
ReadmeX opened this community for a trending project; it is not run by the project. Maintainers can claim it from the community page.
Comments
…