-
-
Notifications
You must be signed in to change notification settings - Fork 317
chore(ci): add an autofix for cargo-sort #2501
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds automated cargo-sort formatting for Cargo.toml files by integrating it into the CI workflow and creating a new autofix job that runs on pull requests.
Changes:
- Replaced
cargo-binstallwithcargo-sortin the CI workflow tool installation - Added a new
fmt-tomljob to the autofix workflow that automatically formats Cargo.toml files - Updated the autofix workflow to trigger on PR opened, synchronize, and reopened events
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| .github/workflows/ci.yml | Replaced cargo-binstall with cargo-sort in tool installation |
| .github/workflows/autofix.yml | Added fmt-toml job for automatic Cargo.toml formatting and updated trigger conditions |
nyurik
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approving, but plz review the comment first
.github/workflows/ci.yml
Outdated
| - uses: taiki-e/install-action@763e3324d4fd026c9bd284c504378585777a87d5 # v2.62.57 | ||
| # TODO: add cargo-sort once https://github.com/taiki-e/install-action/pull/997 is resolved | ||
| with: { tool: 'just,cargo-binstall' } | ||
| with: { tool: 'just,cargo-sort' } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you mean to remove cargo-sort instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fair, does not make sense to have this in two places
I consistently have the problem to get my ABC into check.
I would like to have an autofix for this, but pre-commit does not support running this, so I added it to our autofix config.