Skip to content

Commit e6f807f

Browse files
author
MarcoFalke
committed
Merge bitcoin#19095: [tools] Update clang-format config for multi-line function declarations and calls
cc29d1e [tools] Update clang-format config (John Newbery) Pull request description: In some cases, running clang-format has made code _less_ readable by joining declarations and calls for functions with many arguments into very long lines. For example: ``` - size_t getQueueInfo(std::chrono::system_clock::time_point &first, - std::chrono::system_clock::time_point &last) const; + size_t getQueueInfo(std::chrono::system_clock::time_point& first, std::chrono::system_clock::time_point& last) const; ``` (bitcoin#19090 (comment)) This change to clang-format would allow arguments/parameters for func declarations/calls to be split over multiple lines, aligned with the opening parens. It does not force args/params to be on new lines (that setting is `BinPackParameters : true`). ACKs for top commit: MarcoFalke: ACK cc29d1e fine with me practicalswift: ACK cc29d1e Tree-SHA512: a62474925e71aaff41bdce7960fd5ffd64317da810f694d8084080b054708cf71c2ab2ce3111db5a9260d1c1f9e02d59a2ecb5543b1b6172ce085cb42432160a
2 parents 02b26ba + cc29d1e commit e6f807f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/.clang-format

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
Language: Cpp
22
AccessModifierOffset: -4
3-
AlignAfterOpenBracket: false
3+
AlignAfterOpenBracket: true
44
AlignEscapedNewlinesLeft: true
55
AlignTrailingComments: true
6-
AllowAllParametersOfDeclarationOnNextLine: false
6+
AllowAllArgumentsOnNextLine : true
7+
AllowAllParametersOfDeclarationOnNextLine: true
78
AllowShortBlocksOnASingleLine: false
89
AllowShortCaseLabelsOnASingleLine: true
910
AllowShortFunctionsOnASingleLine: All

0 commit comments

Comments
 (0)