A collection of lints to catch common mistakes and improve your [Rust](https://github.com/rust-lang/rust) code.
-[There are 208 lints included in this crate!](https://rust-lang-nursery.github.io/rust-clippy/master/index.html)
+[There are 249 lints included in this crate!](https://rust-lang-nursery.github.io/rust-clippy/master/index.html)
+
+We have a bunch of lint categories to allow you to choose how much clippy is supposed to ~~annoy~~ help you:
+
+* `clippy` (everything that has no false positives)
+* `clippy_pedantic` (everything)
+* `clippy_style` (code that should be written in a more idiomatic way)
+* `clippy_complexity` (code that does something simple but in a complex way)
+* `clippy_perf` (code that can be written in a faster way)
+* **`clippy_correctness`** (code that is just outright wrong or very very useless)
More to come, please [file an issue](https://github.com/rust-lang-nursery/rust-clippy/issues) if you have ideas!
As a general rule clippy will only work with the *latest* Rust nightly for now.
+To install Rust nightly, the recommended way is to use [rustup](https://rustup.rs/):
+
+```terminal
+rustup install nightly
+```
+
### As a cargo subcommand (`cargo clippy`)
One way to use clippy is by installing clippy through cargo as a cargo
subcommand.
```terminal
-cargo install clippy
+cargo +nightly install clippy
```
-Now you can run clippy by invoking `cargo clippy`, or
-`cargo +nightly clippy` directly from a directory that is usually
-compiled with stable.
+(The `+nightly` is not necessary if your default `rustup` install is nightly)
+
+Now you can run clippy by invoking `cargo +nightly clippy`.
+
+To update the subcommand together with the latest nightly use the [rust-update](rust-update) script or run:
+
+```terminal
+rustup update nightly
+cargo +nightly install --force clippy
+```
In case you are not using rustup, you need to set the environment flag
`SYSROOT` during installation so clippy knows where to find `librustc` and
#![cfg_attr(test, plugin(clippy))]
```
-### Running clippy from the command line without installing
+### Running clippy from the command line without installing it
-To have cargo compile your crate with clippy without needing `#![plugin(clippy)]`
+To have cargo compile your crate with clippy without clippy installation and without needing `#![plugin(clippy)]`
in your code, you can use:
```terminal
-cargo rustc -- -L /path/to/clippy_so/dir/ -Z extra-plugins=clippy
+cargo run --bin cargo-clippy --manifest-path=path_to_clippys_Cargo.toml
```
*[Note](https://github.com/rust-lang-nursery/rust-clippy/wiki#a-word-of-warning):*
## Configuration
-Some lints can be configured in a `clippy.toml` file. It contains basic `variable = value` mapping eg.
+Some lints can be configured in a TOML file named with `clippy.toml` or `.clippy.toml`. It contains basic `variable = value` mapping eg.
```toml
blacklisted-names = ["toto", "tata", "titi"]
Note: `deny` produces errors instead of warnings.
For convenience, `cargo clippy` automatically defines a `cargo-clippy`
-features. This lets you set lints level and compile with or without clippy
+feature. This lets you set lint levels and compile with or without clippy
transparently:
```rust