base tests: assert that tests are properly formatted.
This commit is contained in:
parent
1fbcbe4aa1
commit
1218145bc9
1 changed files with 13 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue