about summary refs log tree commit diff
path: root/rustfmt.toml
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-05-28 10:03:00 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2024-05-28 19:28:46 +1000
commitf1b0ca08a42e9cbfcd91e25174be2e36cdaf2651 (patch)
treee4f22f77ba09150ef7ebb4617ddb775e951fefca /rustfmt.toml
parent4702a1c345f1c13e13bdbe9bb3fdb81d6f866d85 (diff)
downloadrust-f1b0ca08a42e9cbfcd91e25174be2e36cdaf2651.tar.gz
rust-f1b0ca08a42e9cbfcd91e25174be2e36cdaf2651.zip
Don't format `tests/run-make/*/rmake.rs`.
It's reasonable to want to, but in the current implementation this
causes multiple problems.

- All the `rmake.rs` files are formatted every time even when they
  haven't changed. This is because they get whitelisted unconditionally
  in the `OverrideBuilder`, before the changed files get added.

- The way `OverrideBuilder` works, if any files gets whitelisted then no
  unmentioned files will get traversed. This is surprising, and means
  that the `rmake.rs` entries broke the use of explicit paths to `x
  fmt`, and also broke `GITHUB_ACTIONS=true git check --fmt`.

The commit removes the `rmake.rs` entries, fixes the formatting of a
couple of files that were misformatted (not previously caught due to the
`GITHUB_ACTIONS` breakage), and bans `!`-prefixed entries in
`rustfmt.toml` because they cause all these problems.
Diffstat (limited to 'rustfmt.toml')
-rw-r--r--rustfmt.toml10
1 files changed, 2 insertions, 8 deletions
diff --git a/rustfmt.toml b/rustfmt.toml
index 4812c9302df..b78e96d5872 100644
--- a/rustfmt.toml
+++ b/rustfmt.toml
@@ -3,7 +3,7 @@ version = "Two"
 use_small_heuristics = "Max"
 merge_derives = false
 
-# Files to ignore. Each entry uses gitignore syntax.
+# Files to ignore. Each entry uses gitignore syntax, but `!` prefixes aren't allowed.
 ignore = [
     "/build/",
     "/*-build/",
@@ -12,13 +12,7 @@ ignore = [
 
     # Tests for now are not formatted, as they are sometimes pretty-printing constrained
     # (and generally rustfmt can move around comments in UI-testing incompatible ways).
-    "/tests/*",
-
-    # But we still want to format rmake.rs files in tests/run-make/ so we need to do this
-    # dance to avoid the parent directory from being excluded.
-    "!/tests/run-make/",
-    "/tests/run-make/*/*.rs",
-    "!/tests/run-make/*/rmake.rs",
+    "/tests/",
 
     # Do not format submodules.
     # FIXME: sync submodule list with tidy/bootstrap/etc