Skip to content

chore: add .gitattributes to normalize line endings to LF#1581

Open
shulaoda wants to merge 1 commit into
cloudflare:mainfrom
shulaoda:05-23-chore_add_.gitattributes_to_normalize_line_endings_to_lf
Open

chore: add .gitattributes to normalize line endings to LF#1581
shulaoda wants to merge 1 commit into
cloudflare:mainfrom
shulaoda:05-23-chore_add_.gitattributes_to_normalize_line_endings_to_lf

Conversation

@shulaoda
Copy link
Copy Markdown

Summary

Add .gitattributes with * text=auto eol=lf so text files are stored and checked out as LF on every platform. text=auto lets Git auto-detect binary files and leave them untouched.

Motivation

A fresh Windows clone (where Git's default is core.autocrlf=true) silently rewrites every text file's LF to CRLF on checkout. oxfmt only accepts LF, so pnpm run check immediately reports ~1400 files as needing formatting and the local toolchain is unusable until the contributor reconfigures Git globally. CI runs on Ubuntu and never sees this, so the issue stays invisible until a Windows contributor hits it.

Pinning eol=lf in .gitattributes overrides core.autocrlf per-repo and makes the working tree match what CI expects, regardless of the contributor's global Git config.

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