From 27a2bde14f48a9b52ab471ee6338c9aeea5a44bb Mon Sep 17 00:00:00 2001 From: Ajit Pratap Singh Date: Tue, 13 Oct 2026 11:28:39 +0530 Subject: [PATCH] chore: add .gitattributes enforcing LF line endings 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 Claude-Session: https://claude.ai/code/session_01UZSk1292jPc8ipDboNxeve --- .gitattributes | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..2d03a59bf --- /dev/null +++ b/.gitattributes @@ -0,0 +1,36 @@ +# Line-ending policy. +# +# Check out and commit every text file with LF on every platform. Without +# this, git on the windows-latest CI runner (core.autocrlf=true) converts +# text files to CRLF on checkout, so byte-exact golden comparisons and +# content-hashed fixtures pass on macOS/Linux and fail only on Windows +# (seen on PR #588 and the #548 golden corpus). +* text=auto eol=lf + +# Go sources and module files are always LF; gofmt expects it. +*.go text eol=lf +go.mod text eol=lf +go.sum text eol=lf + +# Test fixtures that are compared or hashed byte-for-byte. +*.golden text eol=lf +*.sql text eol=lf +*.json text eol=lf + +# Shell scripts must stay LF to be executable on Unix. +*.sh text eol=lf + +# Binary assets: never convert. +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.ico binary +*.woff binary +*.woff2 binary +*.ttf binary +*.otf binary +*.wasm binary +*.pdf binary +*.zip binary +*.gz binary