From 459140adc0cbcf7ff5d389a195a3c9e34dd8282f Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Thu, 27 Jan 2022 15:15:08 -0500 Subject: [PATCH] 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 --- .editorconfig | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000000..d1da30853d4 --- /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 . + +# 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 -- 2.30.2