aboutsummaryrefslogtreecommitdiff
path: root/.editorconfig
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2022-01-27 15:15:08 -0500
committerSimon Marchi <simon.marchi@polymtl.ca>2022-01-28 08:25:42 -0500
commit459140adc0cbcf7ff5d389a195a3c9e34dd8282f (patch)
tree32828cc4ccec066ef0fdb8525f4551c1443ec550 /.editorconfig
parent2f49159cfbf74fd8fed13e023c7e9e9c90a5b22d (diff)
downloadgdb-459140adc0cbcf7ff5d389a195a3c9e34dd8282f.zip
gdb-459140adc0cbcf7ff5d389a195a3c9e34dd8282f.tar.gz
gdb-459140adc0cbcf7ff5d389a195a3c9e34dd8282f.tar.bz2
Add top-level .editorconfig file
Add a .editorconfig [1] file. This helps configure editors automatically with the right whitespace settings. It will help me, since I need to juggle with different whitespace settings for different projects. But I think it can also help newcomers get things right from the start. Some editors have native support for reading these files, while others require a plug-in [2]. And if you don't want to use it, then this file doesn't change anything to your life. I added rules for the kinds of files I edit most often, but more can be added later. I assumed that the rules were the same for GDB and the other projects, but if that's not the case, we can always put .editorconfig files in project subdirectories to override settings. [1] https://editorconfig.org/ [2] https://editorconfig.org/#download Change-Id: Ifda136d13877fafcf0d137fec8501f6a34e1367b
Diffstat (limited to '.editorconfig')
-rw-r--r--.editorconfig47
1 files changed, 47 insertions, 0 deletions
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..d1da308
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,47 @@
+# Copyright 2022 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/
+
+root = true
+
+[*]
+end_of_line = lf
+insert_final_newline = true
+tab_width = 8
+
+# Makefile
+[{Makefile*,*.mk}]
+indent_style = tab
+indent_size = 8
+
+# C/C++
+[*.{c,h,cc}]
+indent_style = tab
+indent_size = 2
+
+# Expect / TCL
+[*.{exp,tcl}]
+indent_style = tab
+indent_size = 4
+
+# Python
+[*.py]
+indent_style = space
+indent_size = 4