]> git.lizzy.rs Git - rust.git/commitdiff
README: sort en/disabling section, fix typos, add note
authorLotte Steenbrink <lotte.steenbrink@ferrous-systems.com>
Wed, 14 Oct 2020 09:58:22 +0000 (11:58 +0200)
committerLotte Steenbrink <lotte.steenbrink@ferrous-systems.com>
Wed, 14 Oct 2020 14:45:36 +0000 (16:45 +0200)
README.md

index 62a8be0abf22c5a08743aa5e4092eaf612927bf6..e1b3c84d6917d0824701efce3508d0f0210c1473 100644 (file)
--- a/README.md
+++ b/README.md
@@ -169,12 +169,33 @@ You can add options to your code to `allow`/`warn`/`deny` Clippy lints:
 
 Note: `deny` produces errors instead of warnings.
 
-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 clippy::lint_name` will run Clippy with `lint_name` disabled and
-`cargo clippy -- -W clippy::lint_name` will run it with that enabled. This also works with lint groups. For example you
-can run Clippy with warnings for all lints enabled: `cargo clippy -- -W clippy::pedantic`
+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:
+
+To disable `lint_name`, run
+
+```terminal
+cargo clippy -- -A clippy::lint_name
+```
+
+And to enable `lint_name`, run
+
+```terminal
+cargo clippy -- -W clippy::lint_name
+```
+
+This also works with lint groups. For example you
+can run Clippy with warnings for all lints enabled: 
+```terminal
+cargo clippy -- -W clippy::pedantic
+```
+
 If you care only about a single lint, you can allow all others and then explicitly reenable
-the lint(s) you are interested in: `cargo clippy -- -Aclippy::all -Wclippy::useless_format -Wclippy::...`
+the lint(s) you are interested in:
+```terminal
+cargo clippy -- -A clippy::all -W clippy::useless_format -W clippy::...
+```
+Note that if you've run clippy before, this may only take effect after you've modified a file or ran `cargo clean`.
 
 ## Contributing