]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Add .clang-format
authorTom Tromey <tom@tromey.com>
Fri, 21 Sep 2018 15:46:35 +0000 (09:46 -0600)
committerTom Tromey <tom@tromey.com>
Wed, 11 Feb 2026 14:53:01 +0000 (07:53 -0700)
commit0fb67a2cf68660cbda609ba57f1c179dc6373da3
treefac307b92e9095528341d98fb113d53508eb4473
parentf08ffbbf2691bad2d5df660ee644647687775f0c
Add .clang-format

This patch adds a .clang-format file to the gdb repository.

The resulting reformatting is what I'd describe as "ok but not great".
There are a few variances from our normal style, some discussed in
comments in the file, and some in the bug.

I've somewhat come around to the idea that some ugliness is
acceptable, particularly because I regularly see code that's already
ugly anyway -- either in formatting or along some other dimension.

I don't know of a way to enforce a particular version.  I have only
tried clang-format 18 with this particular file, though Kevin Buettner
reported trying 19-21 as well.  I've documented this in the file.

I used "AllowShortFunctionsOnASingleLine: InlineOnly" as previously
discussed.  I feel that the spirit of the GNU style is that vertical
space is free, and we should use "None" here.  (This goes against
something we previously decided on the list, though.)

The file is in the root directory for ease of use.

For the time being you should not bulk reformat files.  I think we
should have a flag day for this, but at some later point.  See the
earlier discussion for details.

New in v4:
* Comment fixes
* Remove ForEachMacros - no longer correct
* Remove IncludeCategories - no longer correct

New in v5:
* More fixes to the comments

New in v6:
* Removed 'StatementMacros' setting, we're no longer using
  PyObject_HEAD

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30098
Approved-by: Kevin Buettner <kevinb@redhat.com>
.clang-format [new file with mode: 0644]
.gitignore