From 6bcc86ad3b848036ae26183b9b0c3380bf2c1ace Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Fri, 19 Feb 2021 11:28:36 +0100 Subject: [PATCH] Merge #21221: [tools] Allow argument/parameter bin packing in clang-format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 876ac3f6b62087fb5c22b0a477751895915d47b8 [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 876ac3f6b62087fb5c22b0a477751895915d47b8 MarcoFalke: review ACK 876ac3f6b62087fb5c22b0a477751895915d47b8 vasild: ACK 876ac3f6b62087fb5c22b0a477751895915d47b8 Tree-SHA512: 7c401b4551b458c83dd70883860788b4a60e08a5399171fef27a2f5fdc6b933f6454fe0d396c32d826e3ab537791329da3275ae9b5e9ad36630a6dc2c167e88f --- src/.clang-format | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/.clang-format b/src/.clang-format index 73515a234b..8b717d1190 100644 --- a/src/.clang-format +++ b/src/.clang-format @@ -14,7 +14,7 @@ AllowShortLoopsOnASingleLine: false AlwaysBreakBeforeMultilineStrings: false AlwaysBreakTemplateDeclarations: true BinPackArguments: true -BinPackParameters: false +BinPackParameters: true BreakBeforeBinaryOperators: None BreakBeforeBraces: Custom BraceWrapping: