base tests: assert that tests are properly formatted.

This commit is contained in:
Matthias Krüger 2018-12-09 22:06:29 +01:00
parent 1fbcbe4aa1
commit 1218145bc9

View File

@ -27,3 +27,16 @@ cd clippy_dev && cargo test && cd ..
# Perform various checks for lint registration # Perform various checks for lint registration
./util/dev update_lints --check ./util/dev update_lints --check
cargo +nightly fmt --all -- --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