|
| 1 | +# ============================================================ |
| 2 | +# .gitattributes (Keep files consistent across operating systems) |
| 3 | +# ============================================================ |
| 4 | + |
| 5 | +# REQ.UNIVERSAL: All professional GitHub project repositories MUST include .gitattributes. |
| 6 | +# WHY: Ensure consistent line endings, diff behavior, and file classification |
| 7 | +# across Windows, macOS, and Linux environments. |
| 8 | +# ALT: Repository may omit .gitattributes ONLY if equivalent normalization is |
| 9 | +# enforced reliably by tooling and CI (rare and fragile). |
| 10 | +# CUSTOM: Update file-type rules only when introducing new languages, |
| 11 | +# binary artifacts, or documentation formats. |
| 12 | +# NOTE: Rules are ordered by impact and generality, not alphabetically. |
| 13 | +# Git attributes are documented at https://git-scm.com/docs/gitattributes |
| 14 | + |
| 15 | +# === Core defaults (always apply) === |
| 16 | + |
| 17 | +# WHY: Auto-detect text files and normalize line endings to avoid cross-platform drift. |
| 18 | +* text=auto |
| 19 | + |
| 20 | + |
| 21 | +# === Programming languages and scripts === |
| 22 | + |
| 23 | +# WHY: Python and shell scripts must use LF for CI/CD, Linux environments, and containers. |
| 24 | +*.py text eol=lf |
| 25 | +*.sh text eol=lf |
| 26 | + |
| 27 | +# WHY: PowerShell convention on Windows uses CRLF. |
| 28 | +*.ps1 text eol=crlf |
| 29 | + |
| 30 | + |
| 31 | +# === Markup and documentation === |
| 32 | + |
| 33 | +# WHY: Documentation and markup files use LF; standard for cross-platform tooling. |
| 34 | +*.md text eol=lf |
| 35 | +*.tex text eol=lf |
| 36 | +*.sty text eol=lf |
| 37 | +*.cls text eol=lf |
| 38 | +*.bib text eol=lf |
| 39 | + |
| 40 | + |
| 41 | +# === Configuration and structured text === |
| 42 | + |
| 43 | +# WHY: Configuration and structured text formats use LF for stable diffs. |
| 44 | +*.json text eol=lf |
| 45 | +*.jsonc text eol=lf |
| 46 | +*.jsonl text eol=lf |
| 47 | +*.ndjson text eol=lf |
| 48 | +*.toml text eol=lf |
| 49 | +*.yaml text eol=lf |
| 50 | +*.yml text eol=lf |
| 51 | + |
| 52 | + |
| 53 | +# === Proof assistants and formal languages === |
| 54 | + |
| 55 | +# WHY: Lean source files must use LF for cross-platform consistency and CI. |
| 56 | +*.lean text eol=lf |
| 57 | + |
| 58 | +# WHY: Lean build artifacts are binary; prevent normalization and meaningless diffs. |
| 59 | +*.olean binary |
| 60 | +*.ilean binary |
| 61 | +*.trace binary |
| 62 | + |
| 63 | +# WHY: Coq source uses LF; compiled objects are binary. |
| 64 | +*.v text eol=lf |
| 65 | +*.vo binary |
| 66 | +*.vok binary |
| 67 | +*.vos binary |
| 68 | +*.glob binary |
| 69 | + |
| 70 | +# WHY: Lake build directory should be excluded, but if tracked, treat as binary. |
| 71 | +.lake/** binary |
| 72 | + |
| 73 | + |
| 74 | +# === Notebooks === |
| 75 | + |
| 76 | +# WHY: Jupyter notebooks require specialized diff and merge handling. |
| 77 | +*.ipynb diff=jupyternotebook |
| 78 | +*.ipynb merge=jupyternotebook |
| 79 | + |
| 80 | + |
| 81 | +# === Databases (binary) === |
| 82 | + |
| 83 | +# WHY: Database files are binary; prevent text normalization and meaningless diffs. |
| 84 | +*.db binary |
| 85 | +*.duckdb binary |
| 86 | +*.sqlite binary |
| 87 | +*.sqlite3 binary |
| 88 | + |
| 89 | + |
| 90 | +# === Columnar and analytical data (binary) === |
| 91 | + |
| 92 | +# WHY: Columnar and analytical data formats are binary; diffs are not meaningful. |
| 93 | +*.arrow binary |
| 94 | +*.avro binary |
| 95 | +*.feather binary |
| 96 | +*.orc binary |
| 97 | +*.parquet binary |
| 98 | + |
| 99 | + |
| 100 | +# === Office, BI, PDFs, and compressed artifacts (binary) === |
| 101 | + |
| 102 | +# WHY: Office documents, BI files, PDFs, and compressed artifacts are binary. |
| 103 | +*.7z binary |
| 104 | +*.bz2 binary |
| 105 | +*.docx binary |
| 106 | +*.gz binary |
| 107 | +*.pbix binary |
| 108 | +*.pbit binary |
| 109 | +*.pdf binary |
| 110 | +*.pptx binary |
| 111 | +*.rar binary |
| 112 | +*.tar binary |
| 113 | +*.tgz binary |
| 114 | +*.xls binary |
| 115 | +*.xlsm binary |
| 116 | +*.xlsx binary |
| 117 | +*.xz binary |
| 118 | +*.zip binary |
| 119 | + |
| 120 | + |
| 121 | +# === GitHub metadata and UI === |
| 122 | + |
| 123 | +# WHY: Exclude documentation and tests from GitHub language statistics. |
| 124 | +docs/** linguist-documentation |
| 125 | +tests/** linguist-documentation |
| 126 | + |
| 127 | +# === LOG FILES === |
| 128 | +# WHY: Log files are typically large and binary in nature; prevent text normalization. |
| 129 | +*.log binary |
| 130 | +project.log binary |
0 commit comments