]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
top-level: Add .editorconfig file
authorJonathan Wakely <jwakely@redhat.com>
Fri, 19 Sep 2025 16:28:51 +0000 (17:28 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Mon, 22 Sep 2025 17:19:26 +0000 (18:19 +0100)
This config file sets default formatting behaviour for a large number
of common editors, see https://editorconfig.org

It also ensures that https://forge.sourceware.org formats GCC code
correctly, because it defaults to tab_width=4 but will respect a
.editorconfig file if present in the repo.

ChangeLog:

* .editorconfig: New file.

.editorconfig [new file with mode: 0644]

diff --git a/.editorconfig b/.editorconfig
new file mode 100644 (file)
index 0000000..9661e7e
--- /dev/null
@@ -0,0 +1,38 @@
+# top-most EditorConfig file for gcc
+root = true
+
+[*]
+end_of_line = lf
+insert_final_newline = true
+
+[*.h,*.cc]
+charset = utf-8
+indent_style = tab
+indent_size = 2
+tab_width = 8
+trim_trailing_whitespace = true
+
+[Makefile*,ChangeLog*]
+indent_style = tab
+indent_size = 8
+trim_trailing_whitespace = true
+
+[ChangeLog*]
+charset = utf-8
+
+[*.texi]
+charset = utf-8
+indent_size = 2
+tab_width = 8
+trim_trailing_whitespace = true
+
+[*.py]
+indent_style = space
+indent_size = 4
+trim_trailing_whitespace = true
+
+[*.exp]
+indent_style = tab
+indent_size = 4
+tab_width = 8
+trim_trailing_whitespace = true