about summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-xci/base-tests.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/ci/base-tests.sh b/ci/base-tests.sh
index 2537f157ad9..6eeab6671cb 100755
--- a/ci/base-tests.sh
+++ b/ci/base-tests.sh
@@ -27,3 +27,16 @@ cd clippy_dev && cargo test && cd ..
 # Perform various checks for lint registration
 ./util/dev update_lints --check
 cargo +nightly fmt --all -- --check
+
+# make sure tests are formatted
+
+# some lints are sensitive to formatting, exclude some files
+needs_formatting=false
+for file in `find tests -not -path "tests/ui/methods.rs" -not -path "tests/ui/format.rs" -not -path "tests/ui/empty_line_after_outer_attribute.rs" -not -path "tests/ui/double_parens.rs" -not -path "tests/ui/doc.rs" -not -path "tests/ui/unused_unit.rs" | grep "\.rs$"` ; do
+rustfmt ${file} --check  || echo "${file} needs reformatting!" ; needs_formatting=true
+done
+
+if $needs_reformatting
+    "Tests need reformatting!"
+    exit 2
+fi