@@ -10,16 +10,16 @@ A collection of lints to catch common mistakes and improve your [Rust](https://g
10
10
Lints are divided into categories, each with a default [ lint level] ( https://doc.rust-lang.org/rustc/lints/levels.html ) .
11
11
You can choose how much Clippy is supposed to ~~ annoy~~ help you by changing the lint level by category.
12
12
13
- Category | Description | Default level
14
- -- | -- | --
15
- ` clippy::all ` | all lints that are on by default (correctness, style, complexity, perf) | ** warn/deny**
16
- ` clippy::correctness ` | code that is outright wrong or very useless | ** deny**
17
- ` clippy::style ` | code that should be written in a more idiomatic way | ** warn**
18
- ` clippy::complexity ` | code that does something simple but in a complex way | ** warn**
19
- ` clippy::perf ` | code that can be written to run faster | ** warn**
20
- ` clippy::pedantic ` | lints which are rather strict or might have false positives | allow
21
- ` clippy::nursery ` | new lints that are still under development | allow
22
- ` clippy::cargo ` | lints for the cargo manifest | allow
13
+ | Category | Description | Default level |
14
+ | --------------------- | ----------------------------------------------------------------------- | ------------- |
15
+ | ` clippy::all ` | all lints that are on by default (correctness, style, complexity, perf) | ** warn/deny** |
16
+ | ` clippy::correctness ` | code that is outright wrong or very useless | ** deny** |
17
+ | ` clippy::style ` | code that should be written in a more idiomatic way | ** warn** |
18
+ | ` clippy::complexity ` | code that does something simple but in a complex way | ** warn** |
19
+ | ` clippy::perf ` | code that can be written to run faster | ** warn** |
20
+ | ` clippy::pedantic ` | lints which are rather strict or might have false positives | allow |
21
+ | ` clippy::nursery ` | new lints that are still under development | allow |
22
+ | ` clippy::cargo ` | lints for the cargo manifest | allow |
23
23
24
24
More to come, please [ file an issue] ( https://github.com/rust-lang/rust-clippy/issues ) if you have ideas!
25
25
@@ -98,17 +98,6 @@ If you want to run Clippy **only** on the given crate, use the `--no-deps` optio
98
98
cargo clippy -p example -- --no-deps
99
99
```
100
100
101
- ### Running Clippy from the command line without installing it
102
-
103
- To have cargo compile your crate with Clippy without Clippy installation
104
- in your code, you can use:
105
-
106
- ``` terminal
107
- cargo run --bin cargo-clippy --manifest-path=path_to_clippys_Cargo.toml
108
- ```
109
-
110
- * Note:* Be sure that Clippy was compiled with the same version of rustc that cargo invokes here!
111
-
112
101
### Travis CI
113
102
114
103
You can add Clippy to Travis CI in the same way you use it locally:
@@ -130,18 +119,6 @@ script:
130
119
# etc.
131
120
```
132
121
133
- If you are on nightly, It might happen that Clippy is not available for a certain nightly release.
134
- In this case you can try to conditionally install Clippy from the Git repo.
135
-
136
- ``` yaml
137
- language : rust
138
- rust :
139
- - nightly
140
- before_script :
141
- - rustup component add clippy --toolchain=nightly || cargo install --git https://github.com/rust-lang/rust-clippy/ --force clippy
142
- # etc.
143
- ```
144
-
145
122
Note that adding ` -D warnings ` will cause your build to fail if ** any** warnings are found in your code.
146
123
That includes warnings found by rustc (e.g. ` dead_code ` , etc.). If you want to avoid this and only cause
147
124
an error for Clippy warnings, use ` #![deny(clippy::all)] ` in your code or ` -D clippy::all ` on the command
0 commit comments