base tests: switch to nightly toolchain before checking formatting of tests with rustfmt

this errored because rustfmt is not available on the master toolchain
This commit is contained in:
Matthias Krüger 2018-12-27 12:16:08 +01:00
parent 721f688eff
commit bcc309f27d

View file

@ -42,9 +42,13 @@ set +x
# some lints are sensitive to formatting, exclude some files
needs_formatting=false
# switch to nightly
rustup default nightly
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
rustfmt ${file} --check || echo "${file} needs reformatting!" ; needs_formatting=true
done
# switch back to master
rustup default master
if [ "${needs_reformatting}" = true ] ; then
echo "Tests need reformatting!"