Skip to content

Commit f1c2f61

Browse files
author
MarcoFalke
committed
Merge #21221: [tools] Allow argument/parameter bin packing in clang-format
876ac3f [tools] Allow argument/parameter bin packing in clang-format (John Newbery) Pull request description: clang-format documentation for BinPackArguments: If `false`, a function call’s arguments will either be all on the same line or will have one line each. ``` true: void f() { f(aaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa); } false: void f() { f(aaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa); } ``` https://clang.llvm.org/docs/ClangFormatStyleOptions.html#configurable-format-style-options There's no reason to forbid this format. Having multiple arguments or parameters per line can be just as readable as having one per line (and is certainly more readable than having extremely long lines). ACKs for top commit: laanwj: ACK 876ac3f MarcoFalke: review ACK 876ac3f vasild: ACK 876ac3f Tree-SHA512: 7c401b4551b458c83dd70883860788b4a60e08a5399171fef27a2f5fdc6b933f6454fe0d396c32d826e3ab537791329da3275ae9b5e9ad36630a6dc2c167e88f
2 parents f093310 + 876ac3f commit f1c2f61

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/.clang-format

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ AllowShortIfStatementsOnASingleLine: true
1111
AllowShortLoopsOnASingleLine: false
1212
AlwaysBreakBeforeMultilineStrings: false
1313
AlwaysBreakTemplateDeclarations: true
14-
BinPackParameters: false
14+
BinPackArguments: true
15+
BinPackParameters: true
1516
BreakBeforeBinaryOperators: false
1617
BreakBeforeBraces: Custom
1718
BraceWrapping:

0 commit comments

Comments
 (0)