about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJakub Beránek <berykubik@gmail.com>2025-08-13 07:03:47 +0200
committerGitHub <noreply@github.com>2025-08-13 07:03:47 +0200
commit900e568026f63e0ba88e1db71c6347f628186cfc (patch)
tree0922286dcbb5697f85ced65313a376b79589583b
parentbd2db284fd438f07a0491ed3bc49256279541253 (diff)
parent7af87d18d2ebe93f30221abd0d6de11ff8fcd5c1 (diff)
downloadrust-900e568026f63e0ba88e1db71c6347f628186cfc.tar.gz
rust-900e568026f63e0ba88e1db71c6347f628186cfc.zip
Rollup merge of #144642 - lolbinarycat:editorconfig-no-run-make, r=lcnr
editorconfig: don't trim trailing whitespace in tests

some test snapshot files require trailing whitespace, and previously manually editing those snapshot files (as is required for run-make tests and some platform-specific tests) in an editor with editorconfig support would cause that whitespace to be removed, [causing CI failures like this one](https://github.com/rust-lang/rust/pull/144596#issuecomment-3130442996)
-rw-r--r--.editorconfig11
1 files changed, 10 insertions, 1 deletions
diff --git a/.editorconfig b/.editorconfig
index ef8ed24c52a..1b137cf4ebe 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -7,9 +7,18 @@ root = true
 [*]
 end_of_line = lf
 charset = utf-8
-trim_trailing_whitespace = true
 insert_final_newline = true
 
+# some tests need trailing whitespace in output snapshots
+[!tests/]
+trim_trailing_whitespace = true
+# for actual source code files of test, we still don't want trailing whitespace
+[tests/**.{rs,js}]
+trim_trailing_whitespace = true
+# these specific source files need to have trailing whitespace.
+[tests/ui/{frontmatter/frontmatter-whitespace-3.rs,parser/shebang/shebang-space.rs}]
+trim_trailing_whitespace = false
+
 [!src/llvm-project]
 indent_style = space
 indent_size = 4