Skip to content

Commit 18eb22b

Browse files
committed
Added .editorconfig and .gitattributes for most often hand-edited files
1 parent defae97 commit 18eb22b

2 files changed

Lines changed: 178 additions & 0 deletions

File tree

.editorconfig

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
# EditorConfig helps developers maintain consistent coding styles across editors and IDEs
2+
# Docs: https://editorconfig.org/
3+
4+
root = true
5+
6+
# ========================================
7+
# XML, MSBuild files
8+
# ========================================
9+
[*.xml]
10+
indent_style = space
11+
indent_size = 2
12+
insert_final_newline = true
13+
resharper_enforce_empty_line_at_end_of_file = true
14+
trim_trailing_whitespace = true
15+
16+
[*.resx]
17+
indent_style = space
18+
indent_size = 2
19+
insert_final_newline = true
20+
resharper_enforce_empty_line_at_end_of_file = true
21+
trim_trailing_whitespace = true
22+
23+
[*.config]
24+
indent_style = space
25+
indent_size = 2
26+
insert_final_newline = true
27+
resharper_enforce_empty_line_at_end_of_file = true
28+
trim_trailing_whitespace = true
29+
30+
[*.csproj]
31+
indent_style = space
32+
indent_size = 2
33+
insert_final_newline = true
34+
resharper_enforce_empty_line_at_end_of_file = true
35+
trim_trailing_whitespace = true
36+
37+
[*.*proj]
38+
indent_style = space
39+
indent_size = 2
40+
insert_final_newline = true
41+
resharper_enforce_empty_line_at_end_of_file = true
42+
trim_trailing_whitespace = true
43+
44+
[*.props]
45+
indent_style = space
46+
indent_size = 2
47+
insert_final_newline = true
48+
resharper_enforce_empty_line_at_end_of_file = true
49+
trim_trailing_whitespace = true
50+
51+
[*.targets]
52+
indent_style = space
53+
indent_size = 2
54+
insert_final_newline = true
55+
resharper_enforce_empty_line_at_end_of_file = true
56+
trim_trailing_whitespace = true
57+
58+
# ========================================
59+
# JSON files
60+
# ========================================
61+
[*.json]
62+
indent_style = space
63+
indent_size = 2
64+
insert_final_newline = true
65+
resharper_enforce_empty_line_at_end_of_file = true
66+
trim_trailing_whitespace = true
67+
68+
# ========================================
69+
# Markdown
70+
# ========================================
71+
[*.md]
72+
indent_style = space
73+
indent_size = 2
74+
trim_trailing_whitespace = false
75+
insert_final_newline = true
76+
resharper_enforce_empty_line_at_end_of_file = true
77+
78+
# ========================================
79+
# YAML
80+
# ========================================
81+
[*.yml]
82+
indent_style = space
83+
indent_size = 2
84+
trim_trailing_whitespace = false
85+
insert_final_newline = true
86+
resharper_enforce_empty_line_at_end_of_file = true
87+
88+
[*.yaml]
89+
indent_style = space
90+
indent_size = 2
91+
trim_trailing_whitespace = false
92+
insert_final_newline = true
93+
resharper_enforce_empty_line_at_end_of_file = true
94+
95+
# ========================================
96+
# C# files
97+
# ========================================
98+
[*.cs]
99+
indent_style = space
100+
indent_size = 4
101+
insert_final_newline = true
102+
resharper_enforce_empty_line_at_end_of_file = true
103+
trim_trailing_whitespace = true
104+
105+
# ========================================
106+
# Solution files
107+
# ========================================
108+
[*.sln]
109+
indent_style = tab
110+
tab_width = 4
111+
insert_final_newline = true
112+
resharper_enforce_empty_line_at_end_of_file = true
113+
trim_trailing_whitespace = true
114+
115+
# ========================================
116+
# Windows Batch and Command files
117+
# ========================================
118+
[*.bat]
119+
indent_style = space
120+
indent_size = 4
121+
insert_final_newline = true
122+
resharper_enforce_empty_line_at_end_of_file = true
123+
trim_trailing_whitespace = false
124+
end_of_line = crlf
125+
126+
[*.cmd]
127+
indent_style = space
128+
indent_size = 4
129+
insert_final_newline = true
130+
resharper_enforce_empty_line_at_end_of_file = true
131+
trim_trailing_whitespace = false
132+
end_of_line = crlf
133+
134+
# ========================================
135+
# Powershell
136+
# ========================================
137+
[*.ps1]
138+
indent_style = space
139+
indent_size = 4
140+
trim_trailing_whitespace = false
141+
insert_final_newline = true
142+
resharper_enforce_empty_line_at_end_of_file = true
143+
144+
[*.psd1]
145+
indent_style = space
146+
indent_size = 4
147+
trim_trailing_whitespace = false
148+
insert_final_newline = true
149+
resharper_enforce_empty_line_at_end_of_file = true

.gitattributes

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Let Git handle line endings automatically:
2+
# - Checkout as CRLF on Windows, LF elsewhere
3+
* text=auto
4+
5+
# Explicit overrides for certain file types
6+
7+
# C# code and projects
8+
*.cs text eol=crlf diff=csharp
9+
*.sln text merge=union eol=crlf
10+
*.csproj text merge=union eol=lf
11+
*.vbproj text merge=union eol=lf
12+
*.fsproj text merge=union eol=lf
13+
14+
# XML-based config/resources (store as LF in repo)
15+
*.xml text eol=lf
16+
*.resx text eol=lf
17+
*.config text eol=lf
18+
*.props text eol=lf
19+
*.targets text eol=lf
20+
21+
# JSON, YAML, Markdown
22+
*.json text eol=lf
23+
*.yml text eol=lf
24+
*.yaml text eol=lf
25+
*.md text eol=lf
26+
27+
# Git metadata
28+
.gitattributes text eol=lf
29+
.gitignore text eol=lf

0 commit comments

Comments
 (0)