From cfe8849a622c6308eaee333e8adba6c5bc3f457e Mon Sep 17 00:00:00 2001 From: Tyler Weaver Date: Thu, 12 Jan 2023 06:43:17 -0700 Subject: [PATCH] Document extending list type configs Signed-off-by: Tyler Weaver --- README.md | 9 +++++++++ book/src/configuration.md | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/README.md b/README.md index 81254ba8b8b..f7e03ca4cd8 100644 --- a/README.md +++ b/README.md @@ -200,6 +200,15 @@ cognitive-complexity-threshold = 30 See the [list of configurable lints](https://rust-lang.github.io/rust-clippy/master/index.html#Configuration), the lint descriptions contain the names and meanings of these configuration variables. +For configurations that are a list type with default values such as +[disallowed-names](https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_names), +you can use the unique value `".."` to extend the default values instead of replacing them. + +```toml +# default of disallowed-names is ["foo", "baz", "quux"] +disallowed-names = ["bar", ".."] # -> ["bar", "foo", "baz", "quux"] +``` + > **Note** > > `clippy.toml` or `.clippy.toml` cannot be used to allow/deny lints. diff --git a/book/src/configuration.md b/book/src/configuration.md index 430ff8b739a..bbe1081ccad 100644 --- a/book/src/configuration.md +++ b/book/src/configuration.md @@ -14,6 +14,15 @@ cognitive-complexity-threshold = 30 See the [list of configurable lints](https://rust-lang.github.io/rust-clippy/master/index.html#Configuration), the lint descriptions contain the names and meanings of these configuration variables. +For configurations that are a list type with default values such as +[disallowed-names](https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_names), +you can use the unique value `".."` to extend the default values instead of replacing them. + +```toml +# default of disallowed-names is ["foo", "baz", "quux"] +disallowed-names = ["bar", ".."] # -> ["bar", "foo", "baz", "quux"] +``` + To deactivate the "for further information visit *lint-link*" message you can define the `CLIPPY_DISABLE_DOCS_LINKS` environment variable.