fix-rust-fmt
Fix Rust formatting issues in the optimism monorepo which would cause the rust-fmt CI job to fail.
When to Use
Use this skill when the rust-fmt CI job fails on a PR that touches Rust code.
Trigger Phrases
- "Fix rust formatting"
- "rust-fmt is failing"
- "Fix the rust-fmt CI job"
Prerequisites
misemust be trusted and installed for this repo (mise trust && mise install)
Workflow
Step 1: Ensure mise tools are installed
From the repo root (or worktree root):
cd <REPO_ROOT> && mise install
This installs rust, just, and all other tools pinned in mise.toml.
Step 2: Run the formatter
cd <REPO_ROOT>/rust && mise exec -- just fmt-fix
Any files that change are the reason the CI job failed. Stage and commit them.
Notes
mise exec --activates the mise environment socargo,just, andrustupresolve to the versions pinned inmise.toml.- The nightly toolchain is required because the workspace uses unstable
rustfmtoptions (seerust/rustfmt.toml). - There is no need to inspect
rust-fmtCI errors — if the job failed, runningjust fmt-fixand committing the result is the complete fix.