Skip to content

Commit 5f25f7e

Browse files
committed
Auto merge of #9557 - xxchan:xxchan/safe-anaconda, r=Manishearth
doc: make the usage of clippy.toml more clear Added a subsection for it, and move it after `Allowing/denying lints` which is more frequently used. fix #9265 *Please write a short comment explaining your change (or "none" for internal only changes)* changelog: none
2 parents 68408c5 + 47a7d68 commit 5f25f7e

File tree

1 file changed

+27
-19
lines changed

1 file changed

+27
-19
lines changed

README.md

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -139,25 +139,6 @@ line. (You can swap `clippy::all` with the specific lint category you are target
139139

140140
## Configuration
141141

142-
Some lints can be configured in a TOML file named `clippy.toml` or `.clippy.toml`. It contains a basic `variable =
143-
value` mapping e.g.
144-
145-
```toml
146-
avoid-breaking-exported-api = false
147-
disallowed-names = ["toto", "tata", "titi"]
148-
cognitive-complexity-threshold = 30
149-
```
150-
151-
See the [list of lints](https://rust-lang.github.io/rust-clippy/master/index.html) for more information about which
152-
lints can be configured and the meaning of the variables.
153-
154-
Note that configuration changes will not apply for code that has already been compiled and cached under `./target/`;
155-
for example, adding a new string to `doc-valid-idents` may still result in Clippy flagging that string. To be sure that
156-
any configuration changes are applied, you may want to run `cargo clean` and re-compile your crate from scratch.
157-
158-
To deactivate the “for further information visit *lint-link*” message you can
159-
define the `CLIPPY_DISABLE_DOCS_LINKS` environment variable.
160-
161142
### Allowing/denying lints
162143

163144
You can add options to your code to `allow`/`warn`/`deny` Clippy lints:
@@ -205,6 +186,33 @@ the lint(s) you are interested in:
205186
cargo clippy -- -A clippy::all -W clippy::useless_format -W clippy::...
206187
```
207188

189+
### Configure the behavior of some lints
190+
191+
Some lints can be configured in a TOML file named `clippy.toml` or `.clippy.toml`. It contains a basic `variable =
192+
value` mapping e.g.
193+
194+
```toml
195+
avoid-breaking-exported-api = false
196+
disallowed-names = ["toto", "tata", "titi"]
197+
cognitive-complexity-threshold = 30
198+
```
199+
200+
See the [list of lints](https://rust-lang.github.io/rust-clippy/master/index.html) for more information about which
201+
lints can be configured and the meaning of the variables.
202+
203+
> **Note**
204+
>
205+
> `clippy.toml` or `.clippy.toml` cannot be used to allow/deny lints.
206+
207+
> **Note**
208+
>
209+
> Configuration changes will not apply for code that has already been compiled and cached under `./target/`;
210+
> for example, adding a new string to `doc-valid-idents` may still result in Clippy flagging that string. To be sure
211+
> that any configuration changes are applied, you may want to run `cargo clean` and re-compile your crate from scratch.
212+
213+
To deactivate the “for further information visit *lint-link*” message you can
214+
define the `CLIPPY_DISABLE_DOCS_LINKS` environment variable.
215+
208216
### Specifying the minimum supported Rust version
209217

210218
Projects that intend to support old versions of Rust can disable lints pertaining to newer features by

0 commit comments

Comments
 (0)