Skip to content

Commit 32adcfc

Browse files
committed
Improve the script to enforce rustfmt on automation.
1 parent 74a0138 commit 32adcfc

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
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: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ case "$BINDGEN_JOB" in
4545
./ci/assert-docs.sh
4646
./ci/test-book.sh
4747
./ci/no-includes.sh
48-
# `rustfmt` isn't reaching a fixed point on bindgen
49-
# code... https://github.com/rust-lang/rustfmt/issues/1376
48+
# Disabled because https://github.com/rust-lang/rustfmt/issues/3799.
5049
# ./ci/assert-rustfmt.sh
5150
;;
5251

0 commit comments

Comments
 (0)