chore: normalize line endings to LF everywhere#43
Closed
P4suta wants to merge 1 commit into
Closed
Conversation
The repo checked C#/MSBuild/XAML out as CRLF while CI shell and YAML had to stay LF, with .editorconfig's `end_of_line = crlf` as the gate. That split is a Windows-only convention and it cost more than it bought: every tool that emits LF fought the format gate, and tests/Snaply.Tests/Snaply.Tests.csproj had reached the blob with CRLF, so it showed as modified in every clone and `git checkout --` could not clear it. Collapse .gitattributes to a single `* text=auto eol=lf`, flip .editorconfig to `end_of_line = lf`, and renormalize. Only the one csproj blob actually changed — the rest were already LF in the blob and merely checked out as CRLF. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jul 24, 2026
Owner
Author
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.
Why
The repo checked C#/MSBuild/XAML out as CRLF while CI shell and YAML had to stay LF, with
.editorconfig'send_of_line = crlfas the gate. That split is a Windows-only convention, and it cost more than it bought:dotnet formatgate;.gitattributesalready needed a "CI must stay LF" carve-out, i.e. the rule could not be applied uniformly;tests/Snaply.Tests/Snaply.Tests.csprojhad reached the blob with CRLF (git ls-files --eol→i/crlf), so it showed as modified in every clone, permanently, andgit checkout --could not clear it — onlygit add --renormalizecan.LF-in-the-repo is the cross-platform default (git stores LF regardless), so this drops the exception list rather than extending it.
What
.gitattributes: collapse the per-extension CRLF/LF rules to a single* text=auto eol=lf, keeping the binary rules..editorconfig:end_of_line = crlf→lf.git add --renormalize .Only the one csproj blob actually changed — every other file was already LF in the blob and merely checked out as CRLF. The working tree is now LF too, so
dotnet formatsees what git stores.Verification
Run locally on Windows 11 / SDK 10.0.301:
dotnet format Snaply.slnx --verify-no-changes --no-restore(withConfiguration=Release, as CI does) → exit 0dotnet test tests/Snaply.Tests/Snaply.Tests.csproj -c Release→ 65 passed, 0 skippeddotnet test tests/Snaply.App.Tests/Snaply.App.Tests.csproj -c Release→ 3 passed, 0 skippedgit ls-files --eol→ noi/crlfand now/crlfentries remaingit statusclean;git diffreports no content change (the change is line endings only)🤖 Generated with Claude Code