ci: format the workspace with cargo fmt and check it in CI - #230
Conversation
AGENTS.md asks for cargo fmt before committing, but CI never checked it, and cargo fmt --check reported 12 unformatted hunks on main across exports.rs, func.rs, imports.rs and the regressions example. Format the workspace once and run cargo fmt --all --check before the build in the Gravity tests job, with the rustfmt from the pinned toolchain. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Arcjet Review — 🟡 Medium Risk
Decision: Checked
Rationale: This PR makes a small CI workflow change by adding cargo fmt --all --check before the build, and the Rust source changes shown are formatting-only import ordering and line wrapping. The CI/CD escalation trigger fires because .github/workflows/ci.yml changed, but the change is narrow, uses the existing Cargo toolchain, does not introduce secrets or untrusted input handling, and does not alter application logic. I am approving despite Medium risk because the workflow modification is straightforward and the code changes are mechanical formatting updates.
Summary of Changes
Adds a CI cargo fmt --all --check step to the Gravity tests workflow and checks in rustfmt-produced formatting changes across several Rust files.
Escalation Triggers
- CI/CD Pipeline: The PR modifies
.github/workflows/ci.ymlby adding a new cargo fmt check step.
Review Focus Areas
- Confirm the CI runner/toolchain setup used earlier in the job includes the
rustfmtcomponent for the pinned Rust toolchain.
If rustfmt is not installed in the CI environment, the new check will fail even when the code is formatted.
Notes
The AI assessed this PR as approvable, but the trust level (1) does not allow auto-approval. A human reviewer must approve this PR.
Review: 360567c4 | Model: openai/gpt-5.5 | Powered by Arcjet Review
AGENTS.md asks for
cargo fmtbefore committing, but CI never checked it, andcargo fmt --checkreported 12 unformatted hunks on main. This formats the workspace once and adds acargo fmt --all --checkstep before the build in theGravity testsjob, using the rustfmt from the pinned toolchain. It changes formatting only; generated output and test results are unchanged.Merge this after the open pull requests that touch the same files. Running
cargo fmt --allafter rebasing regenerates it.🤖 Generated with Claude Code