chore: enforce LF line endings via .gitattributes#44
Merged
Conversation
The .editorconfig already declares end_of_line = lf, but that is only an editor hint. Without a .gitattributes, a contributor whose Git has core.autocrlf=true could still commit CRLF, and every instance scaffolded from this template would inherit the inconsistency. Add `* text=auto eol=lf` so LF is enforced at the Git level on commit and checkout, regardless of the contributor's platform. Churn-free: all 404 tracked files are already LF (verified via git ls-files --eol), so `git add --renormalize .` stages nothing but the new file — no existing content changes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 25, 2026
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.
What
Add a
.gitattributeswith* text=auto eol=lfto the platform-template scaffold.Why
The repo's
.editorconfigalready declaresend_of_line = lf, but EditorConfig is only an editor hint — it does not normalize line endings in Git. Without a.gitattributes:core.autocrlf=true(the Windows default) can still commit CRLF despite the EditorConfig, and* text=auto eol=lfmakes Git auto-detect text vs. binary and guarantees LF in the repository and on checkout regardless of the contributor's platform — turning the EditorConfig's stated LF intent into something Git actually enforces.Safety / validation
git ls-files --eol→ 402i/lf+ 2i/none; zero CRLF). After adding the file,git add --renormalize .stages only.gitattributes— no existing content changes.validate-scaffold.yaml(ksailworkload validate) is unaffected.text=autoleaves any future binary asset correctly untouched (Git auto-detects it).Holistic note (for the maintainer)
This is a suite-wide gap:
go-template,dotnet-template, andgitops-tenant-templatealso lack a.gitattributeswhile carrying the sameend_of_line = lfEditorConfig. Shipping it here first (rotation target); happy to propagate the same one-line addition to the sibling templates in follow-up PRs if you'd like the whole template suite consistent.