diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000..c58b43bb32 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,20 @@ +# Go tooling (gofmt, golangci-lint) requires LF line endings. +# Without this, core.autocrlf=true on Windows converts to CRLF on checkout, +# causing spurious "not properly formatted" errors — especially in worktrees. +*.go text eol=lf +go.mod text eol=lf +go.sum text eol=lf + +# Go templates and golden test data — template output is LF; +# byte-for-byte golden comparisons break if checked out as CRLF. +*.tmpl text eol=lf +cli/testdata/**/*.yml text eol=lf + +# Shell scripts must use LF (bash can't parse CRLF). +*.sh text eol=lf + +# Dockerfiles run in Linux containers — CRLF breaks shell continuations and heredocs. +Dockerfile text eol=lf + +# PowerShell scripts — Windows expects CRLF. +*.ps1 text eol=crlf