Skip to content

fix: --fix mode now fixes all files, not just the first#6

Merged
mit-d merged 2 commits intomainfrom
fix/fix-all-files
Feb 23, 2026
Merged

fix: --fix mode now fixes all files, not just the first#6
mit-d merged 2 commits intomainfrom
fix/fix-all-files

Conversation

@mit-d
Copy link
Owner

@mit-d mit-d commented Feb 23, 2026

Summary

  • any(fix_file(f) for f in files) short-circuits on the first True, so only the first fixable file was actually fixed per run. In a pre-commit context (where all staged files are passed at once), this meant only one file got fixed per commit attempt.
  • Changed to a list comprehension to force all fix_file() calls to execute before checking results.
  • Added regression test for multi-file fix mode.

Test plan

  • Existing 199 tests pass
  • New test_fix_multiple_files_all_fixed verifies both files are fixed in a single --fix run
  • Manual reproduction confirmed the bug and verified the fix

any() short-circuits on the first True, so fix_file was never called
on files after the first one that needed fixing. Use a list
comprehension to force evaluation of all files.
@mit-d mit-d force-pushed the fix/fix-all-files branch from 5019f08 to 65d829e Compare February 23, 2026 19:38
@mit-d mit-d merged commit 0aa86c1 into main Feb 23, 2026
4 checks passed
@mit-d mit-d deleted the fix/fix-all-files branch February 23, 2026 19:39
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.

1 participant