chore: enforce LF line endings via gitattributes, editorconfig, pre-commit

Introduces a three-layer defence against CRLF/LF drift:

- `.gitattributes` normalizes all text files to LF on commit and checkout;
  Windows-native scripts (*.bat, *.cmd, *.ps1) explicitly keep CRLF.
- `.editorconfig` instructs editors (VS Code, JetBrains, vim, etc.) to save
  with LF by default so the problem is prevented at the source.
- `mixed-line-ending --fix=lf` hook in pre-commit catches anything that
  slips through and auto-fixes it before commit.

No file contents are normalized in this commit — that follows in a
separate `git add --renormalize .` commit for easier review.
This commit is contained in:
Eugene Mikhantyev
2026-04-18 15:20:20 +01:00
parent 03bafce616
commit 2c35ff40a7
3 changed files with 74 additions and 0 deletions

View File

@@ -4,6 +4,8 @@ repos:
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: mixed-line-ending
args: ["--fix=lf"]
- id: check-yaml
- id: check-json
- id: check-added-large-files