3 > **Note:** The configuration file is unstable and may be deprecated in the future.
5 Some lints can be configured in a TOML file named `clippy.toml` or `.clippy.toml`. It contains a
6 basic `variable = value` mapping eg.
9 avoid-breaking-exported-api = false
10 disallowed-names = ["toto", "tata", "titi"]
11 cognitive-complexity-threshold = 30
14 See the [list of lints](https://rust-lang.github.io/rust-clippy/master/index.html) for more information about which
15 lints can be configured and the meaning of the variables.
17 To deactivate the "for further information visit *lint-link*" message you can define the `CLIPPY_DISABLE_DOCS_LINKS`
20 ### Allowing/denying lints
22 You can add options to your code to `allow`/`warn`/`deny` Clippy lints:
24 * the whole set of `Warn` lints using the `clippy` lint group (`#![deny(clippy::all)]`)
26 * all lints using both the `clippy` and `clippy::pedantic` lint groups (`#![deny(clippy::all)]`,
27 `#![deny(clippy::pedantic)]`). Note that `clippy::pedantic` contains some very aggressive lints prone to false
30 * only some lints (`#![deny(clippy::single_match, clippy::box_vec)]`, etc.)
32 * `allow`/`warn`/`deny` can be limited to a single function or module using `#[allow(...)]`, etc.
34 Note: `allow` means to suppress the lint for your code. With `warn` the lint will only emit a warning, while with `deny`
35 the lint will emit an error, when triggering for your code. An error causes clippy to exit with an error code, so is
36 useful in scripts like CI/CD.
38 If you do not want to include your lint levels in your code, you can globally enable/disable lints by passing extra
39 flags to Clippy during the run:
41 To allow `lint_name`, run
44 cargo clippy -- -A clippy::lint_name
47 And to warn on `lint_name`, run
50 cargo clippy -- -W clippy::lint_name
53 This also works with lint groups. For example you can run Clippy with warnings for all lints enabled:
56 cargo clippy -- -W clippy::pedantic
59 If you care only about a single lint, you can allow all others and then explicitly warn on the lint(s) you are
63 cargo clippy -- -A clippy::all -W clippy::useless_format -W clippy::...
66 ### Specifying the minimum supported Rust version
68 Projects that intend to support old versions of Rust can disable lints pertaining to newer features by specifying the
69 minimum supported Rust version (MSRV) in the clippy configuration file.
75 The MSRV can also be specified as an inner attribute, like below.
78 #![feature(custom_inner_attributes)]
79 #![clippy::msrv = "1.30.0"]
86 You can also omit the patch version when specifying the MSRV, so `msrv = 1.30`
87 is equivalent to `msrv = 1.30.0`.
89 Note: `custom_inner_attributes` is an unstable feature so it has to be enabled explicitly.
91 Lints that recognize this configuration option can be
92 found [here](https://rust-lang.github.io/rust-clippy/master/index.html#msrv)