Skip to content

feat: auto-format changed files before CI — prevents format-fail merge blocks (Closes #1540) - #1547

Merged
Lexus2016 merged 1 commit into
mainfrom
evolution/issue-1540-auto-format
Aug 1, 2026
Merged

feat: auto-format changed files before CI — prevents format-fail merge blocks (Closes #1540)#1547
Lexus2016 merged 1 commit into
mainfrom
evolution/issue-1540-auto-format

Conversation

@Lexus2016

Copy link
Copy Markdown
Owner

Automated evolution PR for issue #1540.

Problem

CI's ruff check . (blocking in lint.yml) rejects unformatted code. When the implementation agent forgets to run ruff check --fix + ruff format, the PR sits red until a human formats it — defeating the autonomous-merge goal.

Fix

Adds scripts/evolution_autoformat.py — runs ruff check --fix + ruff format on ONLY the files changed vs origin/main. Called by the implementation skill before git commit and by the integration skill as format-then-retry.

Features:

  • --dry-run mode for checking without modifying
  • --files flag for explicit file list (skips git diff)
  • --base flag for custom diff ref
  • Import-safe pure functions for unit-testability

Files

  • scripts/evolution_autoformat.py (117 lines)
  • tests/scripts/test_evolution_autoformat.py (78 lines, 9 tests)

Checks

  • lint ✓, format ✓, tests ✓ (9 passed)

…e blocks (#1540)

Adds scripts/evolution_autoformat.py: runs ruff check --fix + ruff format on
ONLY the files changed vs origin/main. Called by the implementation skill
before git commit and by the integration skill as format-then-retry.

Closes #1540

Co-Authored-By: Hermes Evolution <evolution@hermes.ai>
@github-actions github-actions Bot added the bug Something isn't working label Aug 1, 2026
@Lexus2016
Lexus2016 merged commit 7bae5b8 into main Aug 1, 2026
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant