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
b9253c7d2089d3d159dcc10118ce5a219d9a6881 tools: clang-format 6 compatibility (Jon Atack)
Pull request description:
Our `.clang-format` settings inadvertently lost compatibility with Clang versions < 9 in #19095, including for Debian stable. This patch returns compatibility in the interim until the distros update. See discussion from https://github.com/bitcoin/bitcoin/pull/19095#issuecomment-651926138.
ACKs for top commit:
MarcoFalke:
Approach ACK b9253c7d2089d3d159dcc10118ce5a219d9a6881 , haven't tested
Tree-SHA512: 4af541a195f48d84ffb80e23aaefb624c66bc78f087c8d92b4af5a654420b69fedf25272c6e4fde2688ff88412d306b7a990ce1e15d8b24180374c625a253fb6
cc29d1e2c46e01c544ef44c79d72b7bcc5d39ba7 [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;
```
(https://github.com/bitcoin/bitcoin/pull/19090#discussion_r431961148)
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 cc29d1e2c46e01c544ef44c79d72b7bcc5d39ba7 fine with me
practicalswift:
ACK cc29d1e2c46e01c544ef44c79d72b7bcc5d39ba7
Tree-SHA512: a62474925e71aaff41bdce7960fd5ffd64317da810f694d8084080b054708cf71c2ab2ce3111db5a9260d1c1f9e02d59a2ecb5543b1b6172ce085cb42432160a
131a8ceb7 Make clang-format use C++11 features (e.g. A<A<int>> instead of A<A<int> >) (practicalswift)
Tree-SHA512: e3c0ee683b654eae638deb41c52cf3187fa958dc5fa67778eaf8a83946b63f5b1d24c47bb965eaa910e3fcdcaf9eebf461eb3fc8e3a73ebaf03c7904521fda00