Skip to content

Commit 1d40288

Browse files
committed
Improve the script to enforce rustfmt on automation.
1 parent a6e47d2 commit 1d40288

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

ci/assert-rustfmt.sh

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,10 @@
33
set -xeu
44
cd "$(dirname "$0")/.."
55

6-
# Ensure we have the most up-to-date `rustfmt`.
7-
cargo install -f rustfmt
6+
rustup update nightly
7+
rustup component add rustfmt --toolchain nightly
88

99
# Run `rustfmt` on the crate! If `rustfmt` can't make a long line shorter, it
1010
# prints an error and exits non-zero, so tell it to kindly shut its yapper and
1111
# make sure it doesn't cause us to exit this whole script non-zero.
12-
cargo fmt --quiet || true
13-
14-
# Exit non-zero if this resulted in any diffs.
15-
./ci/assert-no-diff.sh
16-
12+
rustup run nightly cargo fmt -- --check

ci/script.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ case "$BINDGEN_JOB" in
1414
# Need rustfmt to compare the test expectations.
1515
rustup update nightly
1616
rustup component add rustfmt
17-
export RUSTFMT="$(rustup which rustfmt)"
17+
export RUSTFMT="$(rustup which rustfmt)"
1818
cargo test $BINDGEN_PROFILE --features "$BINDGEN_FEATURES"
1919
./ci/assert-no-diff.sh
2020
;;
@@ -33,8 +33,7 @@ case "$BINDGEN_JOB" in
3333
./ci/assert-docs.sh
3434
./ci/test-book.sh
3535
./ci/no-includes.sh
36-
# `rustfmt` isn't reaching a fixed point on bindgen
37-
# code... https://github.com/rust-lang/rustfmt/issues/1376
36+
# Disabled because https://github.com/rust-lang/rustfmt/issues/3799.
3837
# ./ci/assert-rustfmt.sh
3938
;;
4039

0 commit comments

Comments
 (0)