Add the global editorconfig CRLF default - #242
Conversation
Set end_of_line = crlf on the [*] block so every file type has a defined ending, matching the fleet template. Per-type CRLF rules and .gitattributes LF pins unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Pieter Viljoen <ptr727@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This pull request standardizes line-ending governance by setting a repository-wide default of end_of_line = crlf in the .editorconfig[*] section, so all file types have an explicit baseline line-ending policy while preserving existing per-pattern overrides (e.g., *.sh and Dockerfiles remain lf).
Changes:
- Add
end_of_line = crlfto the.editorconfigglobal[*]defaults block. - Keep existing per-file-type overrides intact (notably
*.shand Dockerfiles pinned tolf).
The global [*] end_of_line = crlf also matches the extensionless .husky/pre-commit hook (must stay LF) and the downloaded LanguageData/* files (a mix of LF/CRLF that must persist byte-for-byte). Add an LF override for the hook (aligned with .gitattributes) and end_of_line = unset for LanguageData so the editor does not normalize the source data. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Pieter Viljoen <ptr727@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
The [*] defaults (insert_final_newline, trim_trailing_whitespace, charset) still applied to the downloaded LanguageData/* files after only unsetting end_of_line, and any of them can mutate byte-sensitive source data. Unset charset/end_of_line and set insert_final_newline/trim_trailing_whitespace = false so the editor preserves the source bytes exactly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Pieter Viljoen <ptr727@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
Move the LanguageData/* byte-preservation block above the '.NET-only below' separator, alongside the other line-ending rules, instead of at the file end in the .NET-style section. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Pieter Viljoen <ptr727@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
Adopts the hub's current .editorconfig / .gitattributes / .editorconfig-checker.json shape: [*] end_of_line = lf with CRLF pinned only for *.bat/*.cmd (Windows requires it), and git-level text=auto eol=lf normalization to match. This repo's own CRLF default (PR #242) matched the fleet template as it stood in July; the hub has since flipped its own default to LF, and the line-ending policy keeps release repos on the fleet LF default (no operational-repo override applies here). LanguageData/ stays byte-preserved via an explicit .gitattributes pin, since the prior '* -text' repo-wide default no longer covers it. Renormalizes every tracked file's line endings to match (content unchanged, verified with --ignore-cr-at-eol); updates the two docs that described the old CRLF default. Also fixes the five codegen data-file emitters (Iso6392Data, Iso6393Data, Rfc5646Data, UnM49Data, LanguageSchema's JsonSourceGenerationOptions), which hardcoded a CRLF NewLine to match the old default. Left as-is, regenerating any *DataGen.cs or LanguageData/*.json locally would emit CRLF and either fail editorconfig-checker or drift from the codegen-drift CI gate under the new LF default. Regenerates and commits LanguageData/*.json offline (--skip-download) to match, verified content-identical (--ignore-cr-at-eol).
Converges this repo's line-ending policy with the hub (`ptr727/ProjectTemplate`). The hub's `.editorconfig`/`.gitattributes` default flipped from CRLF to LF after this repo's own CRLF default was added (PR #242, matching what the hub carried at the time). The fleet's line-ending policy keeps `release` repos on the fleet LF default; no `operational`-repo override applies here. - `.editorconfig`: `[*] end_of_line = lf`, CRLF pinned only for `*.bat`/`*.cmd` (the one type Windows requires it for). Drops the now-redundant per-type CRLF/LF overrides that existed only to work around the old CRLF default. - `.gitattributes`: `* text=auto eol=lf`, CRLF pinned for `*.bat`/`*.cmd`. `LanguageData/` (downloaded source data the parser reads byte-for-byte) gets an explicit `-text` pin, since the prior repo-wide `* -text` default no longer covers it. - `.editorconfig-checker.json`: carries the hub's added `Exclude` block (inert in this pure-.NET repo). - Renormalizes every tracked file's line endings to match (content unchanged; verified with `git diff --ignore-cr-at-eol` against the parent commit). - Fixes the four codegen data-file emitters (`Iso6392Data`, `Iso6393Data`, `Rfc5646Data`, `UnM49Data`), which hardcoded `StreamWriter NewLine = "\r\n"` to match the old CRLF default. Left as-is, regenerating any `*DataGen.cs` locally would emit CRLF and fail `editorconfig-checker` under the new LF default. - Updates `OPERATIONS.md` and `WORKFLOW.md`, the only two docs that described the old CRLF default. Verified: `dotnet build` and `dotnet test` both clean (310/310 passing), zero content diff outside the five intentionally-edited files. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Standardized repository text files and generated source files to use LF line endings for consistent cross-platform handling. - Preserved CRLF formatting for Windows batch and command scripts. - Normalized structured data formatting without changing its content or behavior. - **Documentation** - Improved formatting and readability across repository documentation without changing its content. - **Chores** - Updated formatting guidance and editor settings while preserving existing project, build, and tool configurations. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Adds
end_of_line = crlfto the.editorconfig[*]block so every file type has a defined ending (matching the fleet template) instead of the per-extension-only form. Per-type CRLF rules and.gitattributesLF pins unchanged.Resolves the recurring line-ending drift from the ProjectTemplate audit (
reports/languagetags/audit.md), via the audit convergence pattern (AUDIT.mdsection 10).🤖 Generated with Claude Code