Files
gcc-reflection/.editorconfig
Richard Earnshaw 162ec539a3 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.
2025-10-28 15:06:51 +00:00

151 lines
2.9 KiB
INI

# Copyright 2025 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# This file helps editors auto-configure whitespace settings.
#
# See here for more information about the format and editor support:
#
# https://editorconfig.org/
# This file is common to the GCC and GDB/Binutils projects. If you
# update one, please sync it with the other.
# top-most EditorConfig file
root = true
[*]
end_of_line = lf
insert_final_newline = true
tab_width = 8
# EditorConfig files
[.editorconfig]
charset = utf-8
trim_trailing_whitespace = true
# Makefile
[{Makefile,*.mk,*.am}*]
indent_style = tab
indent_size = 8
trim_trailing_whitespace = true
# ChangeLogs
[ChangeLog*]
indent_style = tab
indent_size = 8
trim_trailing_whitespace = true
charset = utf-8
# C/C++
[*.{c,h,cc}]
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
# one or more times
[gcc/**.def]
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
[*.py]
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
# Assembler
[*.{s,S,asm}]
indent_style = tab
indent_size = 8
trim_trailing_whitespace = true
# GCC Machine description files
[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
[*.ad[bs]]
indent_style = space
indent_size = 3
trim_trailing_whitespace = true
# D
[*.d]
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
# Go
[*.go]
indent_style = tab
indent_size = 8
trim_trailing_whitespace = true
# Fortran
[*.[Ff]90]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
# Cobol
[*.cbl]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true