Skip to content

ci: add mechanical formatting autofix workflow#1937

Open
purusang wants to merge 1 commit into
mainfrom
autofix-mechanical-formatting
Open

ci: add mechanical formatting autofix workflow#1937
purusang wants to merge 1 commit into
mainfrom
autofix-mechanical-formatting

Conversation

@purusang
Copy link
Copy Markdown
Contributor

@purusang purusang commented Jun 4, 2026

Description

Adds a pull request workflow that applies deterministic mechanical formatting fixes and pushes them back to same-repository PR branches. The workflow currently runs Rust, TOML, and functional-test Python formatters:

  • cargo fmt --all
  • taplo fmt
  • uv run ruff format in functional-tests

The existing lint workflows remain responsible for checking the resulting commit.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature/Enhancement (non-breaking change which adds functionality or enhances an existing one)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactor
  • New or updated tests
  • Dependency Update

Notes to Reviewers

The workflow is limited to PR branches from this repository, so it does not try to push to fork PRs. It requests contents: write because the built-in GITHUB_TOKEN needs that permission to push formatter commits.

Is this PR addressing any specification, design doc or external reference document?

  • Yes
  • No

If yes, please add relevant links:

Checklist

  • I have performed a self-review of my code.
  • I have commented my code where necessary.
  • I have updated the documentation if needed.
  • My changes do not introduce new warnings.
  • I have added (where necessary) tests that prove my changes are effective or that my feature works.
  • New and existing tests pass with my changes.
  • I have disclosed my use of AI in the body of this PR.

Validation: actionlint .github/workflows/autofix-formatting.yml

AI assistance notice: This PR was prepared with AI assistance.

Related Issues

@purusang purusang force-pushed the autofix-mechanical-formatting branch from f6f9f2c to e672c49 Compare June 4, 2026 05:32
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

Commit: 966f069

SP1 Execution Results

program cycles gas
EVM EE Chunk 824,732 969,394
EVM EE Account 404,056 498,593
Checkpoint 2,601,550 3,007,194

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.38%. Comparing base (b5d34b8) to head (e672c49).

@@            Coverage Diff             @@
##             main    #1937      +/-   ##
==========================================
- Coverage   84.42%   84.38%   -0.04%     
==========================================
  Files         637      637              
  Lines       76805    76805              
==========================================
- Hits        64840    64813      -27     
- Misses      11965    11992      +27     
Flag Coverage Δ
functional 66.42% <ø> (-0.10%) ⬇️
unit 69.52% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 8 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Member

@storopoli storopoli left a comment

Choose a reason for hiding this comment

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

NACK.

2 things:

  1. this adds a contents: write in permissions which is VERY VERY BAD for security purposes.
  2. this also breaks the planned git commit signing requirement that we intend to roll before mainnet (see here).

A suggestion would be to add a contrib/git-hooks directory with a bunch of pre-commit hooks that would make impossible to do a commit that is not cargo fmted. Pair that up with a just recipe to install/uninstall the git hooks and voilà.

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