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.
---
.editorconfig | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/.editorconfig b/.editorconfig
index e5e9997f44f..4d53220ba8e 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -53,6 +53,7 @@ charset = utf-8
charset = utf-8
indent_style = tab
indent_size = 2
+tab_width = 8
trim_trailing_whitespace = true
# GCC .def files. These are generally C fragments that get included
@@ -61,18 +62,21 @@ trim_trailing_whitespace = true
charset = utf-8
indent_style = tab
indent_size = 2
+tab_width = 8
trim_trailing_whitespace = true
# Texinfo files
[*.texi]
charset = utf-8
indent_size = 2
+tab_width = 8
trim_trailing_whitespace = true
# Expect / TCL
[*.{exp,tcl}]
indent_style = tab
indent_size = 4
+tab_width = 8
trim_trailing_whitespace = true
# Python
@@ -91,24 +95,28 @@ trim_trailing_whitespace = true
[gcc/config/**.md]
indent_style = tab
indent_size = 2
+tab_width = 8
trim_trailing_whitespace = true
# Awk
[*.awk]
indent_style = tab
indent_size = 2
+tab_width = 8
trim_trailing_whitespace = true
# Autoconf
[*.{ac,m4}]
indent_style = tab
indent_size = 2
+tab_width = 8
trim_trailing_whitespace = true
# Shell scripts
[*.sh]
indent_style = tab
indent_size = 4
+tab_width = 8
trim_trailing_whitespace = true
# Ada
--
2.43.0