[PR #1638] [MERGED] Enforce repository line endings #5170

Closed
opened 2026-10-22 04:13:54 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1638
Author: @Xelvanis
Created: 5/30/2026
Status: ✅ Merged
Merged: 5/30/2026
Merged by: @Xelvanis

Base: refactor ← Head: chore/normalize-line-endings


📝 Commits (2)

  • 23ae2c2 chore: enforce repository line endings
  • 3f2e292 fix: reject CRLF in LF-normalized worktrees

📊 Changes

5 files changed (+84 additions, -1 deletions)

View changed files

➕ .editorconfig (+9 -0)
➕ .gitattributes (+15 -0)
📝 .github/workflows/ci.yml (+1 -0)
📝 package.json (+2 -1)
➕ scripts/check-line-endings.mjs (+57 -0)

📄 Description

Linked issue

No linked issue; maintenance-only repository hygiene.

Why this change

  • Prevent platform-specific LF/CRLF churn from Windows, macOS, and Linux checkouts.
  • Make Git the source of truth for repository line endings instead of relying on each contributor's local core.autocrlf setting.
  • Give CI a focused guard for accidental CRLF or mixed line-ending regressions.

What changed

  • Added .gitattributes with LF normalization by default, CRLF exemptions for .bat/.cmd, and binary file patterns.
  • Added .editorconfig so editors save normal source/config/docs files with LF.
  • Added scripts/check-line-endings.mjs to inspect tracked files through git ls-files --eol.
  • Wired pnpm check:line-endings into pnpm check and the frontend CI job.

Refactor impact

Primary owner:

Repository maintenance / CI tooling.

Impact areas reviewed:

  • Git attributes and editor configuration.
  • Package scripts.
  • GitHub Actions frontend job.
  • Existing Prettier endOfLine: "lf" setting.

Boundary notes:

  • No product runtime code touched.
  • No src/engine, src/features, src/shared/api, or src-tauri behavior changed.

Pressure points touched:

  • None; no ModeSurface, GameSurface, shared mode UI, Tauri command registration, or import modules touched.

Validation

  • pnpm check passes locally
  • pnpm typecheck passes locally
  • pnpm build passes locally
  • pnpm check:architecture passes locally
  • pnpm check:docs passes locally
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace passes locally
  • Rust clippy/tests were run for Rust behavior changes
  • Browser or Tauri app manual verification completed
  • Playwright, screenshot, or recording evidence added for UI changes
  • Remote runtime smoke checked when relevant

Manual verification notes

  • pnpm check:line-endings passed: 1253 tracked files checked.
  • pnpm exec prettier --check --ignore-unknown .editorconfig .gitattributes .github/workflows/ci.yml package.json scripts/check-line-endings.mjs passed.
  • pnpm check:docs passed: 40 docs and repo guidance files checked.
  • git diff origin/refactor...HEAD --check passed.
  • Negative temp-repo check confirmed a CRLF working-tree file under eol=lf fails with exit code 1 and names the offending file.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

No changelog file is present in this branch. This is repository hygiene / CI behavior, not user-facing app behavior.

UI evidence

Not applicable; no visible UI changes.

Summary by CodeRabbit

  • Chores
    • Added line-ending normalization and validation configuration to enforce consistent line endings across the repository.
    • Integrated automated line-ending validation into the continuous integration pipeline to catch inconsistencies.

Review Change Stack


🔄 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/1638 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 5/30/2026 **Status:** ✅ Merged **Merged:** 5/30/2026 **Merged by:** [@Xelvanis](https://github.com/Xelvanis) **Base:** `refactor` ← **Head:** `chore/normalize-line-endings` --- ### 📝 Commits (2) - [`23ae2c2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/23ae2c2072c6feba06939902c93b12d5549815e8) chore: enforce repository line endings - [`3f2e292`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3f2e292b1be84d2f64dd7b438c698ba1731da5b0) fix: reject CRLF in LF-normalized worktrees ### 📊 Changes **5 files changed** (+84 additions, -1 deletions) <details> <summary>View changed files</summary> ➕ `.editorconfig` (+9 -0) ➕ `.gitattributes` (+15 -0) 📝 `.github/workflows/ci.yml` (+1 -0) 📝 `package.json` (+2 -1) ➕ `scripts/check-line-endings.mjs` (+57 -0) </details> ### 📄 Description ## Linked issue No linked issue; maintenance-only repository hygiene. ## Why this change - Prevent platform-specific LF/CRLF churn from Windows, macOS, and Linux checkouts. - Make Git the source of truth for repository line endings instead of relying on each contributor's local `core.autocrlf` setting. - Give CI a focused guard for accidental CRLF or mixed line-ending regressions. ## What changed - Added `.gitattributes` with LF normalization by default, CRLF exemptions for `.bat`/`.cmd`, and binary file patterns. - Added `.editorconfig` so editors save normal source/config/docs files with LF. - Added `scripts/check-line-endings.mjs` to inspect tracked files through `git ls-files --eol`. - Wired `pnpm check:line-endings` into `pnpm check` and the frontend CI job. ## Refactor impact Primary owner: Repository maintenance / CI tooling. Impact areas reviewed: - Git attributes and editor configuration. - Package scripts. - GitHub Actions frontend job. - Existing Prettier `endOfLine: "lf"` setting. Boundary notes: - No product runtime code touched. - No `src/engine`, `src/features`, `src/shared/api`, or `src-tauri` behavior changed. Pressure points touched: - None; no ModeSurface, GameSurface, shared mode UI, Tauri command registration, or import modules touched. ## Validation <!-- Check only what you personally ran or manually verified. Treat unchecked items as explicit TODOs. --> - [ ] `pnpm check` passes locally - [ ] `pnpm typecheck` passes locally - [ ] `pnpm build` passes locally - [ ] `pnpm check:architecture` passes locally - [ ] `pnpm check:docs` passes locally - [ ] `cargo check --manifest-path src-tauri/Cargo.toml --workspace` passes locally - [ ] Rust clippy/tests were run for Rust behavior changes - [ ] Browser or Tauri app manual verification completed - [ ] Playwright, screenshot, or recording evidence added for UI changes - [ ] Remote runtime smoke checked when relevant ### Manual verification notes - `pnpm check:line-endings` passed: 1253 tracked files checked. - `pnpm exec prettier --check --ignore-unknown .editorconfig .gitattributes .github/workflows/ci.yml package.json scripts/check-line-endings.mjs` passed. - `pnpm check:docs` passed: 40 docs and repo guidance files checked. - `git diff origin/refactor...HEAD --check` passed. - Negative temp-repo check confirmed a CRLF working-tree file under `eol=lf` fails with exit code 1 and names the offending file. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [ ] Confirmed this PR does not restore old staging/package-workspace/release claims No changelog file is present in this branch. This is repository hygiene / CI behavior, not user-facing app behavior. ## UI evidence Not applicable; no visible UI changes. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Added line-ending normalization and validation configuration to enforce consistent line endings across the repository. * Integrated automated line-ending validation into the continuous integration pipeline to catch inconsistencies. <!-- review_stack_entry_start --> [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/Pasta-Devs/Marinara-Engine/pull/1638?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- 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-22 04:13:54 +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#5170
No description provided.