Skip to content

Commit 8f5fd60

Browse files
committed
chore(ci): add fmt job to ci.yml and document enforcement
Add a cargo-fmt job to `.github/workflows/ci.yml` that runs `cargo fmt --all -- --check` on every touched-Rust PR. The job follows the same pattern as the existing deny job: `needs: changes`, `if: needs.changes.outputs.rust == 'true'`, `ubuntu-latest`, least-privilege `contents: read`, `actions/checkout@v6` with `persist-credentials: false`, and `dtolnay/rust-toolchain@stable` with the `rustfmt` component. Update `CONTRIBUTING.md` and `.github/PULL_REQUEST_TEMPLATE.md` to replace the bare `cargo fmt --check` mention with the exact CI command (`cargo fmt --all -- --check`) and note that violations block merge.
1 parent 9af1446 commit 8f5fd60

3 files changed

Lines changed: 23 additions & 7 deletions

File tree

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ What did you run to convince yourself this works? Be specific.
3333
For inference changes, real-checkpoint validation is required — synthetic-only is not enough.
3434
-->
3535

36-
- [ ] `cargo fmt --check`
36+
- [ ] `cargo fmt --all -- --check` (enforced by CI — violations block merge)
3737
- [ ] `cargo clippy --all-targets -- -D warnings`
3838
- [ ] `cargo test --release`
3939
- [ ] `cargo deny check`

.github/workflows/ci.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# PR / push CI for security audit. Builds and tests are covered by
1+
# PR / push CI for lightweight quality gates. Builds and tests are covered by
22
# release.yml (signed artifacts) and pipeline-parallel-ci.yml (distributed
3-
# runs); this workflow runs the lightweight cargo-deny gate on every
4-
# touched-Rust change so license drift and new advisories are caught at
5-
# PR time.
3+
# runs); this workflow runs cargo-deny (license / advisory) and cargo-fmt
4+
# checks on every touched-Rust change so formatting drift and license issues
5+
# are caught at PR time.
66

77
name: CI
88

@@ -54,3 +54,19 @@ jobs:
5454
with:
5555
command: check
5656
log-level: warn
57+
58+
fmt:
59+
name: cargo-fmt
60+
needs: changes
61+
if: needs.changes.outputs.rust == 'true'
62+
runs-on: ubuntu-latest
63+
permissions:
64+
contents: read
65+
steps:
66+
- uses: actions/checkout@v6
67+
with:
68+
persist-credentials: false
69+
- uses: dtolnay/rust-toolchain@stable
70+
with:
71+
components: rustfmt
72+
- run: cargo fmt --all -- --check

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ Thank you for your interest in contributing to mlxcel! This document covers the
4141
```
4242
4. Run the local quality gates:
4343
```bash
44-
cargo fmt --check
44+
cargo fmt --all -- --check # enforced by CI; fmt violations block merge
4545
cargo clippy --all-targets -- -D warnings
46-
cargo deny check # advisories + licenses + sources
46+
cargo deny check # advisories + licenses + sources
4747
```
4848
5. For inference changes, validate against a real checkpoint — synthetic or build-only validation is not enough (see [`AGENTS.md`](AGENTS.md) for why).
4949
6. Commit with a conventional prefix (see below) and a clear message.

0 commit comments

Comments
 (0)