Skip to content

Commit

Permalink
clang-format AlwaysBreakAfterReturnType to TopLevelDefinitions
Browse files Browse the repository at this point in the history
The previous value of TopLevel meant that the function name of
declarations would also be on a new line.  THis does not match the
current formatting of headers.

Manual testing done on c-common.h.

Also set BraceWrapping.BeforeWhile to true to match the formatting
specified for do/while loops in GNU coding standards.
https://www.gnu.org/prep/standards/standards.html#Formatting

Ok for trunk?

contrib/ChangeLog:

	* clang-format: AlwaysBreakAfterReturnType set to
	TopLevelDefinitions and BraceWrapping.BeforeWhile set to true.

Signed-off-by: Matthew Malcomson <[email protected]>
  • Loading branch information
mmalcomson committed Dec 9, 2024
1 parent 5a507b5 commit 0c83096
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion contrib/clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
---
Language: Cpp
AccessModifierOffset: -2
AlwaysBreakAfterReturnType: TopLevel
AlwaysBreakAfterReturnType: TopLevelDefinitions
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
Expand All @@ -42,6 +42,7 @@ BraceWrapping:
AfterUnion: true
BeforeCatch: true
BeforeElse: true
BeforeWhile: true
IndentBraces: true
SplitEmptyFunction: false
BreakBeforeBinaryOperators: All
Expand Down

0 comments on commit 0c83096

Please sign in to comment.