Find your next open-source project

Search by name, purpose, or keyword — or paste a GitHub repository URL

rust-lang/rust-clippy

Developer Tools

Official Rust linter with 800+ lints for correctness, style, complexity, performance, and MSRV-aware checks.

13,625
2,238
Rust
Apache-2.0
11 years old

What Clippy does

Clippy is the Rust project's official lint collection, aimed at catching common mistakes and steering code toward idiomatic style. It ships over 800 lints grouped into categories with different default levels: correctness (deny), suspicious, style, complexity, and perf (warn), plus pedantic, restriction, nursery, and cargo (allow). The default clippy::all group covers everything on by default. Lints can be allowed, warned, or denied per crate, module, or function, or passed on the command line.

Quick start

Install via rustup and run it as a Cargo subcommand:

rustup update
rustup component add clippy
cd /path/to/your-crate
cargo clippy

If rustup cannot find the clippy component, run rustup self update and retry. To apply fixable suggestions automatically, run cargo clippy --fix; note that --fix implies --all-targets.

For workspaces, cargo clippy -p example checks a specific member and its workspace dependencies. To check only that crate, use cargo clippy -p example -- --no-deps. Projects not using Cargo can invoke clippy-driver with the same arguments as rustc, but it is not a general replacement for rustc and may produce differently optimized artifacts.

To make CI fail on Clippy findings, either add #![deny(clippy::all)] to the crate or pass -D clippy::all; the README prefers CARGO_BUILD_WARNINGS=deny, which does not invalidate build caches. -D warnings remains the pre-Cargo-1.97 approach.

Configuration

Some lints are configurable in clippy.toml or .clippy.toml using variable = value entries, for example avoid-breaking-exported-api = false or disallowed-names = ["toto", "tata", "titi"]. List-type defaults can be extended with .., as in disallowed-names = ["bar", ".."]. This file cannot allow or deny lints. To suppress the “for further information” link in diagnostics, set CLIPPY_DISABLE_DOCS_LINKS.

Projects supporting older Rust versions can declare a minimum supported Rust version in clippy.toml (msrv = "1.30.0") or via rust-version in Cargo.toml, which disables lints for newer features. The patch version may be omitted. An attribute form (#![clippy::msrv = "1.30.0"]) exists but requires the unstable custom_inner_attributes feature.

Usage constraints

Clippy installs through rustup and needs at least Rust 1.29 for the component-install flow described in the README. The restriction category should emphatically not be enabled wholesale: those lints may flag reasonable code, lack suggestions, or conflict with other lints, and should be selected case by case. pedantic lints are aggressive and can produce occasional false positives. Diagnosing through clippy-driver is intended for linting, not as a production compiler replacement.

HotRepo's take

The repository showed up on HotRepo's Rust daily list on 2026-11-06 at position 15, with 13,621 stars and 2,236 forks at that snapshot and 4 stars gained that day. That is a single daily record with no all-language daily rank, so it supports only the fact of a recent Rust-list appearance, not a trend. What stands out technically is the breadth of the lint surface and the per-category default policy, which lets teams start with cargo clippy and tighten to deny-as-error in CI without adopting a separate toolchain.

Project source and documentation

Written by AI from the project's README, updated . The project's own docs are the source of truth.

Hacker News

Most Commonly Ignored Lints
▲ 1 · 0 comments · April 10, 2020