Fix missing newline in output, clarify docs#6
Merged
Conversation
- `Fixing <name>` lines were concatenated because `sys.stdout.write` omitted the trailing newline; add `\n` and tighten test assertions so a regression fails the suite. - Correct Exit Codes section: `1` is returned in fix mode too whenever any file needed fixing (intentional, pre-commit semantics). - Configuration: note that only the root `.gitignore` is consulted, and that `.uv-cache` and binary files are always skipped. - Add Acknowledgments section attributing the core fix logic to pre-commit/pre-commit-hooks. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixing <filename>lines were running together (Fixing c.txtFixing b.txtFixing a.txt) becausesys.stdout.writewas called without a trailing newline. Add\nand tighten the four test assertions from substring ("<name>" in output) to format-aware ("Fixing <name>\n" in output), so this regression now fails the suite.1was only returned in--checkmode. The tool actually returns1in fix mode too whenever a file needed fixing (intentional, matches pre-commit semantics so it can be used as a CI gate). Section rewritten to say so..gitignorescope: only the root.gitignoreof the supplied path is read; nested.gitignorefiles in subdirectories are not. README now states this. Also adds.uv-cacheand binary files to the "always ignored" list, both of which the code already handles but the README didn't mention.pre-commit/pre-commit-hooks(MIT, same license).No behavior change beyond the one-line stdout fix.
Test plan
just lint— ruff format / check / ty all pass.just test— 4/4 pass, 100% coverage.eof-fixer .on a temp dir with three files needing newlines; verify three separateFixing X.txtlines and exit code1.🤖 Generated with Claude Code