Verify Rust source code formatting as part of the unit tests.

Only do this is rustfmt is installed, which likely means don't run on Travis
CI.
This commit is contained in:
Jakob Stoklund Olesen
2016-08-24 16:36:52 -07:00
parent 21ba900d19
commit d0db391897

View File

@@ -21,6 +21,12 @@ function banner() {
echo "====== $@ ======" echo "====== $@ ======"
} }
# Run rustfmt if we have it. (Travis probably won't).
if cargo install --list | grep -q '^rustfmt '; then
banner "Rust formatting"
$topdir/src/format-all.sh --write-mode=diff
fi
PKGS="cretonne cretonne-reader cretonne-tools" PKGS="cretonne cretonne-reader cretonne-tools"
cd "$topdir/src/tools" cd "$topdir/src/tools"
for PKG in $PKGS for PKG in $PKGS