First, let's update the version of clang-format we use in CI -- the current one is 9, which is quite old by now. Since then, some options have actually been changed such that upgrading changes the formatting slightly.
So while we're doing that, I suggest updating our AlignAfterOpenBracket option to BlockIndent, which will change this:
auto long_function_with_many_arguments(
arg1, arg2, arg3)
to this:
auto long_function_with_many_arguments(
arg1, arg2, arg3
) -> very_long<return_type<with_templates>>
This will also affect function calls (among other things) and make scope delineation clearer.
First, let's update the version of
clang-format
we use in CI -- the current one is 9, which is quite old by now. Since then, some options have actually been changed such that upgrading changes the formatting slightly.So while we're doing that, I suggest updating our
AlignAfterOpenBracket
option toBlockIndent
, which will change this:to this:
This will also affect function calls (among other things) and make scope delineation clearer.
(more info https://clang.llvm.org/docs/ClangFormatStyleOptions.html#alignafteropenbracket)
Once that is is done, I also suggest to update our brace wrapping after functions to
false
, since now we have that closing parenthesis.Both of those changes will make our functions to format very similarly to Rust standard format: