Skip to content

Commit bad3e08

Browse files
committed
Auto merge of #3930 - sunjay:patch-1, r=flip1995
Mention that -D warnings will deny ALL warnings, not just clippy warnings If we pass `-D warnings` to clippy, it causes the build to fail if there are *any* warnings, even the ones not generated by clippy. This isn't immediately obvious when you're looking at this as someone just setting up clippy, so people might not expect this nor know how to fix it. I've added a few sentences in the README to help anyone who runs into this. These docs are useful for anyone setting up clippy warnings to be denied during CI, but still otherwise want rustc warnings to be allowed. I could have also changed `-D warnings` to `-D clippy::all` in the Travis configurations themselves, but I wasn't sure what you would prefer to have people use as the default.
2 parents 2278814 + a7bfac7 commit bad3e08

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,11 @@ before_script:
125125
# etc
126126
```
127127

128+
Note that adding `-D warnings` will cause your build to fail if **any** warnings are found in your code.
129+
That includes warnings found by rustc (e.g. `dead_code`, etc.). If you want to avoid this and only cause
130+
an error for clippy warnings, use `#![deny(clippy::all)]` in your code or `-D clippy::all` on the command
131+
line. (You can swap `clippy::all` with the specific lint category you are targeting.)
132+
128133
## Configuration
129134

130135
Some lints can be configured in a TOML file named `clippy.toml` or `.clippy.toml`. It contains a basic `variable = value` mapping eg.

0 commit comments

Comments
 (0)