-
Notifications
You must be signed in to change notification settings - Fork 3.9k
chore: add fix-rust-fmt Claude Code skill #19488
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
0680e94
chore: add fix-rust-fmt Claude Code skill
ajsutton d40b5c5
Apply suggestion from @ajsutton
ajsutton ee4cac9
Update .claude/skills/fix-rust-fmt/SKILL.md
ajsutton 836e0ca
docs: link /fix-rust-fmt skill from kona CLAUDE.md
ajsutton f5f8a44
docs: reference fix-rust-fmt skill in rust-dev.md
ajsutton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| # 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 | ||
|
|
||
| - `mise` must 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): | ||
|
|
||
| ```bash | ||
| cd <REPO_ROOT> && mise install | ||
| ``` | ||
|
|
||
| This installs `rust`, `just`, and all other tools pinned in `mise.toml`. | ||
|
|
||
| ### Step 2: Install the nightly toolchain with rustfmt | ||
|
|
||
| The justfile pins a specific nightly (see `NIGHTLY` variable in `rust/justfile`). | ||
| Install it: | ||
|
|
||
| ```bash | ||
| cd <REPO_ROOT>/rust && mise exec -- just install-nightly | ||
| ``` | ||
|
|
||
| ### Step 3: Run the formatter | ||
|
|
||
| ```bash | ||
| 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 so `cargo`, `just`, and | ||
| `rustup` resolve to the versions pinned in `mise.toml`. | ||
| - The nightly toolchain is required because the workspace uses unstable | ||
| `rustfmt` options (see `rust/rustfmt.toml`). | ||
| - There is no need to inspect `rust-fmt` CI errors — if the job failed, running | ||
| `just fmt-fix` and committing the result is the complete fix. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.