@@ -245,22 +245,6 @@ similar crates.
245
245
SYSROOT=/path/to/rustc/sysroot cargo install clippy
246
246
```
247
247
248
- ### Configuring clippy
249
-
250
- You can add options to ` allow ` /` warn ` /` deny ` :
251
-
252
- * the whole set of ` Warn ` lints using the ` clippy ` lint group (` #![deny(clippy)] ` )
253
-
254
- * all lints using both the ` clippy ` and ` clippy_pedantic ` lint groups (` #![deny(clippy)] ` ,
255
- ` #![deny(clippy_pedantic)] ` ). Note that ` clippy_pedantic ` contains some very aggressive
256
- lints prone to false positives.
257
-
258
- * only some lints (` #![deny(single_match, box_vec)] ` , etc)
259
-
260
- * ` allow ` /` warn ` /` deny ` can be limited to a single function or module using ` #[allow(...)] ` , etc
261
-
262
- Note: ` deny ` produces errors instead of warnings
263
-
264
248
### Running clippy from the command line without installing
265
249
266
250
To have cargo compile your crate with clippy without needing ` #![plugin(clippy)] `
@@ -321,6 +305,29 @@ You can also specify the path to the configuration file with:
321
305
To deactivate the “for further information visit * wiki-link* ” message you can
322
306
define the ` CLIPPY_DISABLE_WIKI_LINKS ` environment variable.
323
307
308
+ ### Allowing/denying lints
309
+
310
+ You can add options to ` allow ` /` warn ` /` deny ` :
311
+
312
+ * the whole set of ` Warn ` lints using the ` clippy ` lint group (` #![deny(clippy)] ` )
313
+
314
+ * all lints using both the ` clippy ` and ` clippy_pedantic ` lint groups (` #![deny(clippy)] ` ,
315
+ ` #![deny(clippy_pedantic)] ` ). Note that ` clippy_pedantic ` contains some very aggressive
316
+ lints prone to false positives.
317
+
318
+ * only some lints (` #![deny(single_match, box_vec)] ` , etc)
319
+
320
+ * ` allow ` /` warn ` /` deny ` can be limited to a single function or module using ` #[allow(...)] ` , etc
321
+
322
+ Note: ` deny ` produces errors instead of warnings.
323
+
324
+ For convenience, ` cargo clippy ` automatically defines a ` clippy ` features. This
325
+ lets you set lints level and compile with or without clippy transparently:
326
+
327
+ ``` rust
328
+ #[cfg_attr(feature = " clippy" , allow(needless_lifetimes))]
329
+ ```
330
+
324
331
## Link with clippy service
325
332
326
333
` clippy-service ` is a rust web initiative providing ` rust-clippy ` as a web service.
0 commit comments