Skip to content

Commit d021ed5

Browse files
committed
base tests: make sure to fail CI if tests need formatting
1 parent 7735612 commit d021ed5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ci/base-tests.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ cargo +nightly fmt --all -- --check
3838

3939
#avoid loop spam
4040
set +x
41+
4142
# make sure tests are formatted
4243

4344
# some lints are sensitive to formatting, exclude some files
@@ -47,11 +48,13 @@ rustup default nightly
4748
for file in `find tests -not -path "tests/ui/methods.rs" -not -path "tests/ui/format.rs" -not -path "tests/ui/formatting.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
4849
rustfmt ${file} --check || echo "${file} needs reformatting!" ; needs_formatting=true
4950
done
51+
52+
set -x
53+
5054
# switch back to master
5155
rustup default master
5256

53-
if [ "${needs_reformatting}" = true ] ; then
57+
if [[ ${needs_reformatting} == true ]] ; then
5458
echo "Tests need reformatting!"
5559
exit 2
5660
fi
57-
set -x

0 commit comments

Comments
 (0)