Repository navigation
Expand file tree
/
Copy path.gitattributes
More file actions
62 lines (55 loc) · 2.67 KB
/
Copy path.gitattributes
File metadata and controls
62 lines (55 loc) · 2.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Force LF line endings on files where CRLF causes real defects:
#
# 1. Files baked into a Linux container via Dockerfile COPY —
# shell-script shebangs like `#!/bin/sh\r` make the kernel
# report "exec: no such file or directory", and `\r` in
# Dockerfile RUN lines breaks busybox.
#
# 2. Files checked by Prettier `pnpm format:check` — Prettier 3
# defaults to `endOfLine: lf`, so any CRLF on a Windows
# working tree shows as a false-positive formatting failure.
# `git ls-files --eol` shows these are stored LF in the index
# already; the problem is purely Windows working-tree
# conversion via `core.autocrlf=true`. CI is Linux + LF, so
# this is a Windows-only paper cut — a fresh clone reports
# thousands of files as "needing reformatting" when nothing
# is actually wrong with them.
#
# `text=auto` keeps the default of "git decides per-file using its
# heuristics"; the explicit patterns below are surgical overrides.
* text=auto
# Shell scripts MUST be LF — they're run inside Linux containers /
# on Linux/macOS hosts and the shebang line breaks with CRLF.
*.sh text eol=lf
*.bash text eol=lf
# Dockerfiles — RUN commands evaluated by `/bin/sh` inside the build
# container choke on \r the same way shebangs do.
Dockerfile text eol=lf
*.dockerfile text eol=lf
# YAML used by Docker Compose and Kubernetes is parsed by Go YAML
# libraries that accept either, but keeping it LF avoids needless
# diff noise when someone on Linux re-saves a file edited on Windows.
*.yml text eol=lf
*.yaml text eol=lf
# Files in the `pnpm format:check` glob — Prettier 3 defaults to
# `endOfLine: lf` and rejects CRLF. Without these rules, Windows
# devs running `pnpm format:check` locally hit thousands of false-
# positive "needs reformatting" warnings purely from autocrlf
# conversion (3360 files on the develop tip as of 2026-05-18,
# breakdown: 1966 .ts, 905 .md, 320 .tsx, 161 .json, 7 .css, 1 other).
# CI is Linux + LF and passes, so the local results mislead. Force
# LF in the working tree on every OS to make local match CI.
*.ts text eol=lf
*.tsx text eol=lf
*.jsx text eol=lf
*.json text eol=lf
*.md text eol=lf
*.css text eol=lf
# Node scripts with a `#!/usr/bin/env node` shebang. The help-catalog
# generator is also imported by Vitest specs, and a CRLF shebang line is a
# syntax error for the module transformer on a Windows working tree.
apps/web/scripts/*.mjs text eol=lf
# PowerShell scripts stay CRLF — that's the Windows native
# convention and Windows PowerShell tolerates either, but PS 5.1
# occasionally gets confused by LF-only here-strings.
*.ps1 text eol=crlf