Skip to content

Commit 9f402c9

Browse files
committed
Clarify allow/warn/deny. Remove enable/disable.
Disable and enable when not specifically explained were not clear to me as an English language speaker, but I was able to figure it out fairly easily due to the examples having A/W, which I assumed meant `allow` and `warn`. I removed both words to be sure it was clear as well as extending the note on what deny means. It now includes a statement on exactly what each word means.
1 parent 0be6544 commit 9f402c9

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,18 +167,22 @@ You can add options to your code to `allow`/`warn`/`deny` Clippy lints:
167167

168168
* `allow`/`warn`/`deny` can be limited to a single function or module using `#[allow(...)]`, etc.
169169

170-
Note: `deny` produces errors instead of warnings.
170+
Note: `allow` in this case means to "allow your code to have the lint without
171+
warning". `deny` means "produce an error if your code has the lint". `warn`
172+
means "produce a warning, but don't produce an error due to this lint". An
173+
error causes clippy to exit with an error code, so is useful in scripts like
174+
CI/CD.
171175

172-
If you do not want to include your lint levels in your code, you can globally enable/disable lints
173-
by passing extra flags to Clippy during the run:
176+
If you do not want to include your lint levels in your code, you can globally
177+
enable/disable lints by passing extra flags to Clippy during the run:
174178

175-
To disable `lint_name`, run
179+
To allow `lint_name`, run
176180

177181
```terminal
178182
cargo clippy -- -A clippy::lint_name
179183
```
180184

181-
And to enable `lint_name`, run
185+
And to warn on `lint_name`, run
182186

183187
```terminal
184188
cargo clippy -- -W clippy::lint_name
@@ -190,7 +194,7 @@ can run Clippy with warnings for all lints enabled:
190194
cargo clippy -- -W clippy::pedantic
191195
```
192196

193-
If you care only about a single lint, you can allow all others and then explicitly reenable
197+
If you care only about a single lint, you can allow all others and then explicitly warn on
194198
the lint(s) you are interested in:
195199
```terminal
196200
cargo clippy -- -A clippy::all -W clippy::useless_format -W clippy::...

0 commit comments

Comments
 (0)