Repolode
rust-lang

rust-lang/rust-clippy

A Rust linter with over 800 lints that catches common mistakes and suggests more idiomatic code, run as a cargo subcommand.

Stars
13,625
Forks
2,238
Open issues
2,889
Last commit
18 hours ago

What is it?

Clippy is a linter for Rust that checks code for common mistakes, inefficient patterns and non-idiomatic style. It ships with over 800 lints grouped into categories such as correctness, suspicious, style, complexity, perf, pedantic and restriction, each with its own default level that can be changed to make the tool more or less strict.

It is typically run as a cargo subcommand with `cargo clippy` after installing the component through rustup. Some lints can be applied automatically with `cargo clippy --fix`. Projects without cargo can run `clippy-driver` with rustc-style arguments, and the tool can be added to CI pipelines so warnings or errors fail the build.

Lints can be configured per project through a `clippy.toml` file, for example to set a minimum supported Rust version (MSRV) or to disallow certain variable names. Lint levels can also be set inline in code with allow, warn or deny attributes, or globally with command-line flags.

Key features

  • 01Over 800 lints covering correctness, style, complexity and performance
  • 02Automatic fixes via `cargo clippy --fix` for some lints
  • 03Per-project configuration with clippy.toml, including MSRV settings
  • 04Works as a cargo subcommand or standalone through clippy-driver
  • 05Lint levels adjustable by category, in code or on the command line

Use cases

  • Catching common mistakes and inefficient patterns in Rust projects during development
  • Enforcing lint checks in CI so warnings fail the build
  • Keeping code idiomatic across a team by agreeing on a shared set of lints
  • Restricting specific patterns, such as unwrap or todo!, in stricter codebases

Quick start

  1. 1

    Install Rustup from rustup.rs

  2. 2

    Add the Clippy component

    rustup component add clippy
  3. 3

    Run Clippy in your Cargo project

    cargo clippy

Things to know

  • Clippy is a linter that runs on Rust code, so it only helps Rust projects.

In collections

Topics

FAQ

What is rust-clippy?
A Rust linter with over 800 lints that catches common mistakes and suggests more idiomatic code, run as a cargo subcommand. Clippy is a linter for Rust that checks code for common mistakes, inefficient patterns and non-idiomatic style. It ships with over 800 lints grouped into categories such as correctness, suspicious, style, complexity, perf, pedantic and restriction, each with its own default level that can be changed to make the tool more or less strict.
Is rust-clippy free to use? What license does it have?
rust-clippy is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is rust-clippy still maintained?
Actively maintained. The last commit to rust-clippy was on Nov 6, 2026.
What can I use rust-clippy for?
Catching common mistakes and inefficient patterns in Rust projects during development Enforcing lint checks in CI so warnings fail the build Keeping code idiomatic across a team by agreeing on a shared set of lints Restricting specific patterns, such as unwrap or todo!, in stricter codebases
How do I install rust-clippy?
Install Rustup from rustup.rs Add the Clippy component: rustup component add clippy Run Clippy in your Cargo project: cargo clippy
Where can I get rust-clippy?
The source code and installation instructions are on GitHub: https://github.com/rust-lang/rust-clippy

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects