Skip to content

CI: Auto-fix and push formatting and clippy changes instead of failing#116

Merged
becheran merged 5 commits intomasterfrom
copilot/update-ci-formatter-check
Dec 9, 2025
Merged

CI: Auto-fix and push formatting and clippy changes instead of failing#116
becheran merged 5 commits intomasterfrom
copilot/update-ci-formatter-check

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 9, 2025

The formatting job in CI currently fails when code isn't formatted correctly or has clippy warnings. This changes it to automatically fix both formatting and clippy issues, then push the changes back to the branch.

Changes

  • Replaced actions-rust-lang/rustfmt@v1 check-only action with cargo fmt to auto-fix formatting
  • Added cargo clippy --fix to automatically apply clippy suggestions
  • Added permissions: contents: write to grant GITHUB_TOKEN push permissions
  • Added conditional commit and push logic:
    • Detects formatting and clippy changes via git status --porcelain
    • Commits using github-actions bot identity
    • Pushes back to the same branch
  • Configured checkout with GITHUB_TOKEN for write access
  • Both rustfmt and clippy fixes are committed together in a single commit

The workflow now automatically corrects both formatting and clippy issues during CI runs instead of requiring manual intervention.

Original prompt

Change the formatter check to not only check the formatting, but do a push with the updated/fixed formatting instead on the ci pipeliine


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits December 9, 2025 08:39
Co-authored-by: becheran <22472855+becheran@users.noreply.github.com>
Co-authored-by: becheran <22472855+becheran@users.noreply.github.com>
Copilot AI changed the title [WIP] Update CI pipeline to push changes after formatter check CI: Auto-fix and push formatting changes instead of failing Dec 9, 2025
Copilot AI requested a review from becheran December 9, 2025 08:42
Copy link
Copy Markdown
Owner

@becheran becheran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix comments

Co-authored-by: becheran <22472855+becheran@users.noreply.github.com>
Copilot AI changed the title CI: Auto-fix and push formatting changes instead of failing CI: Auto-fix and push formatting and clippy changes instead of failing Dec 9, 2025
Copilot AI requested a review from becheran December 9, 2025 10:01
@becheran becheran marked this pull request as ready for review December 9, 2025 12:39
@becheran becheran merged commit 3f258a0 into master Dec 9, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants