Skip to content

Commit 969b5ad

Browse files
committed
Don't suggests deprecated congurations
1 parent 88b590b commit 969b5ad

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

clippy_config/src/conf.rs

+17-1
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,23 @@ impl serde::de::Error for FieldError {
991991
// set and allows it.
992992
use fmt::Write;
993993

994-
let mut expected = expected.to_vec();
994+
let metadata = get_configuration_metadata();
995+
let deprecated = metadata
996+
.iter()
997+
.filter_map(|conf| {
998+
if conf.deprecation_reason.is_some() {
999+
Some(conf.name.as_str())
1000+
} else {
1001+
None
1002+
}
1003+
})
1004+
.collect::<Vec<_>>();
1005+
1006+
let mut expected = expected
1007+
.iter()
1008+
.copied()
1009+
.filter(|name| !deprecated.contains(name))
1010+
.collect::<Vec<_>>();
9951011
expected.sort_unstable();
9961012

9971013
let (rows, column_widths) = calculate_dimensions(&expected);

tests/ui-toml/toml_unknown_key/conf_unknown_key.stderr

-9
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,11 @@ error: error reading Clippy's configuration file: unknown field `foobar`, expect
2929
array-size-threshold
3030
avoid-breaking-exported-api
3131
await-holding-invalid-types
32-
blacklisted-names
3332
cargo-ignore-publish
3433
check-incompatible-msrv-in-tests
3534
check-inconsistent-struct-field-initializers
3635
check-private-items
3736
cognitive-complexity-threshold
38-
cyclomatic-complexity-threshold
3937
disallowed-macros
4038
disallowed-methods
4139
disallowed-names
@@ -51,7 +49,6 @@ error: error reading Clippy's configuration file: unknown field `foobar`, expect
5149
ignore-interior-mutability
5250
large-error-threshold
5351
lint-commented-code
54-
lint-inconsistent-struct-field-initializers
5552
literal-representation-threshold
5653
matches-for-let-else
5754
max-fn-params-bools
@@ -124,13 +121,11 @@ error: error reading Clippy's configuration file: unknown field `barfoo`, expect
124121
array-size-threshold
125122
avoid-breaking-exported-api
126123
await-holding-invalid-types
127-
blacklisted-names
128124
cargo-ignore-publish
129125
check-incompatible-msrv-in-tests
130126
check-inconsistent-struct-field-initializers
131127
check-private-items
132128
cognitive-complexity-threshold
133-
cyclomatic-complexity-threshold
134129
disallowed-macros
135130
disallowed-methods
136131
disallowed-names
@@ -146,7 +141,6 @@ error: error reading Clippy's configuration file: unknown field `barfoo`, expect
146141
ignore-interior-mutability
147142
large-error-threshold
148143
lint-commented-code
149-
lint-inconsistent-struct-field-initializers
150144
literal-representation-threshold
151145
matches-for-let-else
152146
max-fn-params-bools
@@ -219,13 +213,11 @@ error: error reading Clippy's configuration file: unknown field `allow_mixed_uni
219213
array-size-threshold
220214
avoid-breaking-exported-api
221215
await-holding-invalid-types
222-
blacklisted-names
223216
cargo-ignore-publish
224217
check-incompatible-msrv-in-tests
225218
check-inconsistent-struct-field-initializers
226219
check-private-items
227220
cognitive-complexity-threshold
228-
cyclomatic-complexity-threshold
229221
disallowed-macros
230222
disallowed-methods
231223
disallowed-names
@@ -241,7 +233,6 @@ error: error reading Clippy's configuration file: unknown field `allow_mixed_uni
241233
ignore-interior-mutability
242234
large-error-threshold
243235
lint-commented-code
244-
lint-inconsistent-struct-field-initializers
245236
literal-representation-threshold
246237
matches-for-let-else
247238
max-fn-params-bools

0 commit comments

Comments
 (0)