Skip to content

Commit b845f93

Browse files
Copilotjbampton
andauthored
Enforce LF line endings to fix yamllint CRLF failures on Windows (#469)
* Initial plan * Fix yamllint failure on Windows by enforcing LF line endings - Add .gitattributes to enforce LF line endings globally and explicitly for YAML files - Update mixed-line-ending pre-commit hook with --fix=lf to auto-convert CRLF to LF Agent-Logs-Url: https://github.com/NextCommunity/NextCommunity.github.io/sessions/fc11f167-090e-4ef0-ae2b-ec48c570f076 Co-authored-by: jbampton <418747+jbampton@users.noreply.github.com> * Address Gemini review: expand binary file types and add types: [text] to mixed-line-ending hook Agent-Logs-Url: https://github.com/NextCommunity/NextCommunity.github.io/sessions/bab1cbb7-e17e-4e51-9609-c117df8c5f91 Co-authored-by: jbampton <418747+jbampton@users.noreply.github.com> * Update .pre-commit-config.yaml --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jbampton <418747+jbampton@users.noreply.github.com> Co-authored-by: John Bampton <jbampton@users.noreply.github.com>
1 parent 0fe1add commit b845f93

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

.gitattributes

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Enforce LF line endings for all text files to prevent CRLF issues on Windows
2+
* text=auto eol=lf
3+
4+
# Explicitly enforce LF for YAML files (prevents yamllint failures on Windows)
5+
*.yaml text eol=lf
6+
*.yml text eol=lf
7+
8+
# Binary files
9+
*.png binary
10+
*.jpg binary
11+
*.jpeg binary
12+
*.gif binary
13+
*.ico binary
14+
*.webp binary
15+
*.avif binary
16+
*.pdf binary
17+
*.woff binary
18+
*.woff2 binary

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ repos:
106106
- id: mixed-line-ending
107107
name: run mixed-line-ending
108108
description: replaces or checks mixed line ending
109+
args: [--fix=lf]
109110

110111
- repo: https://github.com/biomejs/pre-commit
111112
rev: "v2.4.8"

0 commit comments

Comments
 (0)