Skip to content

feat(detector): detect missing CRLF-safe .gitattributes (line-ending drift) - #1

Merged
yunaremaia merged 1 commit into
mainfrom
feat/lineending-drift
Aug 30, 2026
Merged

feat(detector): detect missing CRLF-safe .gitattributes (line-ending drift)#1
yunaremaia merged 1 commit into
mainfrom
feat/lineending-drift

Conversation

@yunaremaia

Copy link
Copy Markdown
Owner

Summary

Adds a line-ending drift check to driftcheck. A repo that ships text source but lacks * text=auto eol=lf in .gitattributes silently checks out CRLF working-tree bytes on Windows (core.autocrlf=true) while the index stores LF — breaking byte-exact checks. driftcheck --fix now appends the rule (or creates the file).

This is the exact pattern applied across the archify/gods-eye-view CRLF PRs; driftcheck can now catch it before contributors hit a build failure, same as it does for Rust/Node/Python/Go version drift.

Changes

  • find_lineending_drift(root) scans .gitattributes
  • scan_repo() reports lineending_drifts
  • apply_fixes() creates/appends * text=auto eol=lf
  • 3 new tests (detect / fix / no-false-positive)
  • README bumped to v0.1.5

Verification

python3 -m pytest tests/ -q → 21 passed.

…drift)

Adds a line-ending drift check: a repo that ships text source but lacks
`* text=auto eol=lf` in `.gitattributes` silently checks out CRLF working-tree
bytes on Windows (core.autocrlf=true) while the index stores LF, breaking
byte-exact checks. `driftcheck --fix` now appends the rule (or creates the file).

This is the exact pattern applied across the archify/gods-eye-view CRLF PRs;
driftcheck can now catch it before contributors hit a build failure, same as
it does for Rust/Node/Python/Go version drift.

- find_lineending_drift(root) scans .gitattributes
- scan_repo() reports lineending_drifts
- apply_fixes() creates/appends `* text=auto eol=lf`
- 3 new tests (detect, fix, no-false-positive)

Bump Checks to v0.1.5 in README.
@yunaremaia
yunaremaia merged commit 2ea1656 into main Aug 30, 2026
2 checks passed
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