public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: gdb-patches@sourceware.org, binutils@sourceware.org
Cc: Simon Marchi <simon.marchi@polymtl.ca>
Subject: [PATCH] Add top-level .editorconfig file
Date: Thu, 27 Jan 2022 15:15:08 -0500	[thread overview]
Message-ID: <20220127201508.2170906-1-simon.marchi@polymtl.ca> (raw)

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 | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100644 .editorconfig

diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 000000000000..4f84b9a0c3b6
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,41 @@
+# 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/>.
+
+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

base-commit: 0d8cbc5f2fcbcb9eb207f12507fdfe04f3d3ae14
-- 
2.34.1


             reply	other threads:[~2022-01-27 20:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-27 20:15 Simon Marchi [this message]
2022-01-28 11:57 ` Nick Clifton
2022-01-28 12:26   ` Simon Marchi
2022-01-28 13:03     ` Nick Clifton
2022-01-28 13:25       ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220127201508.2170906-1-simon.marchi@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=binutils@sourceware.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).