[clang] [clang-format] Add AlignAfterOpenBracketOptions (PR #108332)

Gedare Bloom via cfe-commits cfe-commits at lists.llvm.org
Sat Dec 14 12:49:21 PST 2024


gedare wrote:

> I don't think this is the way to go, or at least not with this name.
> 
> How about going the `Custom` way?

Adding a `Custom` option to `AlignAfterOpenBracket` is an interesting proposal. There have been some ideas floated in other Issues and PRs related to this, for example:
* #118046 
* #80049

My concern with a `Custom` option is what to include. At this point it could be an enumeration of the different kinds of blocks (functions, if/else, for, other) and the different kinds of openers (parens, braces, square brackets, angles), and  alignment of the parameters (`Align`, `DontAlign`), and breaking behavior (`DontBreak`, `AlwaysBreak` or better yet `InitialBreak` and `BlockIndent` or better `LastBreak`). 

At the moment, these alignment and breaking options are fairly complex and bug-prone.

 

https://github.com/llvm/llvm-project/pull/108332


More information about the cfe-commits mailing list