* [PATCH 0/1] Unify the GCC and GDB/Binutils .editorconfig files
@ 2025-09-23 16:49 Richard Earnshaw
2025-09-23 16:49 ` [PATCH 1/1] toplevel: unify the GCC and GDB/binutils " Richard Earnshaw
0 siblings, 1 reply; 7+ messages in thread
From: Richard Earnshaw @ 2025-09-23 16:49 UTC (permalink / raw)
To: gcc-patches, binutils, gdb-patches; +Cc: jwakely, Richard Earnshaw
Both GCC and the GDB/binutils projects have a top-level .editorconfig file. Like much
of the toplevel configury it would seem sensible to try to keep this unified. This patch
is an initial stab at doing that.
I've also added considerably more than was in either current file in an attempt to
handle some of GCC's supported languages and the test/build systems. I've had to
make educated guesses for some of these languages based on a small sample of the
existing code bases. If I've got them wrong please let me know.
The diff is technically against the current GCC .editorconfig, but in truth there's
not much that isn't changed in the patch, so I think it should be understandable
by everyone.
Comments welcome.
R.
Richard Earnshaw (1):
toplevel: unify the GCC and GDB/binutils .editorconfig files
.editorconfig | 122 ++++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 113 insertions(+), 9 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/1] toplevel: unify the GCC and GDB/binutils .editorconfig files
2025-09-23 16:49 [PATCH 0/1] Unify the GCC and GDB/Binutils .editorconfig files Richard Earnshaw
@ 2025-09-23 16:49 ` Richard Earnshaw
2025-09-23 17:03 ` Simon Marchi
0 siblings, 1 reply; 7+ messages in thread
From: Richard Earnshaw @ 2025-09-23 16:49 UTC (permalink / raw)
To: gcc-patches, binutils, gdb-patches; +Cc: jwakely, Richard Earnshaw
Both GCC and GDB/binutils now have root editorconfig files. It would
make sense to unify them as this sets the general tone for these
projects.
ChangeLog:
* .editorconfig: Unify the GCC and GDB/binutils root config.
---
.editorconfig | 122 ++++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 113 insertions(+), 9 deletions(-)
diff --git a/.editorconfig b/.editorconfig
index af1a28411da..e5e9997f44f 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -1,38 +1,142 @@
-# top-most EditorConfig file for gcc
+# Copyright 2025 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/
+
+# This file is common to the GCC and GDB/Binutils projects. If you
+# update one, please sync it with the other.
+
+# top-most EditorConfig file
root = true
[*]
end_of_line = lf
insert_final_newline = true
+tab_width = 8
-[*.{h,cc}]
+# EditorConfig files
+[.editorconfig]
charset = utf-8
-indent_style = tab
-indent_size = 2
-tab_width = 8
trim_trailing_whitespace = true
-[{Makefile,ChangeLog}*]
+# Makefile
+[{Makefile,*.mk,*.am}*]
indent_style = tab
indent_size = 8
trim_trailing_whitespace = true
+# ChangeLogs
[ChangeLog*]
+indent_style = tab
+indent_size = 8
+trim_trailing_whitespace = true
+charset = utf-8
+
+# C/C++
+[*.{c,h,cc}]
charset = utf-8
+indent_style = tab
+indent_size = 2
+trim_trailing_whitespace = true
+# GCC .def files. These are generally C fragments that get included
+# one or more times
+[gcc/**.def]
+charset = utf-8
+indent_style = tab
+indent_size = 2
+trim_trailing_whitespace = true
+
+# Texinfo files
[*.texi]
charset = utf-8
indent_size = 2
-tab_width = 8
trim_trailing_whitespace = true
+# Expect / TCL
+[*.{exp,tcl}]
+indent_style = tab
+indent_size = 4
+trim_trailing_whitespace = true
+
+# Python
[*.py]
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
-[*.exp]
+# Assembler
+[*.{s,S,asm}]
+indent_style = tab
+indent_size = 8
+trim_trailing_whitespace = true
+
+# GCC Machine description files
+[gcc/config/**.md]
+indent_style = tab
+indent_size = 2
+trim_trailing_whitespace = true
+
+# Awk
+[*.awk]
+indent_style = tab
+indent_size = 2
+trim_trailing_whitespace = true
+
+# Autoconf
+[*.{ac,m4}]
+indent_style = tab
+indent_size = 2
+trim_trailing_whitespace = true
+
+# Shell scripts
+[*.sh]
indent_style = tab
indent_size = 4
-tab_width = 8
+trim_trailing_whitespace = true
+
+# Ada
+[*.ad[bs]]
+indent_style = space
+indent_size = 3
+trim_trailing_whitespace = true
+
+# D
+[*.d]
+indent_style = space
+indent_size = 4
+trim_trailing_whitespace = true
+
+# Go
+[*.go]
+indent_style = tab
+indent_size = 8
+trim_trailing_whitespace = true
+
+# Fortran
+[*.[Ff]90]
+indent_style = space
+indent_size = 2
+trim_trailing_whitespace = true
+
+# Cobol
+[*.cbl]
+indent_style = space
+indent_size = 2
trim_trailing_whitespace = true
--
2.43.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/1] toplevel: unify the GCC and GDB/binutils .editorconfig files
2025-09-23 16:49 ` [PATCH 1/1] toplevel: unify the GCC and GDB/binutils " Richard Earnshaw
@ 2025-09-23 17:03 ` Simon Marchi
2025-09-24 8:23 ` Jonathan Wakely
0 siblings, 1 reply; 7+ messages in thread
From: Simon Marchi @ 2025-09-23 17:03 UTC (permalink / raw)
To: Richard Earnshaw, gcc-patches, binutils, gdb-patches; +Cc: jwakely
On 9/23/25 12:49 PM, Richard Earnshaw wrote:
> Both GCC and GDB/binutils now have root editorconfig files. It would
> make sense to unify them as this sets the general tone for these
> projects.
>
> ChangeLog:
> * .editorconfig: Unify the GCC and GDB/binutils root config.
From the point of view of GDB, this looks fine, thanks for doing this.
Simon
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/1] toplevel: unify the GCC and GDB/binutils .editorconfig files
2025-09-23 17:03 ` Simon Marchi
@ 2025-09-24 8:23 ` Jonathan Wakely
2025-10-01 14:44 ` Richard Earnshaw (lists)
0 siblings, 1 reply; 7+ messages in thread
From: Jonathan Wakely @ 2025-09-24 8:23 UTC (permalink / raw)
To: Simon Marchi; +Cc: Richard Earnshaw, gcc-patches, binutils, gdb-patches
On Tue, 23 Sept 2025 at 18:11, Simon Marchi wrote:
>
> On 9/23/25 12:49 PM, Richard Earnshaw wrote:
> > Both GCC and GDB/binutils now have root editorconfig files. It would
> > make sense to unify them as this sets the general tone for these
> > projects.
> >
> > ChangeLog:
> > * .editorconfig: Unify the GCC and GDB/binutils root config.
>
> From the point of view of GDB, this looks fine, thanks for doing this.
This looks like a vast improvement on the bare-bones config I added
for GCC, thanks.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/1] toplevel: unify the GCC and GDB/binutils .editorconfig files
2025-09-24 8:23 ` Jonathan Wakely
@ 2025-10-01 14:44 ` Richard Earnshaw (lists)
2025-10-01 14:58 ` Simon Marchi
0 siblings, 1 reply; 7+ messages in thread
From: Richard Earnshaw (lists) @ 2025-10-01 14:44 UTC (permalink / raw)
To: Jonathan Wakely, Simon Marchi
Cc: Richard Earnshaw, gcc-patches, binutils, gdb-patches
On 24/09/2025 09:23, Jonathan Wakely wrote:
> On Tue, 23 Sept 2025 at 18:11, Simon Marchi wrote:
>>
>> On 9/23/25 12:49 PM, Richard Earnshaw wrote:
>>> Both GCC and GDB/binutils now have root editorconfig files. It would
>>> make sense to unify them as this sets the general tone for these
>>> projects.
>>>
>>> ChangeLog:
>>> * .editorconfig: Unify the GCC and GDB/binutils root config.
>>
>> From the point of view of GDB, this looks fine, thanks for doing this.
>
>
> This looks like a vast improvement on the bare-bones config I added
> for GCC, thanks.
>
I've now pushed this to the GCC repo, but I've not yet heard anything from the binutils maintainers. Do I need to wait for them, or is Simon's ack for GDB enough?
R.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/1] toplevel: unify the GCC and GDB/binutils .editorconfig files
2025-10-01 14:44 ` Richard Earnshaw (lists)
@ 2025-10-01 14:58 ` Simon Marchi
2025-10-01 15:22 ` Richard Earnshaw (lists)
0 siblings, 1 reply; 7+ messages in thread
From: Simon Marchi @ 2025-10-01 14:58 UTC (permalink / raw)
To: Richard Earnshaw (lists), Jonathan Wakely
Cc: Richard Earnshaw, gcc-patches, binutils, gdb-patches
On 10/1/25 10:44 AM, Richard Earnshaw (lists) wrote:
> On 24/09/2025 09:23, Jonathan Wakely wrote:
>> On Tue, 23 Sept 2025 at 18:11, Simon Marchi wrote:
>>>
>>> On 9/23/25 12:49 PM, Richard Earnshaw wrote:
>>>> Both GCC and GDB/binutils now have root editorconfig files. It would
>>>> make sense to unify them as this sets the general tone for these
>>>> projects.
>>>>
>>>> ChangeLog:
>>>> * .editorconfig: Unify the GCC and GDB/binutils root config.
>>>
>>> From the point of view of GDB, this looks fine, thanks for doing this.
>>
>>
>> This looks like a vast improvement on the bare-bones config I added
>> for GCC, thanks.
>>
>
> I've now pushed this to the GCC repo, but I've not yet heard anything from the binutils maintainers. Do I need to wait for them, or is Simon's ack for GDB enough?
>
> R.
I think you can go ahead and push it, I really don't see how it could be
controversial.
Simon
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/1] toplevel: unify the GCC and GDB/binutils .editorconfig files
2025-10-01 14:58 ` Simon Marchi
@ 2025-10-01 15:22 ` Richard Earnshaw (lists)
0 siblings, 0 replies; 7+ messages in thread
From: Richard Earnshaw (lists) @ 2025-10-01 15:22 UTC (permalink / raw)
To: Simon Marchi, Jonathan Wakely
Cc: Richard Earnshaw, gcc-patches, binutils, gdb-patches
On 01/10/2025 15:58, Simon Marchi wrote:
> On 10/1/25 10:44 AM, Richard Earnshaw (lists) wrote:
>> On 24/09/2025 09:23, Jonathan Wakely wrote:
>>> On Tue, 23 Sept 2025 at 18:11, Simon Marchi wrote:
>>>>
>>>> On 9/23/25 12:49 PM, Richard Earnshaw wrote:
>>>>> Both GCC and GDB/binutils now have root editorconfig files. It would
>>>>> make sense to unify them as this sets the general tone for these
>>>>> projects.
>>>>>
>>>>> ChangeLog:
>>>>> * .editorconfig: Unify the GCC and GDB/binutils root config.
>>>>
>>>> From the point of view of GDB, this looks fine, thanks for doing this.
>>>
>>>
>>> This looks like a vast improvement on the bare-bones config I added
>>> for GCC, thanks.
>>>
>>
>> I've now pushed this to the GCC repo, but I've not yet heard anything from the binutils maintainers. Do I need to wait for them, or is Simon's ack for GDB enough?
>>
>> R.
>
> I think you can go ahead and push it, I really don't see how it could be
> controversial.
>
> Simon
Done.
R.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-10-01 15:22 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-23 16:49 [PATCH 0/1] Unify the GCC and GDB/Binutils .editorconfig files Richard Earnshaw
2025-09-23 16:49 ` [PATCH 1/1] toplevel: unify the GCC and GDB/binutils " Richard Earnshaw
2025-09-23 17:03 ` Simon Marchi
2025-09-24 8:23 ` Jonathan Wakely
2025-10-01 14:44 ` Richard Earnshaw (lists)
2025-10-01 14:58 ` Simon Marchi
2025-10-01 15:22 ` Richard Earnshaw (lists)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox