Skip to content

Commit 6e61561

Browse files
committed
Extract deny lints to const array
1 parent 7206e9a commit 6e61561

File tree

1 file changed

+20
-26
lines changed

1 file changed

+20
-26
lines changed

tests/dogfood.rs

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,21 @@ fn dogfood() {
5757
);
5858
}
5959

60+
const DENY_LINTS: &[&str] = &[
61+
"unfulfilled_lint_expectations",
62+
"clippy::all",
63+
"clippy::pedantic",
64+
"clippy::dbg_macro",
65+
"clippy::decimal_literal_representation",
66+
"clippy::derive_partial_eq_without_eq",
67+
"clippy::iter_on_empty_collections",
68+
"clippy::iter_on_single_items",
69+
"clippy::needless_pass_by_ref_mut",
70+
"clippy::significant_drop_tightening",
71+
"clippy::tuple_array_conversions",
72+
"clippy::useless_let_if_seq",
73+
];
74+
6075
#[must_use]
6176
fn run_clippy_for_package(project: &str) -> bool {
6277
let root_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
@@ -82,32 +97,11 @@ fn run_clippy_for_package(project: &str) -> bool {
8297

8398
command.arg("--");
8499
command.arg("-Cdebuginfo=0"); // disable debuginfo to generate less data in the target dir
85-
command.args([
86-
"-D",
87-
"unfulfilled_lint_expectations",
88-
"-D",
89-
"clippy::all",
90-
"-D",
91-
"clippy::pedantic",
92-
"-D",
93-
"clippy::dbg_macro",
94-
"-D",
95-
"clippy::decimal_literal_representation",
96-
"-D",
97-
"clippy::derive_partial_eq_without_eq",
98-
"-D",
99-
"clippy::iter_on_empty_collections",
100-
"-D",
101-
"clippy::iter_on_single_items",
102-
"-D",
103-
"clippy::needless_pass_by_ref_mut",
104-
"-D",
105-
"clippy::significant_drop_tightening",
106-
"-D",
107-
"clippy::tuple_array_conversions",
108-
"-D",
109-
"clippy::useless_let_if_seq",
110-
]);
100+
101+
for lint in DENY_LINTS {
102+
command.args(["-D", lint]);
103+
}
104+
111105
if !cfg!(feature = "internal") {
112106
// running a clippy built without internal lints on the clippy source
113107
// that contains e.g. `allow(clippy::symbol_as_str)`

0 commit comments

Comments
 (0)