Require a specific rustfmt version in test-all script.
Rustfmt is still so immature that developers can't have different versions installed, or there will be minute differences in formatting causing the tests to fail. Only run rustfmt as part of the test-all script if the expected version is available.
This commit is contained in:
@@ -21,10 +21,23 @@ function banner() {
|
|||||||
echo "====== $@ ======"
|
echo "====== $@ ======"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Run rustfmt if we have it. (Travis probably won't).
|
# Run rustfmt if we have it.
|
||||||
if cargo install --list | grep -q '^rustfmt '; then
|
#
|
||||||
|
# Rustfmt is still immature enough that its formatting decisions can change
|
||||||
|
# between versions. This makes it difficult to enforce a certain style in a
|
||||||
|
# test script since not all developers will upgrade rustfmt at the same time.
|
||||||
|
# To work around this, we only verify formatting when a specific version of
|
||||||
|
# rustfmt is installed.
|
||||||
|
#
|
||||||
|
# This version should always be bumped to the newest version available.
|
||||||
|
RUSTFMT_VERSION="0.5.0"
|
||||||
|
|
||||||
|
if cargo install --list | grep -q "^rustfmt v$RUSTFMT_VERSION"; then
|
||||||
banner "Rust formatting"
|
banner "Rust formatting"
|
||||||
$topdir/src/format-all.sh --write-mode=diff
|
$topdir/src/format-all.sh --write-mode=diff
|
||||||
|
else
|
||||||
|
echo "Please install rustfmt v$RUSTFMT_VERSION to verify formatting."
|
||||||
|
echo "If a newer version of rustfmt is available, update this script."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PKGS="cretonne cretonne-reader cretonne-tools"
|
PKGS="cretonne cretonne-reader cretonne-tools"
|
||||||
|
|||||||
Reference in New Issue
Block a user