|
1 | | -# Default: normalize line endings to LF on commit, leave the working copy alone. |
| 1 | +# Canonical eco-wide .gitattributes template (.shared-templates/gitattributes.tmpl). |
| 2 | +# Auto-detect text files and normalise line endings to LF. |
| 3 | + |
2 | 4 | * text=auto eol=lf |
3 | 5 |
|
4 | | -# Explicitly LF for source, scripts, and config — never CRLF. |
5 | | -*.py text eol=lf |
6 | | -*.md text eol=lf |
7 | | -*.yml text eol=lf |
8 | | -*.yaml text eol=lf |
9 | | -*.json text eol=lf |
10 | | -*.toml text eol=lf |
11 | | -*.cfg text eol=lf |
12 | | -*.ini text eol=lf |
| 6 | +# --- Source code ----------------------------------------------------------- |
| 7 | +*.go text eol=lf diff=golang |
| 8 | +*.py text eol=lf diff=python |
| 9 | +*.ts text eol=lf |
| 10 | +*.tsx text eol=lf |
| 11 | +*.js text eol=lf |
| 12 | +*.jsx text eol=lf |
| 13 | +*.mjs text eol=lf |
| 14 | +*.cjs text eol=lf |
| 15 | +*.rs text eol=lf diff=rust |
| 16 | + |
| 17 | +# --- Shell + config -------------------------------------------------------- |
13 | 18 | *.sh text eol=lf |
14 | | -Makefile text eol=lf |
| 19 | +*.bash text eol=lf |
| 20 | +*.toml text eol=lf |
| 21 | +*.yaml text eol=lf |
| 22 | +*.yml text eol=lf |
| 23 | +*.json text eol=lf linguist-language=JSON |
| 24 | +*.jsonc text eol=lf linguist-language=JSON |
| 25 | +*.cff text eol=lf |
| 26 | + |
| 27 | +# --- Documentation --------------------------------------------------------- |
| 28 | +*.md text eol=lf diff=markdown |
| 29 | +*.txt text eol=lf |
| 30 | + |
| 31 | +# --- Build / packaging ---------------------------------------------------- |
| 32 | +Makefile text eol=lf |
| 33 | +*.mk text eol=lf |
| 34 | +Dockerfile* text eol=lf |
| 35 | +docker-compose*.yml text eol=lf |
| 36 | +.github/**/*.yml text eol=lf |
| 37 | +.github/**/*.yaml text eol=lf |
15 | 38 |
|
16 | | -# Windows-only files keep CRLF. |
17 | | -*.bat text eol=crlf |
18 | | -*.cmd text eol=crlf |
19 | | -*.ps1 text eol=crlf |
| 39 | +# --- Generated artefacts (mark as such for diffs and language stats) ------ |
| 40 | +go.mod text eol=lf linguist-generated |
| 41 | +go.sum text eol=lf linguist-generated |
| 42 | +*.pb.go linguist-generated |
| 43 | +*_generated.go linguist-generated |
| 44 | +package-lock.json linguist-generated |
| 45 | +pnpm-lock.yaml linguist-generated |
| 46 | +yarn.lock linguist-generated |
20 | 47 |
|
21 | | -# Binary files — never diffed, never EOL-normalized. |
| 48 | +# --- Vendored / external sources ------------------------------------------ |
| 49 | +vendor/** linguist-vendored |
| 50 | +node_modules/** linguist-vendored |
| 51 | +testdata/** linguist-vendored |
| 52 | +benchmarks/data/** linguist-vendored |
| 53 | + |
| 54 | +# --- Binary files (do not text-normalise) --------------------------------- |
| 55 | +*.exe binary |
| 56 | +*.dll binary |
| 57 | +*.so binary |
| 58 | +*.dylib binary |
| 59 | +*.a binary |
| 60 | +*.o binary |
| 61 | +*.db binary |
| 62 | +*.sqlite binary |
22 | 63 | *.png binary |
23 | 64 | *.jpg binary |
24 | 65 | *.jpeg binary |
25 | 66 | *.gif binary |
26 | 67 | *.ico binary |
| 68 | +*.svg text eol=lf |
| 69 | +*.pdf binary |
27 | 70 | *.zip binary |
28 | | -*.tar binary |
29 | 71 | *.tar.gz binary |
30 | | -*.gz binary |
31 | | -*.pdf binary |
| 72 | +*.tgz binary |
32 | 73 | *.whl binary |
33 | 74 |
|
34 | | -# Generated / lock files — collapse in PR diffs (GitHub linguist hint). |
35 | | -poetry.lock linguist-generated=true |
36 | | -Pipfile.lock linguist-generated=true |
37 | | -uv.lock linguist-generated=true |
38 | | -requirements*.txt linguist-generated=true |
| 75 | +# --- Source archive hygiene (excluded from `git archive`) ----------------- |
| 76 | +.github export-ignore |
| 77 | +.shared-templates export-ignore |
| 78 | +.gitattributes export-ignore |
| 79 | +.gitignore export-ignore |
| 80 | +.editorconfig export-ignore |
| 81 | +.golangci.yml export-ignore |
| 82 | +.goreleaser.yml export-ignore |
| 83 | +.goreleaser.yaml export-ignore |
| 84 | +testdata/ export-ignore |
| 85 | +benchmarks/ export-ignore |
| 86 | +e2e/ export-ignore |
0 commit comments