Skip to content

Commit 2c6f453

Browse files
committed
(maint) Fixing all the things!
We are seeing a number of problems with regard to whitespace changes in files when doing git operations. This is an attempt to normalize all the things, using the defaults from the gitattributes vscode extension, with a little bit of tweaking.
1 parent 8ab2269 commit 2c6f453

File tree

2 files changed

+120
-31
lines changed

2 files changed

+120
-31
lines changed

.editorconfig

+16-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ indent_style = space
1515
tab_width = 4
1616

1717
# New line preferences
18-
end_of_line = crlf
18+
end_of_line = unset
1919
insert_final_newline = false
2020
trim_trailing_whitespace = true
2121

@@ -24,9 +24,18 @@ end_of_line = lf
2424

2525
[*.sln]
2626
# Visual studio defaults
27+
end_of_line = crlf
2728
insert_final_newline = true
2829
indent_style = tab
2930

31+
[*.csproj]
32+
# Visual studio defaults
33+
end_of_line = crlf
34+
insert_final_newline = true
35+
indent_style = space
36+
tab_width = 4
37+
indent_size = 4
38+
3039
[*.md]
3140
trim_trailing_whitespace = false
3241
insert_final_newline = true # Conflicts with markdownlint when false
@@ -36,10 +45,15 @@ indent_size = 2 # Incorrect indentation happens when this is not 2
3645
indent_size = 2 # Incorrect indentation happens when this is not 2
3746

3847
[*.ps1]
48+
end_of_line = crlf
3949
charset = utf-8-bom
4050
indent_style = space
4151
indent_size = 2
4252

4353
[*.js]
4454
indent_style = tab
45-
indent_size = 2
55+
indent_size = 2
56+
57+
[*.{bat,cmd}]
58+
end_of_line = crlf
59+
charset = latin1

.gitattributes

+104-29
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,104 @@
1-
* text eol=crlf whitespace=tab-in-indent,tabwidth=4
2-
3-
*.sh text eol=lf
4-
5-
*.md text whitespace=-blank-at-eol
6-
7-
# Custom for Visual Studio
8-
*.cs text diff=csharp
9-
*.sln merge=union whitespace=-tab-in-indent,-blank-at-eof,indent-with-non-tab
10-
*.csproj merge=union
11-
*.vbproj merge=union
12-
*.fsproj merge=union
13-
*.dbproj merge=union
14-
15-
# Standard to msysgit
16-
*.doc diff=astextplain
17-
*.DOC diff=astextplain
18-
*.docx diff=astextplain
19-
*.DOCX diff=astextplain
20-
*.dot diff=astextplain
21-
*.DOT diff=astextplain
22-
*.pdf diff=astextplain
23-
*.PDF diff=astextplain
24-
*.rtf diff=astextplain
25-
*.RTF diff=astextplain
26-
27-
*.png binary
28-
29-
.editorconfig text whitespace=-blank-at-eol
1+
# Common settings that generally should always be used with your language specific settings
2+
3+
# Auto detect text files and perform LF normalization
4+
* text=auto
5+
6+
#
7+
# The above will handle all files NOT found below
8+
#
9+
10+
# Documents
11+
*.bibtex text diff=bibtex
12+
*.doc diff=astextplain
13+
*.DOC diff=astextplain
14+
*.docx diff=astextplain
15+
*.DOCX diff=astextplain
16+
*.dot diff=astextplain
17+
*.DOT diff=astextplain
18+
*.pdf diff=astextplain
19+
*.PDF diff=astextplain
20+
*.rtf diff=astextplain
21+
*.RTF diff=astextplain
22+
*.md text diff=markdown
23+
*.mdx text diff=markdown
24+
*.tex text diff=tex
25+
*.adoc text
26+
*.textile text
27+
*.mustache text
28+
*.csv text eol=crlf
29+
*.tab text
30+
*.tsv text
31+
*.txt text
32+
*.sql text
33+
*.epub diff=astextplain
34+
35+
# Graphics
36+
*.png binary
37+
*.jpg binary
38+
*.jpeg binary
39+
*.gif binary
40+
*.tif binary
41+
*.tiff binary
42+
*.ico binary
43+
# SVG treated as text by default.
44+
*.svg text
45+
# If you want to treat it as binary,
46+
# use the following line instead.
47+
# *.svg binary
48+
*.eps binary
49+
50+
# Scripts
51+
*.bash text eol=lf
52+
*.fish text eol=lf
53+
*.ksh text eol=lf
54+
*.sh text eol=lf
55+
*.zsh text eol=lf
56+
# These are explicitly windows files and should use crlf
57+
*.bat text eol=crlf
58+
*.cmd text eol=crlf
59+
*.ps1 text eol=crlf
60+
61+
# Serialisation
62+
*.json text
63+
*.toml text
64+
*.xml text
65+
*.yaml text
66+
*.yml text
67+
68+
# Archives
69+
*.7z binary
70+
*.bz binary
71+
*.bz2 binary
72+
*.bzip2 binary
73+
*.gz binary
74+
*.lz binary
75+
*.lzma binary
76+
*.rar binary
77+
*.tar binary
78+
*.taz binary
79+
*.tbz binary
80+
*.tbz2 binary
81+
*.tgz binary
82+
*.tlz binary
83+
*.txz binary
84+
*.xz binary
85+
*.Z binary
86+
*.zip binary
87+
*.zst binary
88+
89+
# Text files where line endings should be preserved
90+
*.patch -text
91+
92+
*.cs text diff=csharp
93+
*.cshtml text diff=html
94+
*.csx text diff=csharp
95+
*.sln text eol=crlf
96+
*.csproj text eol=crlf
97+
98+
#
99+
# Exclude files from exporting
100+
#
101+
102+
.gitattributes export-ignore
103+
.gitignore export-ignore
104+
.gitkeep export-ignore

0 commit comments

Comments
 (0)