chore: LF line endings everywhere - #27
Merged
Merged
Conversation
The fragments come verbatim from a multi-line raw string literal, so their newlines are the source file's bytes, not the host's. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The script covers style and member ordering too, not only formatting of C# files. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
.gitattributes loses its per-type pins, so a new file type needs no decision, and the explicit eol= overrides whatever core.autocrlf a contributor has. The lint job now fails if a file is stored otherwise. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
InterpolatedSqlStatement.ToString builds its output with AppendLine and ReplaceLineEndings, so it is host-native. The expected raw string literal is now always LF, which no longer matches on Windows. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
7 tasks
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Closes #26.
Every text file is now LF, in the repository and in the working tree, on every OS. The repository has no
batch files, so there is no exception.
Commits
test: expect LF in SQL fragment assertions— seven assertions compared an SQL fragment takenverbatim from a multi-line raw string literal against
Environment.NewLine. C# does not normalizenewlines inside literals, so a literal's value is the file's bytes. That only matched while
.cschecked out platform-native. With LF everywhere the expected value is a plain LF escape. Without this
the tests fail on Windows while CI, which runs them on Linux, stays green.
chore: rename tidy-cs.ps1 to tidy-code.ps1— the script covers more than C#. All references updated.chore: store every text file as LF—.gitattributesreduced to* text=auto eol=lfplus thebinary list;
.editorconfigsetsend_of_line = lf; CI gains a renormalization guard;CONTRIBUTING.mddocuments the policy.test: normalize the expected ToString output to the host newline— InterpolatedSqlStatement.ToString builds its output with AppendLine and ReplaceLineEndings, so it is host-native. The expected raw string literal is now always LF, which no longer matches on Windows.git add --renormalize .was a no-op — the index was already all-LF — so there is no renormalizationcommit and no new
.git-blame-ignore-revsentry.Why
The per-type table needed a decision for every new file type, and the types nobody listed silently got
whatever each contributor's
core.autocrlfproduced..cschecked out CRLF on Windows and LF on Linux,so byte-level tooling saw different bytes per OS. The explicit
eol=now overridescore.autocrlfandcore.eol, so contributors need no git configuration at all.scripts/tidy-code.ps1needed no change for this: it runs CSharpier last, and CSharpier honoursend_of_line = lf, so any file left as CRLF by another tool is rewritten to LF automatically.For contributors
core.autocrlfno longer matters.command discards uncommitted work:
git rm -r --cached . -q git reset --hardgit statusshows the file as modified whilegit diffstays empty. Runpwsh -File scripts/tidy-code.ps1, orgit checkout -- <path>.core.safecrlf=true(not a default)git addrefuses such a file; run the tidy script, or setcore.safecrlf warn.git merge -X renormalize.Verification
dotnet testpasses on Windows and on Linux.lintgreen, including the new renormalization guard.git ls-files --eolshows noi/crlfori/mixedentries.tidy-cs.ps1remains.