Skip to content

Commit 162ec53

Browse files
author
Richard Earnshaw
committed
editorconfig: Add explicit tab_width when indent_size != 8
The documentation for editorconfig files says that setting indent_size changes the default value of tab_width; but the documentation is a little ambiguous as to what happens if the two values are set via different match rules. I'd generally expect in this case that the defaulting behavior would only kick in if there were no setting of tab_width at all, but it seems that the go implementation (or at least the way forgejo uses the go implementation) does not do this. However, it is fairly easy to make this all explicit by explicitly setting tab_width whenever we have an indent_size that is not 8. I've deliberately omitted overriding this when the indent style is set to space, since this should make the presence of a hard tab show up in the forge UI more clearly as incorrect indentation. /ChangeLog: * .editorconfig: Explicitly set tab_width whenever a config rule has indent_style = tab and indent_size != 8.
1 parent b6146fa commit 162ec53

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

.editorconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ charset = utf-8
5353
charset = utf-8
5454
indent_style = tab
5555
indent_size = 2
56+
tab_width = 8
5657
trim_trailing_whitespace = true
5758

5859
# GCC .def files. These are generally C fragments that get included
@@ -61,18 +62,21 @@ trim_trailing_whitespace = true
6162
charset = utf-8
6263
indent_style = tab
6364
indent_size = 2
65+
tab_width = 8
6466
trim_trailing_whitespace = true
6567

6668
# Texinfo files
6769
[*.texi]
6870
charset = utf-8
6971
indent_size = 2
72+
tab_width = 8
7073
trim_trailing_whitespace = true
7174

7275
# Expect / TCL
7376
[*.{exp,tcl}]
7477
indent_style = tab
7578
indent_size = 4
79+
tab_width = 8
7680
trim_trailing_whitespace = true
7781

7882
# Python
@@ -91,24 +95,28 @@ trim_trailing_whitespace = true
9195
[gcc/config/**.md]
9296
indent_style = tab
9397
indent_size = 2
98+
tab_width = 8
9499
trim_trailing_whitespace = true
95100

96101
# Awk
97102
[*.awk]
98103
indent_style = tab
99104
indent_size = 2
105+
tab_width = 8
100106
trim_trailing_whitespace = true
101107

102108
# Autoconf
103109
[*.{ac,m4}]
104110
indent_style = tab
105111
indent_size = 2
112+
tab_width = 8
106113
trim_trailing_whitespace = true
107114

108115
# Shell scripts
109116
[*.sh]
110117
indent_style = tab
111118
indent_size = 4
119+
tab_width = 8
112120
trim_trailing_whitespace = true
113121

114122
# Ada

0 commit comments

Comments
 (0)