From 83f03f6a63cc2ec0adffbf3aa7f6866afef1957b Mon Sep 17 00:00:00 2001 From: Yasunobu <42543015+P4suta@users.noreply.github.com> Date: Fri, 24 Jul 2026 10:17:50 +0900 Subject: [PATCH] chore: normalize line endings to LF everywhere MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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, .gitattributes already needed a "CI must stay LF" carve-out, 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) --- .editorconfig | 2 +- .gitattributes | 31 ++++-------- tests/Snaply.Tests/Snaply.Tests.csproj | 70 +++++++++++++------------- 3 files changed, 46 insertions(+), 57 deletions(-) diff --git a/.editorconfig b/.editorconfig index ff2d664..3ab69c4 100644 --- a/.editorconfig +++ b/.editorconfig @@ -2,7 +2,7 @@ root = true [*] charset = utf-8 -end_of_line = crlf +end_of_line = lf indent_style = space insert_final_newline = true trim_trailing_whitespace = true diff --git a/.gitattributes b/.gitattributes index 0c7b15e..2ba0db1 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,24 +1,13 @@ -# Normalize line endings so `dotnet format` (which enforces .editorconfig's -# `end_of_line = crlf`) is consistent on every runner, while keeping the files -# that must stay LF (CI shell / YAML — CRLF breaks bash `run:` blocks on Linux -# runners) as LF. - -* text=auto - -# C# / MSBuild / XAML: CRLF, matching .editorconfig (what `dotnet format` checks). -*.cs text eol=crlf -*.csproj text eol=crlf -*.props text eol=crlf -*.targets text eol=crlf -*.xaml text eol=crlf -*.resw text eol=crlf -*.manifest text eol=crlf -*.slnx text eol=crlf - -# CI must stay LF. -*.yml text eol=lf -*.yaml text eol=lf -*.sh text eol=lf +# Line endings: LF everywhere — in the blob and in the working tree, on every +# platform. Git stores LF regardless, and .editorconfig's `end_of_line = lf` +# (what CI's `dotnet format --verify-no-changes` enforces) matches it, so there +# is exactly one convention to obey. +# +# The repo previously checked C#/MSBuild/XAML out as CRLF while CI shell and YAML +# had to stay LF. That split cost more than it bought: tools that emit LF fought +# the format gate, and a file that reached the blob with CRLF showed as modified +# in every clone forever, which only `git add --renormalize` can clear. +* text=auto eol=lf # Binary assets — never touch. *.png binary diff --git a/tests/Snaply.Tests/Snaply.Tests.csproj b/tests/Snaply.Tests/Snaply.Tests.csproj index 33a52a0..e66c08b 100644 --- a/tests/Snaply.Tests/Snaply.Tests.csproj +++ b/tests/Snaply.Tests/Snaply.Tests.csproj @@ -1,35 +1,35 @@ - - - - net10.0 - enable - enable - false - - - - - - - - - - - - - - - - - - - - - - - - + + + + net10.0 + enable + enable + false + + + + + + + + + + + + + + + + + + + + + + + +