Repository navigation
chore: add .gitattributes enforcing LF line endings - #594
Merged
Merged
Conversation
Git on the windows-latest CI runner has core.autocrlf=true, so without a .gitattributes it checks text files out with CRLF. Byte-exact golden comparisons and content-hashed fixtures then pass on macOS/Linux and fail only on Windows: PR #588 hit this with pkg/sql/ast/testdata/visit_order.golden, and the #548 tokenizer golden corpus hashes 40 corpus .sql files. Set `* text=auto eol=lf` repo-wide, pin Go sources, module files, fixtures and shell scripts to LF explicitly, and mark image/font/wasm/archive assets binary. No tracked file currently has CRLF endings (`git ls-files --eol` reports none) and the repo has no Windows scripts, so `git add --renormalize .` changes nothing. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UZSk1292jPc8ipDboNxeve
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Claude finished @ajitpratap0's task in 13s —— View job Review of PR #594:
|
22 tasks
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Git on the
windows-latestCI runner hascore.autocrlf=true, so without a.gitattributesit checks text files out with CRLF. Any test that compares a checked-in fixture byte-for-byte, or hashes fixture contents, then passes on macOS/Linux and fails only on Windows. PR #588 hit this withpkg/sql/ast/testdata/visit_order.golden, and the tokenizer golden corpus coming in the #548 PR hashes 40 corpus.sqlfiles.This adds a repo-wide policy:
* text=auto eol=lf: every file git detects as text is checked out and committed with LF on every platform..go,go.mod/go.sum,.golden,.sql,.jsonand.sh.binaryfor images, fonts,.wasm,.pdfand archives so they are never converted.The two PRs above also normalize CRLF on the test side; that stays as belt and braces for anyone cloning with an unusual local config.
Test Plan
git ls-files --eolonmainreports no tracked file with CRLF or mixed endings, and there are no.bat/.cmd/.ps1files, sogit add --renormalize .with this file in place changes nothing (verified: zero files staged besides.gitattributes).git check-attr text eol -- <golden> <corpus .sql> <.go>resolves totext: set,eol: lf;.png/.icoresolve to binary.Breaking Changes
None. Contributors on Windows who already have CRLF working copies may see git report those files as modified until they re-checkout (
git rm --cached -r . && git reset --hard); committed content is unaffected.🤖 Generated with Claude Code
https://claude.ai/code/session_01UZSk1292jPc8ipDboNxeve