Skip to content

Commit 984af5b

Browse files
committed
Use rustfmt.toml to skip problematic tests.
1 parent e21a215 commit 984af5b

5 files changed

+16
-18
lines changed

clippy_dev/src/fmt.rs

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -270,17 +270,16 @@ fn run_rustfmt(update_mode: UpdateMode) {
270270

271271
let args: Vec<_> = WalkDir::new(".")
272272
.into_iter()
273-
.filter_entry(|e|
274-
// Skip traversing some of the larger directories.
275-
e.path()
276-
.as_os_str()
277-
.as_encoded_bytes()
278-
.get(2..)
279-
.is_none_or(|x| x != "target".as_bytes() && x != ".git".as_bytes())
280-
&& e.path().file_name().is_none_or(|x| x != "skip_rustfmt"))
281-
// e.path().file_name().is_none_or(|x| x != "skip_rustfmt"))
273+
.filter_entry(|e| {
274+
// Skip traversing larger directories
275+
e.path()
276+
.as_os_str()
277+
.as_encoded_bytes()
278+
.get(2..)
279+
.is_none_or(|x| x != "target".as_bytes() && x != ".git".as_bytes())
280+
})
282281
.filter_map(|e| {
283-
let e = e.expect("error reading `tests`");
282+
let e = e.expect("error reading `.`");
284283
e.path()
285284
.as_os_str()
286285
.as_encoded_bytes()
@@ -299,12 +298,7 @@ fn run_rustfmt(update_mode: UpdateMode) {
299298
cmd.stdout(Stdio::null())
300299
.stdin(Stdio::null())
301300
.stderr(Stdio::piped())
302-
.args([
303-
"--config",
304-
"show_parse_errors=false",
305-
"--unstable-features",
306-
"--skip-children",
307-
]);
301+
.args(["--unstable-features", "--skip-children"]);
308302
cmd
309303
},
310304
args.iter(),

rustfmt.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@ edition = "2024"
66
error_on_line_overflow = true
77
imports_granularity = "Module"
88
style_edition = "2024"
9-
ignore = ["tests/ui/crashes/ice-10912.rs"]
9+
ignore = [
10+
"tests/ui/crashes/ice-9405.rs",
11+
"tests/ui/crashes/ice-10912.rs",
12+
"tests/ui/non_expressive_names_error_recovery.rs",
13+
]

tests/ui/skip_rustfmt/non_expressive_names_error_recovery.stderr renamed to tests/ui/non_expressive_names_error_recovery.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: expected one of `!`, `(`, `+`, `,`, `::`, `<`, or `>`, found `)`
2-
--> tests/ui/skip_rustfmt/non_expressive_names_error_recovery.rs:6:19
2+
--> tests/ui/non_expressive_names_error_recovery.rs:6:19
33
|
44
LL | fn aa(a: Aa<String) {
55
| ^ expected one of 7 possible tokens

0 commit comments

Comments
 (0)