Skip to content

Commit 1187328

Browse files
committed
Add --check to cargo fmt run in CI
`cargo fmt` was being called twice without `--check`, so style was only enforced on files that got checked individually. Remove the redundant call and add `--check` here.
1 parent dc4c75d commit 1187328

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

ci/style.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ cargo test --manifest-path libc-test/Cargo.toml --test style -- --nocapture
99
command -v rustfmt
1010
rustfmt -V
1111

12-
# Run once to cover everything that isn't in `src/`
13-
cargo fmt
14-
1512
# Save a list of all source files
1613
tmpfile="file-list~" # trailing tilde for gitignore
1714
find src -name '*.rs' > "$tmpfile"
@@ -61,7 +58,7 @@ rm "$tmpfile"
6158

6259
# Run once from workspace root to get everything that wasn't handled as an
6360
# individual file.
64-
cargo fmt
61+
cargo fmt "$check"
6562

6663
# Ensure that `sort` output is not locale-dependent
6764
export LC_ALL=C

0 commit comments

Comments
 (0)