public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Add top-level .editorconfig file
@ 2022-01-27 20:15 Simon Marchi
  2022-01-28 11:57 ` Nick Clifton
  0 siblings, 1 reply; 5+ messages in thread
From: Simon Marchi @ 2022-01-27 20:15 UTC (permalink / raw)
  To: gdb-patches, binutils; +Cc: Simon Marchi

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Add top-level .editorconfig file
  2022-01-27 20:15 [PATCH] Add top-level .editorconfig file Simon Marchi
@ 2022-01-28 11:57 ` Nick Clifton
  2022-01-28 12:26   ` Simon Marchi
  0 siblings, 1 reply; 5+ messages in thread
From: Nick Clifton @ 2022-01-28 11:57 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches, binutils

Hi Simon,

> Add a .editorconfig [1] file.

I hae no objection to this patch, but ...

> [1] https://editorconfig.org/

I think that it might be helpful if this URL was included in
the text of the file, as a comment, along with a note telling
readers that they can find out more about editorconfig by following
the link.

Cheers
   Nick


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Add top-level .editorconfig file
  2022-01-28 11:57 ` Nick Clifton
@ 2022-01-28 12:26   ` Simon Marchi
  2022-01-28 13:03     ` Nick Clifton
  0 siblings, 1 reply; 5+ messages in thread
From: Simon Marchi @ 2022-01-28 12:26 UTC (permalink / raw)
  To: Nick Clifton, gdb-patches, binutils

On 2022-01-28 06:57, Nick Clifton wrote:
> Hi Simon,
> 
>> Add a .editorconfig [1] file.
> 
> I hae no objection to this patch, but ...
> 
>> [1] https://editorconfig.org/
> 
> I think that it might be helpful if this URL was included in
> the text of the file, as a comment, along with a note telling
> readers that they can find out more about editorconfig by following
> the link.
> 
> Cheers
>   Nick

Good idea, I will add this comment at the top:

 # This file helps editors auto-configure whitespace settings.
 #
 # See here for more information about the format and editor support:
 #
 #   https://editorconfig.org/

Simon

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Add top-level .editorconfig file
  2022-01-28 12:26   ` Simon Marchi
@ 2022-01-28 13:03     ` Nick Clifton
  2022-01-28 13:25       ` Simon Marchi
  0 siblings, 1 reply; 5+ messages in thread
From: Nick Clifton @ 2022-01-28 13:03 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches, binutils

Hi Simon,

> Good idea, I will add this comment at the top:
> 
>   # This file helps editors auto-configure whitespace settings.
>   #
>   # See here for more information about the format and editor support:
>   #
>   #   https://editorconfig.org/

In which case if you are still looking for an approval, then please
consider the patch approved.

Cheers
   Nick



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Add top-level .editorconfig file
  2022-01-28 13:03     ` Nick Clifton
@ 2022-01-28 13:25       ` Simon Marchi
  0 siblings, 0 replies; 5+ messages in thread
From: Simon Marchi @ 2022-01-28 13:25 UTC (permalink / raw)
  To: Nick Clifton, gdb-patches, binutils

On 2022-01-28 08:03, Nick Clifton wrote:
> Hi Simon,
> 
>> Good idea, I will add this comment at the top:
>>
>>   # This file helps editors auto-configure whitespace settings.
>>   #
>>   # See here for more information about the format and editor support:
>>   #
>>   #   https://editorconfig.org/
> 
> In which case if you are still looking for an approval, then please
> consider the patch approved.
> 
> Cheers
>   Nick

Thanks Nick, will merge.

Simon

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-01-28 13:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-27 20:15 [PATCH] Add top-level .editorconfig file Simon Marchi
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

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).