Skip to content

Commit 871a900

Browse files
cscheidclaude
andcommitted
ci: add rustfmt --check gate to test suite
CI ran cargo xtask lint + clippy but never checked formatting, so external PRs could (and did) land cargo-fmt-dirty code while green. Add a fail-fast `cargo fmt --all -- --check` step before the build, Linux-only (formatting is platform-independent). Uses the nightly toolchain already set up; no rustfmt.toml means nightly defaults, matching the local post-edit fmt hook. The preceding commit cleared the pre-existing drift so this gate starts green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent e61bef8 commit 871a900

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

.github/workflows/test-suite.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,17 @@ jobs:
138138
sudo docker image prune --all --force
139139
sudo docker builder prune -a --force
140140
141+
# Formatting gate (before build to fail fast). rustfmt and clippy are
142+
# orthogonal — clippy can pass on code rustfmt would rewrite — so a fmt
143+
# check is needed to stop external PRs landing unformatted code. No
144+
# `rustfmt.toml` in-tree → nightly defaults (the toolchain set up above),
145+
# matching the local `cargo fmt` post-edit hook. Linux-only: formatting is
146+
# platform-independent, so running it once is enough.
147+
- name: Rustfmt (check)
148+
if: runner.os == 'Linux'
149+
shell: bash
150+
run: cargo fmt --all -- --check
151+
141152
# Custom lint checks (before build to fail fast)
142153
- name: Run custom lints
143154
shell: bash

0 commit comments

Comments
 (0)