Skip to content

Commit 5417b72

Browse files
author
Lotte Steenbrink
committed
README: sort en/disabling section, fix typos, add note
1 parent 0b77c35 commit 5417b72

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

README.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,32 @@ You can add options to your code to `allow`/`warn`/`deny` Clippy lints:
169169

170170
Note: `deny` produces errors instead of warnings.
171171

172-
If you do not want to include your lint levels in your code, you can globally enable/disable lints by passing extra
173-
flags to Clippy during the run: `cargo clippy -- -A clippy::lint_name` will run Clippy with `lint_name` disabled and
174-
`cargo clippy -- -W clippy::lint_name` will run it with that enabled. This also works with lint groups. For example you
175-
can run Clippy with warnings for all lints enabled: `cargo clippy -- -W clippy::pedantic`
172+
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:
173+
174+
To disable `lint_name`, run
175+
176+
```terminal
177+
cargo clippy -- -A clippy::lint_name
178+
```
179+
180+
And to enable `lint_name`, run
181+
182+
```terminal
183+
cargo clippy -- -W clippy::lint_name
184+
```
185+
186+
This also works with lint groups. For example you
187+
can run Clippy with warnings for all lints enabled:
188+
```terminal
189+
cargo clippy -- -W clippy::pedantic
190+
```
191+
176192
If you care only about a single lint, you can allow all others and then explicitly reenable
177-
the lint(s) you are interested in: `cargo clippy -- -Aclippy::all -Wclippy::useless_format -Wclippy::...`
193+
the lint(s) you are interested in:
194+
```terminal
195+
cargo clippy -- -A clippy::all -W clippy::useless_format -W clippy::...
196+
```
197+
Note that if you've run clippy before, this may only take effect after you've modified a file or ran `cargo clean`.
178198

179199
## Contributing
180200

0 commit comments

Comments
 (0)