Skip to content

chore: enforce LF line endings via .gitattributes#44

Merged
devantler merged 1 commit into
mainfrom
claude/gitattributes-eol
Jun 25, 2026
Merged

chore: enforce LF line endings via .gitattributes#44
devantler merged 1 commit into
mainfrom
claude/gitattributes-eol

Conversation

@devantler

Copy link
Copy Markdown
Contributor

🤖 Generated by the Daily AI Assistant

What

Add a .gitattributes with * text=auto eol=lf to the platform-template scaffold.

Why

The repo's .editorconfig already declares end_of_line = lf, but EditorConfig is only an editor hint — it does not normalize line endings in Git. Without a .gitattributes:

  • a contributor whose Git has core.autocrlf=true (the Windows default) can still commit CRLF despite the EditorConfig, and
  • because this is a template, every instance scaffolded from it inherits the un-enforced line endings.

* text=auto eol=lf makes 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

  • Churn-free. Every one of the 404 tracked files is already LF (git ls-files --eol → 402 i/lf + 2 i/none; zero CRLF). After adding the file, git add --renormalize . stages only .gitattributes — no existing content changes.
  • Behaviour-preserving. No workflow, manifest, or script is touched; validate-scaffold.yaml (ksail workload validate) is unaffected.
  • text=auto leaves 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, and gitops-tenant-template also lack a .gitattributes while carrying the same end_of_line = lf EditorConfig. 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.

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>
@devantler devantler marked this pull request as ready for review June 25, 2026 10:02
@devantler devantler requested a review from a team as a code owner June 25, 2026 10:02
@devantler devantler merged commit beff98c into main Jun 25, 2026
11 checks passed
@devantler devantler deleted the claude/gitattributes-eol branch June 25, 2026 10:13
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