Skip to content

chore: normalize line endings to LF via .gitattributes#841

Merged
jrusso1020 merged 1 commit into
mainfrom
chore/gitattributes-normalize-line-endings
May 14, 2026
Merged

chore: normalize line endings to LF via .gitattributes#841
jrusso1020 merged 1 commit into
mainfrom
chore/gitattributes-normalize-line-endings

Conversation

@jrusso1020
Copy link
Copy Markdown
Collaborator

Summary

  • Add * text=auto eol=lf to .gitattributes so text files are checked in with LF regardless of the contributor's OS.

Why

On #840, a TypeScript file landed in the PR saved as UTF-8-with-BOM + CRLF, while main has it as UTF-8 + LF. Every line then differed at the byte level even though the actual code change was ~30 lines, which tripped GitHub's "Binary file not shown" diff heuristic and made the PR unreviewable.

.editorconfig already declares end_of_line = lf and charset = utf-8, but that's a hint to editors — Git doesn't enforce it. Adding the rule at the .gitattributes layer means Git itself normalizes on checkin, so this class of mistake can't reach a PR diff again.

Existing LFS rules (packages/producer/tests/.../*.mp4, .png) already carry -text and remain unaffected by the new top-level rule.

Test plan

  • CI green
  • After merge, contributors with core.autocrlf=true on Windows will have CRLF in their working tree but the repo will still store LF — confirm by inspecting a freshly-cloned .gitattributes-aware checkout (git ls-files --eol)

🤖 Generated with Claude Code

Add `* text=auto eol=lf` so text files are checked in with LF regardless
of the contributor's OS. Without this, Windows editors can save files
with CRLF (and sometimes a UTF-8 BOM), which makes every line differ at
the byte level on diff and trips GitHub's "Binary file not shown"
heuristic — see #840 for an example where a ~30-line change was
unreviewable for this reason.

Existing LFS rules already carry `-text` and remain unaffected.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jrusso1020 jrusso1020 merged commit 46ef31f into main May 14, 2026
28 checks passed
@jrusso1020 jrusso1020 deleted the chore/gitattributes-normalize-line-endings branch May 14, 2026 17:45
@philippaz272006-commits
Copy link
Copy Markdown

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.

3 participants