]> git.lizzy.rs Git - rust.git/blobdiff - README.md
rustup https://github.com/rust-lang/rust/pull/54071/
[rust.git] / README.md
index 25dbeaedcba9ea48e74c64e68d96cfcc38e0fe08..f2b0da3ae71e7dbe1c44f9a6ba7db5a37ebffa7c 100644 (file)
--- a/README.md
+++ b/README.md
@@ -2,14 +2,14 @@ We are currently in the process of discussing Clippy 1.0 via the RFC process in
 
 # Clippy
 
-[![Build Status](https://travis-ci.org/rust-lang-nursery/rust-clippy.svg?branch=master)](https://travis-ci.org/rust-lang-nursery/rust-clippy)
+[![Build Status](https://travis-ci.org/rust-lang/rust-clippy.svg?branch=master)](https://travis-ci.org/rust-lang/rust-clippy)
 [![Windows Build status](https://ci.appveyor.com/api/projects/status/id677xpw1dguo7iw?svg=true)](https://ci.appveyor.com/project/rust-lang-libs/rust-clippy)
 [![Current Version](https://meritbadge.herokuapp.com/clippy)](https://crates.io/crates/clippy)
-[![License: MPL-2.0](https://img.shields.io/crates/l/clippy.svg)](#license)
+[![License: MIT/Apache-2.0](https://img.shields.io/crates/l/clippy.svg)](#license)
 
 A collection of lints to catch common mistakes and improve your [Rust](https://github.com/rust-lang/rust) code.
 
-[There are 275 lints included in this crate!](https://rust-lang-nursery.github.io/rust-clippy/master/index.html)
+[There are 288 lints included in this crate!](https://rust-lang.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:
 
@@ -22,7 +22,16 @@ We have a bunch of lint categories to allow you to choose how much Clippy is sup
 * `clippy::cargo` (checks against the cargo manifest)
 * **`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!
+More to come, please [file an issue](https://github.com/rust-lang/rust-clippy/issues) if you have ideas!
+
+Only the following of those categories are enabled by default:
+
+* `clippy::style`
+* `clippy::correctness`
+* `clippy::complexity`
+* `clippy::perf`
+
+Other categories need to be enabled in order for their lints to be executed.
 
 Table of contents:
 
@@ -64,6 +73,8 @@ rustup component add clippy-preview
 
 Now you can run Clippy by invoking `cargo clippy`.
 
+If it says that it can't find the `clippy` subcommand, please run `rustup self update`
+
 ### Running Clippy from the command line without installing it
 
 To have cargo compile your crate with Clippy without Clippy installation
@@ -73,9 +84,30 @@ in your code, you can use:
 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):*
+*[Note](https://github.com/rust-lang/rust-clippy/wiki#a-word-of-warning):*
 Be sure that Clippy was compiled with the same version of rustc that cargo invokes here!
 
+### Travis CI
+
+You can add Clippy to Travis CI in the same way you use it locally:
+
+```yml
+language: rust
+rust:
+  - stable
+  - beta
+before_script:
+  - rustup component add clippy-preview
+script:
+  - cargo clippy
+  # if you want the build job to fail when encountering warnings, use
+  - cargo clippy -- -D warnings
+  # in order to also check tests and none-default crate features, use
+  - cargo clippy --all-targets --all-features -- -D warnings
+  - cargo test
+  # etc.
+```
+
 ## Configuration
 
 Some lints can be configured in a TOML file named `clippy.toml` or `.clippy.toml`. It contains a basic `variable = value` mapping eg.
@@ -85,7 +117,7 @@ blacklisted-names = ["toto", "tata", "titi"]
 cyclomatic-complexity-threshold = 30
 ```
 
-See the [list of lints](https://rust-lang-nursery.github.io/rust-clippy/master/index.html) for more information about which lints can be configured and the
+See the [list of lints](https://rust-lang.github.io/rust-clippy/master/index.html) for more information about which lints can be configured and the
 meaning of the variables.
 
 To deactivate the “for further information visit *lint-link*” message you can
@@ -107,22 +139,28 @@ You can add options to your code to `allow`/`warn`/`deny` Clippy lints:
 
 Note: `deny` produces errors instead of warnings.
 
-Note: To use the new `clippy::lint_name` syntax, `#![feature(tool_lints)]` has to be activated 
-currently. If you want to compile your code with the stable toolchain you can use a `cfg_attr` to 
+Note: To use the new `clippy::lint_name` syntax, a recent compiler has to be used
+currently. If you want to compile your code with the stable toolchain you can use a `cfg_attr` to
 activate the `tool_lints` feature:
 ```rust
-#![cfg_attr(feature = "cargo-clippy", feature(tool_lints))]
 #![cfg_attr(feature = "cargo-clippy", allow(clippy::lint_name))]
 ```
 
-For this to work you have to use Clippy on the nightly toolchain: `cargo +nightly clippy`. If you 
-want to use Clippy with the stable toolchain, you can stick to the old unscoped method to 
+For this to work you have to use Clippy on the nightly toolchain: `cargo +nightly clippy`. If you
+want to use Clippy with the stable toolchain, you can stick to the old unscoped method to
 enable/disable Clippy lints until `tool_lints` are stable:
 ```rust
 #![cfg_attr(feature = "cargo-clippy", allow(clippy_lint))]
 ```
 
+If you do not want to include your lint levels in your code, you can globally enable/disable lints by passing extra flags to clippy during the run: `cargo clippy -- -A lint_name` will run clippy with `lint_name` disabled and `cargo clippy -- -W lint_name` will run it with that enabled. On newer compilers you may need to use `clippy::lint_name` instead.
+
 ## License
 
-Licensed under [MPL](https://www.mozilla.org/MPL/2.0/).
-If you're having issues with the license, let me know and I'll try to change it to something more permissive.
+Copyright 2014-2018 The Rust Project Developers
+
+Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+<LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+option. All files in the project carrying such notice may not be
+copied, modified, or distributed except according to those terms.