[PR #5617] [MERGED] fix: check out LF working trees on Windows so pnpm check matches CI #6849

Closed
opened 2026-10-23 04:14:17 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5617
Author: @kolacheee
Created: 8/29/2026
Status: ✅ Merged
Merged: 8/29/2026
Merged by: @kolacheee

Base: staging ← Head: fix/5598-windows-lf-checkouts


📝 Commits (1)

  • 43b55ed fix: check out LF working trees on Windows so pnpm check matches CI

📊 Changes

3 files changed (+18 additions, -3 deletions)

View changed files

📝 .gitattributes (+8 -2)
📝 .prettierrc (+2 -1)
📝 CONTRIBUTING.md (+8 -0)

📄 Description

Closes #5598.

Why

On every normal Windows clone, pnpm check — the baseline validation command CONTRIBUTING and CLAUDE.md tell every contributor to run — failed at the Prettier step with ~1,300 "unformatted" files on a completely clean tree. Nothing was unformatted: .gitattributes had * text=auto (stored LF, converted on checkout), Git for Windows defaults to core.autocrlf=true (so working trees became CRLF), and Prettier's endOfLine default is lf (so every CRLF line was a violation). CI runs on ubuntu-latest and never sees it — green in CI, red on every Windows machine, which trains Windows contributors to ignore the baseline gate. The same CRLF working tree also broke the regression lanes that match file contents against LF patterns or hash file bytes (android-local-auth, maintenance-lifecycle, release-tag-version, runtime-integrity, tracker-gallery-ui, and the pnpm-runner launcher lane).

What changed

Three files, no code:

  • .gitattributes: * text=auto → * text=auto eol=lf. The in-tree eol attribute overrides core.autocrlf, so Windows working trees check out LF with no contributor configuration. Every tracked text file is already committed LF (git ls-files --eol shows zero i/crlf / i/mixed), so this changes checkout behavior only — no content renormalization, no diff on any tracked file. The *.bat text eol=crlf exception is unchanged and still wins (last match). The two existing per-path eol=lf lines are kept: they force text outright rather than relying on auto-detection.
  • .prettierrc: "endOfLine": "lf" added explicitly. This is Prettier's existing default — zero behavior change — but the LF contract is now stated in both places instead of resting on an implicit default.
  • CONTRIBUTING.md § Validation: a Windows note documenting the rule and the one-time refresh a pre-existing clone needs (git rm -r --cached . -q && git reset --hard, clean tree first). Fresh clones need nothing. Not under docs/, so no docs-i18n mirror is triggered.

win/launcher/build.ps1 (the only .ps1) stays under the LF default — it is committed LF and PowerShell parses LF scripts fine.

Verification (fresh simulated Windows clone)

On the machine that reproduces #5598 (Windows 11, Git for Windows), cloned this branch into a temp dir with git clone -c core.autocrlf=true — exactly what a new Windows contributor gets:

  • git ls-files --eol: 1,846 text files w/lf, exactly the 3 .bat files w/crlf, 163 binary — the attribute overrides autocrlf as documented.
  • git status immediately after clone: clean (no phantom-dirty files, the classic .gitattributes pitfall — avoided here because nothing needed renormalizing).
  • In the clone: pnpm install, then pnpm format:check passes, the six formerly CRLF-broken regression lanes pass, and full pnpm check passes — results pasted in a comment below.
  • Linux CI is untouched: its checkouts were already LF, so eol=lf is a no-op there.

Manual verification

  • After merging, refresh your own clone once (clean tree first): git rm -r --cached . -q && git reset --hard, then confirm pnpm check passes on Windows with no real changes
  • Confirm start.bat / start-local.bat / the installer batch file still run (they stay CRLF via the existing exception)

Summary by CodeRabbit

  • Documentation
    • Added Windows-specific guidance for resolving line-ending issues in existing checkouts.
  • Chores
    • Standardized files to use LF line endings across platforms.
    • Configured formatting tools to enforce LF endings.
    • Preserved CRLF endings for Windows batch files.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/5617 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 8/29/2026 **Status:** ✅ Merged **Merged:** 8/29/2026 **Merged by:** [@kolacheee](https://github.com/kolacheee) **Base:** `staging` ← **Head:** `fix/5598-windows-lf-checkouts` --- ### 📝 Commits (1) - [`43b55ed`](https://github.com/Pasta-Devs/Marinara-Engine/commit/43b55eda7b25e29f5cd70d0541e26faf6628cce7) fix: check out LF working trees on Windows so pnpm check matches CI ### 📊 Changes **3 files changed** (+18 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `.gitattributes` (+8 -2) 📝 `.prettierrc` (+2 -1) 📝 `CONTRIBUTING.md` (+8 -0) </details> ### 📄 Description Closes #5598. ## Why On every normal Windows clone, `pnpm check` — the baseline validation command CONTRIBUTING and CLAUDE.md tell every contributor to run — failed at the Prettier step with ~1,300 "unformatted" files on a completely clean tree. Nothing was unformatted: `.gitattributes` had `* text=auto` (stored LF, converted on checkout), Git for Windows defaults to `core.autocrlf=true` (so working trees became CRLF), and Prettier's `endOfLine` default is `lf` (so every CRLF line was a violation). CI runs on `ubuntu-latest` and never sees it — green in CI, red on every Windows machine, which trains Windows contributors to ignore the baseline gate. The same CRLF working tree also broke the regression lanes that match file contents against LF patterns or hash file bytes (`android-local-auth`, `maintenance-lifecycle`, `release-tag-version`, `runtime-integrity`, `tracker-gallery-ui`, and the `pnpm-runner` launcher lane). ## What changed Three files, no code: - **`.gitattributes`**: `* text=auto` → `* text=auto eol=lf`. The in-tree `eol` attribute overrides `core.autocrlf`, so Windows working trees check out LF with **no contributor configuration**. Every tracked text file is already committed LF (`git ls-files --eol` shows zero `i/crlf` / `i/mixed`), so this changes checkout behavior only — no content renormalization, no diff on any tracked file. The `*.bat text eol=crlf` exception is unchanged and still wins (last match). The two existing per-path `eol=lf` lines are kept: they force `text` outright rather than relying on auto-detection. - **`.prettierrc`**: `"endOfLine": "lf"` added explicitly. This is Prettier's existing default — zero behavior change — but the LF contract is now stated in both places instead of resting on an implicit default. - **`CONTRIBUTING.md § Validation`**: a Windows note documenting the rule and the one-time refresh a pre-existing clone needs (`git rm -r --cached . -q && git reset --hard`, clean tree first). Fresh clones need nothing. Not under `docs/`, so no docs-i18n mirror is triggered. `win/launcher/build.ps1` (the only `.ps1`) stays under the LF default — it is committed LF and PowerShell parses LF scripts fine. ## Verification (fresh simulated Windows clone) On the machine that reproduces #5598 (Windows 11, Git for Windows), cloned this branch into a temp dir with `git clone -c core.autocrlf=true` — exactly what a new Windows contributor gets: - `git ls-files --eol`: 1,846 text files `w/lf`, exactly the 3 `.bat` files `w/crlf`, 163 binary — the attribute overrides `autocrlf` as documented. - `git status` immediately after clone: clean (no phantom-dirty files, the classic `.gitattributes` pitfall — avoided here because nothing needed renormalizing). - In the clone: `pnpm install`, then `pnpm format:check` passes, the six formerly CRLF-broken regression lanes pass, and full `pnpm check` passes — results pasted in a comment below. - Linux CI is untouched: its checkouts were already LF, so `eol=lf` is a no-op there. ## Manual verification - [ ] After merging, refresh your own clone once (clean tree first): `git rm -r --cached . -q && git reset --hard`, then confirm `pnpm check` passes on Windows with no real changes - [ ] Confirm `start.bat` / `start-local.bat` / the installer batch file still run (they stay CRLF via the existing exception) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Added Windows-specific guidance for resolving line-ending issues in existing checkouts. * **Chores** * Standardized files to use LF line endings across platforms. * Configured formatting tools to enforce LF endings. * Preserved CRLF endings for Windows batch files. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:14:17 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#6849
No description provided.