-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitattributes
More file actions
153 lines (112 loc) · 3.92 KB
/
.gitattributes
File metadata and controls
153 lines (112 loc) · 3.92 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# ============================================================
# .gitattributes (Keep files consistent across operating systems)
# ============================================================
# REQ.UNIVERSAL: All professional GitHub project repositories MUST include .gitattributes.
# WHY: Ensure consistent line endings, diff behavior, and file classification
# across Windows, macOS, and Linux environments.
# ALT: Repository may omit .gitattributes ONLY if equivalent normalization is
# enforced reliably by tooling and CI (rare and fragile).
# CUSTOM: Update file-type rules only when introducing new languages,
# binary artifacts, or documentation formats.
# NOTE: Rules are ordered by impact and generality, not alphabetically.
# Git attributes are documented at https://git-scm.com/docs/gitattributes
# === Core defaults (always apply) ===
# WHY: Auto-detect text files and normalize line endings to avoid cross-platform drift.
* text=auto
# WHY-SECTION: Explicit EOL rules avoid platform-specific diffs and tool failures.
# === Scripts ===
# Python and shell scripts must always use LF (CI, Linux, macOS, containers)
*.py text eol=lf
*.sh text eol=lf
# PowerShell scripts follow Windows convention
*.ps1 text eol=crlf
# === Docs and configs ===
# Cross-platform; tooling expects LF
*.md text eol=lf
*.yaml text eol=lf
*.yml text eol=lf
*.json text eol=lf
*.toml text eol=lf
# === GitHub Linguist ===
# Improve language statistics and UI without affecting builds
docs/** linguist-documentation
# Jupyter notebooks: custom diff/merge drivers (if configured)
*.ipynb diff=jupyternotebook
*.ipynb merge=jupyternotebook
# === Source Code ===
# WHY: Python and shell scripts must use LF for CI/CD, Linux environments, and containers.
*.py text eol=lf
*.sh text eol=lf
# WHY: PowerShell convention on Windows uses CRLF.
*.ps1 text eol=crlf
# === Markup and Documentation ===
# WHY: Documentation and markup files use LF; standard for cross-platform tooling.
*.bib text eol=lf
*.cls text eol=lf
*.md text eol=lf
*.sty text eol=lf
*.tex text eol=lf
# === Configuration and Data (Text) ===
# WHY: Configuration and structured text formats use LF for stable diffs.
*.json text eol=lf
*.jsonc text eol=lf
*.jsonl text eol=lf
*.ndjson text eol=lf
*.toml text eol=lf
*.yaml text eol=lf
*.yml text eol=lf
# === GitHub Metadata ===
# WHY: Exclude documentation and tests from GitHub language statistics.
docs/** linguist-documentation
tests/** linguist-documentation
# === Notebooks ===
# WHY: Jupyter notebooks require specialized diff and merge handling.
*.ipynb diff=jupyternotebook
*.ipynb merge=jupyternotebook
# === Databases (Binary) ===
# WHY: Database files are binary; prevent text normalization and meaningless diffs.
*.db binary
*.duckdb binary
*.sqlite binary
*.sqlite3 binary
# === Columnar / Analytical Data (Binary) ===
# WHY: Columnar and analytical data formats are binary; diffs are not meaningful.
*.arrow binary
*.avro binary
*.feather binary
*.orc binary
*.parquet binary
# === Office, BI, PDFs, and Compressed Artifacts (Binary) ===
# WHY: Office documents, BI files, PDFs, and compressed artifacts are binary.
*.7z binary
*.bz2 binary
*.docx binary
*.gz binary
*.pbix binary
*.pbit binary
*.pdf binary
*.pptx binary
*.rar binary
*.tar binary
*.tgz binary
*.xls binary
*.xlsm binary
*.xlsx binary
*.xz binary
*.zip binary
# === Proof Assistants ===
# WHY: Lean files must use LF for cross-platform consistency and CI.
*.lean text eol=lf
# WHY: Lean build artifacts are binary; prevent normalization and meaningless diffs.
*.olean binary
*.ilean binary
*.trace binary
# WHY: Coq source uses LF; compiled objects are binary.
*.v text eol=lf
*.vo binary
*.vok binary
*.vos binary
*.glob binary
# === Lean Build System ===
# WHY: Lake build directory should be excluded but if tracked, treat as binary.
.lake/** binary