Merge #19095: [tools] Update clang-format config for multi-line function declarations and calls

cc29d1e2c4 [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 cc29d1e2c4 fine with me
  practicalswift:
    ACK cc29d1e2c4

Tree-SHA512: a62474925e71aaff41bdce7960fd5ffd64317da810f694d8084080b054708cf71c2ab2ce3111db5a9260d1c1f9e02d59a2ecb5543b1b6172ce085cb42432160a
This commit is contained in:
MarcoFalke 2020-06-21 05:57:48 -04:00
commit e6f807f87c
No known key found for this signature in database
GPG key ID: CE2B75697E69A548

View file

@ -1,9 +1,10 @@
Language: Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: false
AlignAfterOpenBracket: true
AlignEscapedNewlinesLeft: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowAllArgumentsOnNextLine : true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All