Merge pull request #655 from Manishearth/clearer-readme

Clarify readme
This commit is contained in:
Manish Goregaokar 2016-02-13 17:38:53 +05:30
commit 26e9dcdf5a

View File

@ -1,5 +1,7 @@
#rust-clippy
[![Build Status](https://travis-ci.org/Manishearth/rust-clippy.svg?branch=master)](https://travis-ci.org/Manishearth/rust-clippy)
[![Current Version](http://meritbadge.herokuapp.com/optional)](https://crates.io/crates/clippy)
[![License: MIT/Apache](https://img.shields.io/crates/l/clippy.svg)](#License)
A collection of lints to catch common mistakes and improve your Rust code.
@ -143,7 +145,7 @@ Add in your `Cargo.toml`:
clippy = "*"
```
You may also use [`cargo clippy`](https://github.com/arcnmx/cargo-clippy), a custom cargo subcommand that runs clippy on a given project.
You then need to add `#![feature(plugin)]` and `#![plugin(clippy)]` to the top of your crate entry point (`main.rs` or `lib.rs`).
Sample `main.rs`:
```rust
@ -172,6 +174,9 @@ src/main.rs:8:5: 11:6 help: Try
if let Some(y) = x { println!("{:?}", y) }
```
An alternate way to use clippy is by compiling and using [`cargo clippy`](https://github.com/arcnmx/cargo-clippy), a custom cargo subcommand that runs clippy on a given project.
You can add options to `allow`/`warn`/`deny`:
- the whole set of `Warn` lints using the `clippy` lint group (`#![deny(clippy)]`)
- all lints using both the `clippy` and `clippy_pedantic` lint groups (`#![deny(clippy)]`, `#![deny(clippy_pedantic)]`). Note that `clippy_pedantic` contains some very aggressive lints prone to false positives.