Skip to content

chore: pin .cs line endings to LF for deterministic formatting - #99

Merged
mcpolo99 merged 1 commit into
developfrom
chore/fix-symbolmap-test-whitespace
Jul 4, 2026
Merged

chore: pin .cs line endings to LF for deterministic formatting#99
mcpolo99 merged 1 commit into
developfrom
chore/fix-symbolmap-test-whitespace

Conversation

@mcpolo99

@mcpolo99 mcpolo99 commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Problem

dotnet format has no end_of_line setting in .editorconfig, so it falls back to the OS default — CRLF on Windows, LF on Linux. Combined with .gitattributes '*.cs text' (native eol on checkout), local dotnet format --verify results depend on each contributor's core.autocrlf:

  • CI (windows-2025, autocrlf=true) checks out CRLF → passes (green today).
  • A contributor with core.autocrlf=input checks out LF → dotnet format wants CRLF → spurious whitespace failures (e.g. SymbolMapReuseTest.cs in local-ci).

There is no actual whitespace defect in any file — it's purely nondeterministic line-ending handling.

Fix

Pin .cs to LF on both sides so formatting is deterministic on every platform:

  • .editorconfig: end_of_line = lf under [*.{cs,vb}]
  • .gitattributes: *.cs text eol=lf

Blobs are already LF (git add --renormalize was a no-op), so this changes no file content — only how .cs is checked out and what dotnet format expects. VS project files remain eol=crlf as before.

Verification

bash scripts/local-ci.sh lint → Whitespace OK, Style OK, Analyzers OK on core.autocrlf=input (previously failed).

dotnet format has no end_of_line setting in .editorconfig, so it fell
back to the OS default (CRLF on Windows, LF on Linux). Combined with
.gitattributes '*.cs text' (native eol on checkout), local 'dotnet
format --verify' results depended on each contributor's core.autocrlf,
producing spurious whitespace failures on autocrlf=input machines while
CI (Windows, autocrlf=true) stayed green.

Pin .cs to LF in both .editorconfig (end_of_line = lf) and .gitattributes
(*.cs text eol=lf) so formatting is deterministic on every platform.
Blobs are already LF, so this is a no-op for file content.
@mcpolo99
mcpolo99 merged commit 847a5b6 into develop Jul 4, 2026
3 checks passed
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