Skip to content

0.4.0

Choose a tag to compare

@github-actions github-actions released this 26 Jun 17:59
· 16 commits to main since this release
fa1e8e8

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 .gitignore support. The file walk now honors .gitignore files
    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 — no git invocation, no
    .git/info/exclude, no global core.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 .git and the default .cache / .uv-cache, e.g.
    eof-fixer . --exclude node_modules --exclude dist. .git is 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.py isolates file discovery (iter_text_files)
    behind a clean seam; the EOF-fixing core is unchanged.
  • Built on the existing pathspec dependency — no new runtime dependencies.
  • 100% test coverage maintained; nested precedence/negation/pruning
    cross-checked against real git check-ignore.