From 246f239d9f40f633160f0c18f87a20922d4e77bb Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:06:37 +0200 Subject: Merging debian version 1.65.0+dfsg1-2. Signed-off-by: Daniel Baumann --- .../arithmetic_allowed/arithmetic_allowed.rs | 24 ----------- .../tests/ui-toml/arithmetic_allowed/clippy.toml | 1 - .../arithmetic_side_effects_allowed.rs | 24 +++++++++++ .../arithmetic_side_effects_allowed/clippy.toml | 1 + .../clippy/tests/ui-toml/bad_toml_type/clippy.toml | 2 +- .../ui-toml/bad_toml_type/conf_bad_type.stderr | 2 +- .../blacklisted_names_append/blacklisted_names.rs | 10 ----- .../blacklisted_names.stderr | 16 -------- .../ui-toml/blacklisted_names_append/clippy.toml | 1 - .../blacklisted_names_replace/blacklisted_names.rs | 10 ----- .../blacklisted_names.stderr | 10 ----- .../ui-toml/blacklisted_names_replace/clippy.toml | 1 - .../tests/ui-toml/conf_deprecated_key/clippy.toml | 5 ++- .../conf_deprecated_key/conf_deprecated_key.rs | 10 +++++ .../conf_deprecated_key/conf_deprecated_key.stderr | 15 ++++++- .../ui-toml/disallowed_names_append/clippy.toml | 1 + .../disallowed_names_append/disallowed_names.rs | 10 +++++ .../disallowed_names.stderr | 16 ++++++++ .../ui-toml/disallowed_names_replace/clippy.toml | 1 + .../disallowed_names_replace/disallowed_names.rs | 10 +++++ .../disallowed_names.stderr | 10 +++++ .../tests/ui-toml/duplicated_keys/clippy.toml | 5 +++ .../ui-toml/duplicated_keys/duplicated_keys.rs | 1 + .../ui-toml/duplicated_keys/duplicated_keys.stderr | 8 ++++ .../tests/ui-toml/expect_used/expect_used.stderr | 2 +- .../tests/ui-toml/toml_blacklist/clippy.toml | 1 - .../toml_blacklist/conf_french_blacklisted_name.rs | 20 ---------- .../conf_french_blacklisted_name.stderr | 46 ---------------------- .../clippy/tests/ui-toml/toml_disallow/clippy.toml | 1 + .../toml_disallow/conf_french_disallowed_name.rs | 20 ++++++++++ .../conf_french_disallowed_name.stderr | 46 ++++++++++++++++++++++ .../toml_unknown_key/conf_unknown_key.stderr | 4 +- 32 files changed, 186 insertions(+), 148 deletions(-) delete mode 100644 src/tools/clippy/tests/ui-toml/arithmetic_allowed/arithmetic_allowed.rs delete mode 100644 src/tools/clippy/tests/ui-toml/arithmetic_allowed/clippy.toml create mode 100644 src/tools/clippy/tests/ui-toml/arithmetic_side_effects_allowed/arithmetic_side_effects_allowed.rs create mode 100644 src/tools/clippy/tests/ui-toml/arithmetic_side_effects_allowed/clippy.toml delete mode 100644 src/tools/clippy/tests/ui-toml/blacklisted_names_append/blacklisted_names.rs delete mode 100644 src/tools/clippy/tests/ui-toml/blacklisted_names_append/blacklisted_names.stderr delete mode 100644 src/tools/clippy/tests/ui-toml/blacklisted_names_append/clippy.toml delete mode 100644 src/tools/clippy/tests/ui-toml/blacklisted_names_replace/blacklisted_names.rs delete mode 100644 src/tools/clippy/tests/ui-toml/blacklisted_names_replace/blacklisted_names.stderr delete mode 100644 src/tools/clippy/tests/ui-toml/blacklisted_names_replace/clippy.toml create mode 100644 src/tools/clippy/tests/ui-toml/disallowed_names_append/clippy.toml create mode 100644 src/tools/clippy/tests/ui-toml/disallowed_names_append/disallowed_names.rs create mode 100644 src/tools/clippy/tests/ui-toml/disallowed_names_append/disallowed_names.stderr create mode 100644 src/tools/clippy/tests/ui-toml/disallowed_names_replace/clippy.toml create mode 100644 src/tools/clippy/tests/ui-toml/disallowed_names_replace/disallowed_names.rs create mode 100644 src/tools/clippy/tests/ui-toml/disallowed_names_replace/disallowed_names.stderr create mode 100644 src/tools/clippy/tests/ui-toml/duplicated_keys/clippy.toml create mode 100644 src/tools/clippy/tests/ui-toml/duplicated_keys/duplicated_keys.rs create mode 100644 src/tools/clippy/tests/ui-toml/duplicated_keys/duplicated_keys.stderr delete mode 100644 src/tools/clippy/tests/ui-toml/toml_blacklist/clippy.toml delete mode 100644 src/tools/clippy/tests/ui-toml/toml_blacklist/conf_french_blacklisted_name.rs delete mode 100644 src/tools/clippy/tests/ui-toml/toml_blacklist/conf_french_blacklisted_name.stderr create mode 100644 src/tools/clippy/tests/ui-toml/toml_disallow/clippy.toml create mode 100644 src/tools/clippy/tests/ui-toml/toml_disallow/conf_french_disallowed_name.rs create mode 100644 src/tools/clippy/tests/ui-toml/toml_disallow/conf_french_disallowed_name.stderr (limited to 'src/tools/clippy/tests/ui-toml') diff --git a/src/tools/clippy/tests/ui-toml/arithmetic_allowed/arithmetic_allowed.rs b/src/tools/clippy/tests/ui-toml/arithmetic_allowed/arithmetic_allowed.rs deleted file mode 100644 index 195fabdbf..000000000 --- a/src/tools/clippy/tests/ui-toml/arithmetic_allowed/arithmetic_allowed.rs +++ /dev/null @@ -1,24 +0,0 @@ -#![warn(clippy::arithmetic)] - -use core::ops::Add; - -#[derive(Clone, Copy)] -struct Point { - x: i32, - y: i32, -} - -impl Add for Point { - type Output = Self; - - fn add(self, other: Self) -> Self { - todo!() - } -} - -fn main() { - let _ = Point { x: 1, y: 0 } + Point { x: 2, y: 3 }; - - let point: Point = Point { x: 1, y: 0 }; - let _ = point + point; -} diff --git a/src/tools/clippy/tests/ui-toml/arithmetic_allowed/clippy.toml b/src/tools/clippy/tests/ui-toml/arithmetic_allowed/clippy.toml deleted file mode 100644 index cc40570b1..000000000 --- a/src/tools/clippy/tests/ui-toml/arithmetic_allowed/clippy.toml +++ /dev/null @@ -1 +0,0 @@ -arithmetic-allowed = ["Point"] diff --git a/src/tools/clippy/tests/ui-toml/arithmetic_side_effects_allowed/arithmetic_side_effects_allowed.rs b/src/tools/clippy/tests/ui-toml/arithmetic_side_effects_allowed/arithmetic_side_effects_allowed.rs new file mode 100644 index 000000000..1aed09b7c --- /dev/null +++ b/src/tools/clippy/tests/ui-toml/arithmetic_side_effects_allowed/arithmetic_side_effects_allowed.rs @@ -0,0 +1,24 @@ +#![warn(clippy::arithmetic_side_effects)] + +use core::ops::Add; + +#[derive(Clone, Copy)] +struct Point { + x: i32, + y: i32, +} + +impl Add for Point { + type Output = Self; + + fn add(self, other: Self) -> Self { + todo!() + } +} + +fn main() { + let _ = Point { x: 1, y: 0 } + Point { x: 2, y: 3 }; + + let point: Point = Point { x: 1, y: 0 }; + let _ = point + point; +} diff --git a/src/tools/clippy/tests/ui-toml/arithmetic_side_effects_allowed/clippy.toml b/src/tools/clippy/tests/ui-toml/arithmetic_side_effects_allowed/clippy.toml new file mode 100644 index 000000000..e736256f2 --- /dev/null +++ b/src/tools/clippy/tests/ui-toml/arithmetic_side_effects_allowed/clippy.toml @@ -0,0 +1 @@ +arithmetic-side-effects-allowed = ["Point"] diff --git a/src/tools/clippy/tests/ui-toml/bad_toml_type/clippy.toml b/src/tools/clippy/tests/ui-toml/bad_toml_type/clippy.toml index 168675394..d48bab08f 100644 --- a/src/tools/clippy/tests/ui-toml/bad_toml_type/clippy.toml +++ b/src/tools/clippy/tests/ui-toml/bad_toml_type/clippy.toml @@ -1 +1 @@ -blacklisted-names = 42 +disallowed-names = 42 diff --git a/src/tools/clippy/tests/ui-toml/bad_toml_type/conf_bad_type.stderr b/src/tools/clippy/tests/ui-toml/bad_toml_type/conf_bad_type.stderr index c7bc261de..e3ec60192 100644 --- a/src/tools/clippy/tests/ui-toml/bad_toml_type/conf_bad_type.stderr +++ b/src/tools/clippy/tests/ui-toml/bad_toml_type/conf_bad_type.stderr @@ -1,4 +1,4 @@ -error: error reading Clippy's configuration file `$DIR/clippy.toml`: invalid type: integer `42`, expected a sequence for key `blacklisted-names` +error: error reading Clippy's configuration file `$DIR/clippy.toml`: invalid type: integer `42`, expected a sequence for key `disallowed-names` error: aborting due to previous error diff --git a/src/tools/clippy/tests/ui-toml/blacklisted_names_append/blacklisted_names.rs b/src/tools/clippy/tests/ui-toml/blacklisted_names_append/blacklisted_names.rs deleted file mode 100644 index fb2395cf9..000000000 --- a/src/tools/clippy/tests/ui-toml/blacklisted_names_append/blacklisted_names.rs +++ /dev/null @@ -1,10 +0,0 @@ -#[warn(clippy::blacklisted_name)] - -fn main() { - // `foo` is part of the default configuration - let foo = "bar"; - // `ducks` was unrightfully blacklisted - let ducks = ["quack", "quack"]; - // `fox` is okay - let fox = ["what", "does", "the", "fox", "say", "?"]; -} diff --git a/src/tools/clippy/tests/ui-toml/blacklisted_names_append/blacklisted_names.stderr b/src/tools/clippy/tests/ui-toml/blacklisted_names_append/blacklisted_names.stderr deleted file mode 100644 index 9169bb0e8..000000000 --- a/src/tools/clippy/tests/ui-toml/blacklisted_names_append/blacklisted_names.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error: use of a blacklisted/placeholder name `foo` - --> $DIR/blacklisted_names.rs:5:9 - | -LL | let foo = "bar"; - | ^^^ - | - = note: `-D clippy::blacklisted-name` implied by `-D warnings` - -error: use of a blacklisted/placeholder name `ducks` - --> $DIR/blacklisted_names.rs:7:9 - | -LL | let ducks = ["quack", "quack"]; - | ^^^^^ - -error: aborting due to 2 previous errors - diff --git a/src/tools/clippy/tests/ui-toml/blacklisted_names_append/clippy.toml b/src/tools/clippy/tests/ui-toml/blacklisted_names_append/clippy.toml deleted file mode 100644 index 0e052ef50..000000000 --- a/src/tools/clippy/tests/ui-toml/blacklisted_names_append/clippy.toml +++ /dev/null @@ -1 +0,0 @@ -blacklisted-names = ["ducks", ".."] diff --git a/src/tools/clippy/tests/ui-toml/blacklisted_names_replace/blacklisted_names.rs b/src/tools/clippy/tests/ui-toml/blacklisted_names_replace/blacklisted_names.rs deleted file mode 100644 index fb2395cf9..000000000 --- a/src/tools/clippy/tests/ui-toml/blacklisted_names_replace/blacklisted_names.rs +++ /dev/null @@ -1,10 +0,0 @@ -#[warn(clippy::blacklisted_name)] - -fn main() { - // `foo` is part of the default configuration - let foo = "bar"; - // `ducks` was unrightfully blacklisted - let ducks = ["quack", "quack"]; - // `fox` is okay - let fox = ["what", "does", "the", "fox", "say", "?"]; -} diff --git a/src/tools/clippy/tests/ui-toml/blacklisted_names_replace/blacklisted_names.stderr b/src/tools/clippy/tests/ui-toml/blacklisted_names_replace/blacklisted_names.stderr deleted file mode 100644 index ec6f7f084..000000000 --- a/src/tools/clippy/tests/ui-toml/blacklisted_names_replace/blacklisted_names.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: use of a blacklisted/placeholder name `ducks` - --> $DIR/blacklisted_names.rs:7:9 - | -LL | let ducks = ["quack", "quack"]; - | ^^^^^ - | - = note: `-D clippy::blacklisted-name` implied by `-D warnings` - -error: aborting due to previous error - diff --git a/src/tools/clippy/tests/ui-toml/blacklisted_names_replace/clippy.toml b/src/tools/clippy/tests/ui-toml/blacklisted_names_replace/clippy.toml deleted file mode 100644 index 4582f1c06..000000000 --- a/src/tools/clippy/tests/ui-toml/blacklisted_names_replace/clippy.toml +++ /dev/null @@ -1 +0,0 @@ -blacklisted-names = ["ducks"] diff --git a/src/tools/clippy/tests/ui-toml/conf_deprecated_key/clippy.toml b/src/tools/clippy/tests/ui-toml/conf_deprecated_key/clippy.toml index ac47b1950..d79a98d05 100644 --- a/src/tools/clippy/tests/ui-toml/conf_deprecated_key/clippy.toml +++ b/src/tools/clippy/tests/ui-toml/conf_deprecated_key/clippy.toml @@ -1,5 +1,6 @@ -# that one is an error -cyclomatic-complexity-threshold = 42 +# Expect errors from these deprecated configs +cyclomatic-complexity-threshold = 2 +blacklisted-names = [ "..", "wibble" ] # that one is white-listed [third-party] diff --git a/src/tools/clippy/tests/ui-toml/conf_deprecated_key/conf_deprecated_key.rs b/src/tools/clippy/tests/ui-toml/conf_deprecated_key/conf_deprecated_key.rs index f328e4d9d..b4e677ea1 100644 --- a/src/tools/clippy/tests/ui-toml/conf_deprecated_key/conf_deprecated_key.rs +++ b/src/tools/clippy/tests/ui-toml/conf_deprecated_key/conf_deprecated_key.rs @@ -1 +1,11 @@ fn main() {} + +#[warn(clippy::cognitive_complexity)] +fn cognitive_complexity() { + let x = vec![1, 2, 3]; + for i in x { + if i == 1 { + println!("{}", i); + } + } +} diff --git a/src/tools/clippy/tests/ui-toml/conf_deprecated_key/conf_deprecated_key.stderr b/src/tools/clippy/tests/ui-toml/conf_deprecated_key/conf_deprecated_key.stderr index 90021a034..4c560299e 100644 --- a/src/tools/clippy/tests/ui-toml/conf_deprecated_key/conf_deprecated_key.stderr +++ b/src/tools/clippy/tests/ui-toml/conf_deprecated_key/conf_deprecated_key.stderr @@ -1,4 +1,15 @@ -error: error reading Clippy's configuration file `$DIR/clippy.toml`: deprecated field `cyclomatic-complexity-threshold`. Please use `cognitive-complexity-threshold` instead +warning: error reading Clippy's configuration file `$DIR/clippy.toml`: deprecated field `cyclomatic-complexity-threshold`. Please use `cognitive-complexity-threshold` instead -error: aborting due to previous error +warning: error reading Clippy's configuration file `$DIR/clippy.toml`: deprecated field `blacklisted-names`. Please use `disallowed-names` instead + +error: the function has a cognitive complexity of (3/2) + --> $DIR/conf_deprecated_key.rs:4:4 + | +LL | fn cognitive_complexity() { + | ^^^^^^^^^^^^^^^^^^^^ + | + = note: `-D clippy::cognitive-complexity` implied by `-D warnings` + = help: you could split it up into multiple smaller functions + +error: aborting due to previous error; 2 warnings emitted diff --git a/src/tools/clippy/tests/ui-toml/disallowed_names_append/clippy.toml b/src/tools/clippy/tests/ui-toml/disallowed_names_append/clippy.toml new file mode 100644 index 000000000..6df96a3c2 --- /dev/null +++ b/src/tools/clippy/tests/ui-toml/disallowed_names_append/clippy.toml @@ -0,0 +1 @@ +disallowed-names = ["ducks", ".."] diff --git a/src/tools/clippy/tests/ui-toml/disallowed_names_append/disallowed_names.rs b/src/tools/clippy/tests/ui-toml/disallowed_names_append/disallowed_names.rs new file mode 100644 index 000000000..a2e2b46c4 --- /dev/null +++ b/src/tools/clippy/tests/ui-toml/disallowed_names_append/disallowed_names.rs @@ -0,0 +1,10 @@ +#[warn(clippy::disallowed_names)] + +fn main() { + // `foo` is part of the default configuration + let foo = "bar"; + // `ducks` was unrightfully disallowed + let ducks = ["quack", "quack"]; + // `fox` is okay + let fox = ["what", "does", "the", "fox", "say", "?"]; +} diff --git a/src/tools/clippy/tests/ui-toml/disallowed_names_append/disallowed_names.stderr b/src/tools/clippy/tests/ui-toml/disallowed_names_append/disallowed_names.stderr new file mode 100644 index 000000000..23c3e96a8 --- /dev/null +++ b/src/tools/clippy/tests/ui-toml/disallowed_names_append/disallowed_names.stderr @@ -0,0 +1,16 @@ +error: use of a disallowed/placeholder name `foo` + --> $DIR/disallowed_names.rs:5:9 + | +LL | let foo = "bar"; + | ^^^ + | + = note: `-D clippy::disallowed-names` implied by `-D warnings` + +error: use of a disallowed/placeholder name `ducks` + --> $DIR/disallowed_names.rs:7:9 + | +LL | let ducks = ["quack", "quack"]; + | ^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/tools/clippy/tests/ui-toml/disallowed_names_replace/clippy.toml b/src/tools/clippy/tests/ui-toml/disallowed_names_replace/clippy.toml new file mode 100644 index 000000000..a1c515652 --- /dev/null +++ b/src/tools/clippy/tests/ui-toml/disallowed_names_replace/clippy.toml @@ -0,0 +1 @@ +disallowed-names = ["ducks"] diff --git a/src/tools/clippy/tests/ui-toml/disallowed_names_replace/disallowed_names.rs b/src/tools/clippy/tests/ui-toml/disallowed_names_replace/disallowed_names.rs new file mode 100644 index 000000000..a2e2b46c4 --- /dev/null +++ b/src/tools/clippy/tests/ui-toml/disallowed_names_replace/disallowed_names.rs @@ -0,0 +1,10 @@ +#[warn(clippy::disallowed_names)] + +fn main() { + // `foo` is part of the default configuration + let foo = "bar"; + // `ducks` was unrightfully disallowed + let ducks = ["quack", "quack"]; + // `fox` is okay + let fox = ["what", "does", "the", "fox", "say", "?"]; +} diff --git a/src/tools/clippy/tests/ui-toml/disallowed_names_replace/disallowed_names.stderr b/src/tools/clippy/tests/ui-toml/disallowed_names_replace/disallowed_names.stderr new file mode 100644 index 000000000..d961fa340 --- /dev/null +++ b/src/tools/clippy/tests/ui-toml/disallowed_names_replace/disallowed_names.stderr @@ -0,0 +1,10 @@ +error: use of a disallowed/placeholder name `ducks` + --> $DIR/disallowed_names.rs:7:9 + | +LL | let ducks = ["quack", "quack"]; + | ^^^^^ + | + = note: `-D clippy::disallowed-names` implied by `-D warnings` + +error: aborting due to previous error + diff --git a/src/tools/clippy/tests/ui-toml/duplicated_keys/clippy.toml b/src/tools/clippy/tests/ui-toml/duplicated_keys/clippy.toml new file mode 100644 index 000000000..63a893cc6 --- /dev/null +++ b/src/tools/clippy/tests/ui-toml/duplicated_keys/clippy.toml @@ -0,0 +1,5 @@ +cognitive-complexity-threshold = 2 +# This is the deprecated name for the same key +cyclomatic-complexity-threshold = 3 +# Check we get duplication warning regardless of order +cognitive-complexity-threshold = 4 diff --git a/src/tools/clippy/tests/ui-toml/duplicated_keys/duplicated_keys.rs b/src/tools/clippy/tests/ui-toml/duplicated_keys/duplicated_keys.rs new file mode 100644 index 000000000..f328e4d9d --- /dev/null +++ b/src/tools/clippy/tests/ui-toml/duplicated_keys/duplicated_keys.rs @@ -0,0 +1 @@ +fn main() {} diff --git a/src/tools/clippy/tests/ui-toml/duplicated_keys/duplicated_keys.stderr b/src/tools/clippy/tests/ui-toml/duplicated_keys/duplicated_keys.stderr new file mode 100644 index 000000000..d99490a24 --- /dev/null +++ b/src/tools/clippy/tests/ui-toml/duplicated_keys/duplicated_keys.stderr @@ -0,0 +1,8 @@ +error: error reading Clippy's configuration file `$DIR/clippy.toml`: duplicate field `cognitive_complexity_threshold` (provided as `cyclomatic_complexity_threshold`) + +error: error reading Clippy's configuration file `$DIR/clippy.toml`: duplicate field `cognitive-complexity-threshold` + +warning: error reading Clippy's configuration file `$DIR/clippy.toml`: deprecated field `cyclomatic-complexity-threshold`. Please use `cognitive-complexity-threshold` instead + +error: aborting due to 2 previous errors; 1 warning emitted + diff --git a/src/tools/clippy/tests/ui-toml/expect_used/expect_used.stderr b/src/tools/clippy/tests/ui-toml/expect_used/expect_used.stderr index 9cb2199ed..c5d95cb8a 100644 --- a/src/tools/clippy/tests/ui-toml/expect_used/expect_used.stderr +++ b/src/tools/clippy/tests/ui-toml/expect_used/expect_used.stderr @@ -5,7 +5,7 @@ LL | let _ = opt.expect(""); | ^^^^^^^^^^^^^^ | = note: `-D clippy::expect-used` implied by `-D warnings` - = help: if this value is an `None`, it will panic + = help: if this value is `None`, it will panic error: used `expect()` on `a Result` value --> $DIR/expect_used.rs:11:13 diff --git a/src/tools/clippy/tests/ui-toml/toml_blacklist/clippy.toml b/src/tools/clippy/tests/ui-toml/toml_blacklist/clippy.toml deleted file mode 100644 index 6abe5a3bb..000000000 --- a/src/tools/clippy/tests/ui-toml/toml_blacklist/clippy.toml +++ /dev/null @@ -1 +0,0 @@ -blacklisted-names = ["toto", "tata", "titi"] diff --git a/src/tools/clippy/tests/ui-toml/toml_blacklist/conf_french_blacklisted_name.rs b/src/tools/clippy/tests/ui-toml/toml_blacklist/conf_french_blacklisted_name.rs deleted file mode 100644 index cb35d0e85..000000000 --- a/src/tools/clippy/tests/ui-toml/toml_blacklist/conf_french_blacklisted_name.rs +++ /dev/null @@ -1,20 +0,0 @@ -#![allow(dead_code)] -#![allow(clippy::single_match)] -#![allow(unused_variables)] -#![warn(clippy::blacklisted_name)] - -fn test(toto: ()) {} - -fn main() { - let toto = 42; - let tata = 42; - let titi = 42; - - let tatab = 42; - let tatatataic = 42; - - match (42, Some(1337), Some(0)) { - (toto, Some(tata), titi @ Some(_)) => (), - _ => (), - } -} diff --git a/src/tools/clippy/tests/ui-toml/toml_blacklist/conf_french_blacklisted_name.stderr b/src/tools/clippy/tests/ui-toml/toml_blacklist/conf_french_blacklisted_name.stderr deleted file mode 100644 index 84ba77851..000000000 --- a/src/tools/clippy/tests/ui-toml/toml_blacklist/conf_french_blacklisted_name.stderr +++ /dev/null @@ -1,46 +0,0 @@ -error: use of a blacklisted/placeholder name `toto` - --> $DIR/conf_french_blacklisted_name.rs:6:9 - | -LL | fn test(toto: ()) {} - | ^^^^ - | - = note: `-D clippy::blacklisted-name` implied by `-D warnings` - -error: use of a blacklisted/placeholder name `toto` - --> $DIR/conf_french_blacklisted_name.rs:9:9 - | -LL | let toto = 42; - | ^^^^ - -error: use of a blacklisted/placeholder name `tata` - --> $DIR/conf_french_blacklisted_name.rs:10:9 - | -LL | let tata = 42; - | ^^^^ - -error: use of a blacklisted/placeholder name `titi` - --> $DIR/conf_french_blacklisted_name.rs:11:9 - | -LL | let titi = 42; - | ^^^^ - -error: use of a blacklisted/placeholder name `toto` - --> $DIR/conf_french_blacklisted_name.rs:17:10 - | -LL | (toto, Some(tata), titi @ Some(_)) => (), - | ^^^^ - -error: use of a blacklisted/placeholder name `tata` - --> $DIR/conf_french_blacklisted_name.rs:17:21 - | -LL | (toto, Some(tata), titi @ Some(_)) => (), - | ^^^^ - -error: use of a blacklisted/placeholder name `titi` - --> $DIR/conf_french_blacklisted_name.rs:17:28 - | -LL | (toto, Some(tata), titi @ Some(_)) => (), - | ^^^^ - -error: aborting due to 7 previous errors - diff --git a/src/tools/clippy/tests/ui-toml/toml_disallow/clippy.toml b/src/tools/clippy/tests/ui-toml/toml_disallow/clippy.toml new file mode 100644 index 000000000..e4f0cb6df --- /dev/null +++ b/src/tools/clippy/tests/ui-toml/toml_disallow/clippy.toml @@ -0,0 +1 @@ +disallowed-names = ["toto", "tata", "titi"] diff --git a/src/tools/clippy/tests/ui-toml/toml_disallow/conf_french_disallowed_name.rs b/src/tools/clippy/tests/ui-toml/toml_disallow/conf_french_disallowed_name.rs new file mode 100644 index 000000000..2f86b3eda --- /dev/null +++ b/src/tools/clippy/tests/ui-toml/toml_disallow/conf_french_disallowed_name.rs @@ -0,0 +1,20 @@ +#![allow(dead_code)] +#![allow(clippy::single_match)] +#![allow(unused_variables)] +#![warn(clippy::disallowed_names)] + +fn test(toto: ()) {} + +fn main() { + let toto = 42; + let tata = 42; + let titi = 42; + + let tatab = 42; + let tatatataic = 42; + + match (42, Some(1337), Some(0)) { + (toto, Some(tata), titi @ Some(_)) => (), + _ => (), + } +} diff --git a/src/tools/clippy/tests/ui-toml/toml_disallow/conf_french_disallowed_name.stderr b/src/tools/clippy/tests/ui-toml/toml_disallow/conf_french_disallowed_name.stderr new file mode 100644 index 000000000..9082c1c54 --- /dev/null +++ b/src/tools/clippy/tests/ui-toml/toml_disallow/conf_french_disallowed_name.stderr @@ -0,0 +1,46 @@ +error: use of a disallowed/placeholder name `toto` + --> $DIR/conf_french_disallowed_name.rs:6:9 + | +LL | fn test(toto: ()) {} + | ^^^^ + | + = note: `-D clippy::disallowed-names` implied by `-D warnings` + +error: use of a disallowed/placeholder name `toto` + --> $DIR/conf_french_disallowed_name.rs:9:9 + | +LL | let toto = 42; + | ^^^^ + +error: use of a disallowed/placeholder name `tata` + --> $DIR/conf_french_disallowed_name.rs:10:9 + | +LL | let tata = 42; + | ^^^^ + +error: use of a disallowed/placeholder name `titi` + --> $DIR/conf_french_disallowed_name.rs:11:9 + | +LL | let titi = 42; + | ^^^^ + +error: use of a disallowed/placeholder name `toto` + --> $DIR/conf_french_disallowed_name.rs:17:10 + | +LL | (toto, Some(tata), titi @ Some(_)) => (), + | ^^^^ + +error: use of a disallowed/placeholder name `tata` + --> $DIR/conf_french_disallowed_name.rs:17:21 + | +LL | (toto, Some(tata), titi @ Some(_)) => (), + | ^^^^ + +error: use of a disallowed/placeholder name `titi` + --> $DIR/conf_french_disallowed_name.rs:17:28 + | +LL | (toto, Some(tata), titi @ Some(_)) => (), + | ^^^^ + +error: aborting due to 7 previous errors + diff --git a/src/tools/clippy/tests/ui-toml/toml_unknown_key/conf_unknown_key.stderr b/src/tools/clippy/tests/ui-toml/toml_unknown_key/conf_unknown_key.stderr index fe5139c47..f27f78d15 100644 --- a/src/tools/clippy/tests/ui-toml/toml_unknown_key/conf_unknown_key.stderr +++ b/src/tools/clippy/tests/ui-toml/toml_unknown_key/conf_unknown_key.stderr @@ -3,7 +3,7 @@ error: error reading Clippy's configuration file `$DIR/clippy.toml`: unknown fie allow-expect-in-tests allow-unwrap-in-tests allowed-scripts - arithmetic-allowed + arithmetic-side-effects-allowed array-size-threshold avoid-breaking-exported-api await-holding-invalid-types @@ -12,12 +12,14 @@ error: error reading Clippy's configuration file `$DIR/clippy.toml`: unknown fie cognitive-complexity-threshold cyclomatic-complexity-threshold disallowed-methods + disallowed-names disallowed-types doc-valid-idents enable-raw-pointer-heuristic-for-send enforced-import-renames enum-variant-name-threshold enum-variant-size-threshold + large-error-threshold literal-representation-threshold max-fn-params-bools max-include-file-size -- cgit v1.2.3