0.4.0
eof-fixer 0.4.0 — nested .gitignore, honored
eof-fixer now respects .gitignore files anywhere in the tree, not just the
one at the root, and adds a --exclude flag for extra skip paths. This changes
which files get fixed in repos that use per-directory .gitignore files — see
Why and Downstream below.
Feature
- Nested
.gitignoresupport. The file walk now honors.gitignorefiles
in subdirectories, with full git semantics: per-directory anchoring,
deepest-file-wins precedence,!negations that re-include, and pruning of
ignored directories. It stays pure-filesystem — nogitinvocation, no
.git/info/exclude, no globalcore.excludesFile— so it still works on any
directory, repo or not. --exclude DIR(repeatable). Skip extra file/directory names on top of
the always-skipped.gitand the default.cache/.uv-cache, e.g.
eof-fixer . --exclude node_modules --exclude dist..gitis never
configurable.
Packaging
- Enriched PyPI metadata (keywords, trove classifiers, project URLs) for better
discoverability on the package page.
Why
The headline contract is "respect the .gitignore," but until now only the
root file was read. Any repo placing .gitignore files in subdirectories — the
common monorepo / nested-package layout — had those rules silently ignored, so
the tool rewrote files git (and the user) expected it to leave alone. 0.4.0
closes that gap.
Downstream
No API change — the library/CLI surface is the same apart from the additive
--exclude flag. Behavior change to be aware of: files matched by a
subdirectory .gitignore are now skipped where 0.3.x would have fixed them. If
you relied on the old root-only behavior for a path, add it back explicitly or
adjust the relevant .gitignore. No action needed for the common case (you
almost certainly want those files skipped).
Internals
- New
eof_fixer/discovery.pyisolates file discovery (iter_text_files)
behind a clean seam; the EOF-fixing core is unchanged. - Built on the existing
pathspecdependency — no new runtime dependencies. - 100% test coverage maintained; nested precedence/negation/pruning
cross-checked against realgit check-ignore.