Fix the test script to return an error if formatting diffs are found.

This commit is contained in:
Dan Gohman
2018-08-01 12:13:45 -07:00
parent 01729be8d7
commit f89cb1df64
2 changed files with 2 additions and 8 deletions

View File

@@ -27,8 +27,7 @@ function banner {
# Run rustfmt if we have it.
banner "Rust formatting"
if type rustfmt > /dev/null; then
# In newer versions of rustfmt, replace --write-mode=diff with --check.
if ! "$topdir/format-all.sh" --write-mode=diff ; then
if ! "$topdir/format-all.sh" --write-mode=check ; then
echo "Formatting diffs detected! Run \"cargo fmt --all\" to correct."
exit 1
fi