Skip to content

Commit c50cb0d

Browse files
committed
add formating config
1 parent bb974c6 commit c50cb0d

File tree

2 files changed

+96
-0
lines changed

2 files changed

+96
-0
lines changed

.editorconfig

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
; see http://editorconfig.org/ for docs on this file
2+
3+
root = true
4+
5+
[*]
6+
ignore_if_in_header = This code was generated by a tool|<auto-generated>
7+
indent_style = space
8+
indent_size = 4
9+
; uncomment to help with sharing files across os's (i.e. network share or through local vm)
10+
#end_of_line = lf
11+
; avoid a bom, which causes endless problems with naive text tooling
12+
charset = utf-8
13+
trim_trailing_whitespace = true
14+
insert_final_newline = true
15+
; keeping auto-format enabled helps avoid merge hell for projects without CI-based format validation
16+
#disable_auto_format = true
17+
18+
[*.cs]
19+
; uncomment to enable full formatting of c# files
20+
formatters = generic, uncrustify
21+
22+
[*.asmdef]
23+
scrape_api = true
24+
25+
[**/Tests/**.asmdef]
26+
scrape_api = false
27+
28+
[*.Tests.asmdef]
29+
scrape_api = false
30+
31+
[*.md]
32+
indent_size = 2
33+
; trailing whitespace is unfortunately significant in markdown
34+
trim_trailing_whitespace = false
35+
; uncomment to enable basic formatting of markdown files
36+
#formatters = generic
37+
38+
[{Makefile,makefile}]
39+
; tab characters are part of the Makefile format
40+
indent_style = tab
41+
42+
[*.asmdef]
43+
indent_size = 4
44+
45+
[*.json]
46+
indent_size = 2
47+
48+
[*.{vcproj,bat,cmd,xaml,tt,t4,ttinclude}]
49+
end_of_line = crlf
50+
51+
; this VS-specific stuff is based on experiments to see how VS will modify a file after it has been manually edited.
52+
; the settings are meant to closely match what VS does to minimize unnecessary diffs.
53+
[*.{vcxproj,vcxproj.filters}]
54+
indent_style = space
55+
indent_size = 2
56+
end_of_line = crlf
57+
charset = utf-8-bom
58+
trim_trailing_whitespace = true
59+
insert_final_newline = false
60+
; must be broken out because of 51-char bug (https://github.com/editorconfig/editorconfig-visualstudio/issues/21)
61+
[*.{csproj,pyproj,props,targets}]
62+
indent_style = space
63+
indent_size = 2
64+
end_of_line = crlf
65+
charset = utf-8-bom
66+
trim_trailing_whitespace = true
67+
insert_final_newline = false
68+
[*.{sln,sln.template}]
69+
indent_style = tab
70+
indent_size = 4
71+
end_of_line = crlf
72+
charset = utf-8
73+
trim_trailing_whitespace = true
74+
insert_final_newline = false

.gitattributes

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
* text=auto eol=lf
2+
3+
# match .editorconfig
4+
5+
*.vcproj eol=crlf
6+
*.bat eol=crlf
7+
*.cmd eol=crlf
8+
*.xaml eol=crlf
9+
*.tt eol=crlf
10+
*.t4 eol=crlf
11+
*.ttinclude eol=crlf
12+
13+
*.vcxproj eol=crlf
14+
*.vcxproj.filters eol=crlf
15+
16+
*.csproj eol=crlf
17+
*.pyproj eol=crlf
18+
*.props eol=crlf
19+
*.targets eol=crlf
20+
21+
*.sln eol=crlf
22+
*.sln.template eol=crlf

0 commit comments

Comments
 (0)