Skip to content

Commit cfe8849

Browse files
committed
Document extending list type configs
Signed-off-by: Tyler Weaver <[email protected]>
1 parent 7c01721 commit cfe8849

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,15 @@ cognitive-complexity-threshold = 30
200200
See the [list of configurable lints](https://rust-lang.github.io/rust-clippy/master/index.html#Configuration),
201201
the lint descriptions contain the names and meanings of these configuration variables.
202202

203+
For configurations that are a list type with default values such as
204+
[disallowed-names](https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_names),
205+
you can use the unique value `".."` to extend the default values instead of replacing them.
206+
207+
```toml
208+
# default of disallowed-names is ["foo", "baz", "quux"]
209+
disallowed-names = ["bar", ".."] # -> ["bar", "foo", "baz", "quux"]
210+
```
211+
203212
> **Note**
204213
>
205214
> `clippy.toml` or `.clippy.toml` cannot be used to allow/deny lints.

book/src/configuration.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ cognitive-complexity-threshold = 30
1414
See the [list of configurable lints](https://rust-lang.github.io/rust-clippy/master/index.html#Configuration),
1515
the lint descriptions contain the names and meanings of these configuration variables.
1616

17+
For configurations that are a list type with default values such as
18+
[disallowed-names](https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_names),
19+
you can use the unique value `".."` to extend the default values instead of replacing them.
20+
21+
```toml
22+
# default of disallowed-names is ["foo", "baz", "quux"]
23+
disallowed-names = ["bar", ".."] # -> ["bar", "foo", "baz", "quux"]
24+
```
25+
1726
To deactivate the "for further information visit *lint-link*" message you can define the `CLIPPY_DISABLE_DOCS_LINKS`
1827
environment variable.
1928

0 commit comments

Comments
 (0)