[cfe-dev] [clang-format] Allow custom BraceWrapping to be based on existing BreakBeforeBraces style

Oleksandr Koval via cfe-dev cfe-dev at lists.llvm.org
Wed Jan 6 09:14:48 PST 2021


My current .clang-format uses *BreakBeforeBraces: Allman* but it doesn't
break before the lambda body. In clang-format-11 there's a
*BraceWrapping.BeforeLambdaBody* option for that. However, it requires
*BreakBeforeBraces:
Custom* and now I need to specify 17 parameters to get Allman + break
before lambda behavior. Possible solutions to this:
1. Fix Allman style to break before the lambda body.
2. Don't require *BreakBeforeBraces: Custom* and allow *BraceWrappingFlags*
to override selected *BreakBeforeBracesStyle*.
3. Keep *BreakBeforeBraces: Custom* requirement but introduce
*BraceWrappingFlags.BasedOnStyle* option. It will work just as the 2nd
option but in a non-breaking-change way, e.g. in existing configs with both
non-Custom BreakBeforeBraces and BraceWrapping options the latter will be
ignored.

If this is not the right place for a feature request please point me in the
right direction.
-- 
Regards,
Oleksandr Koval.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20210106/fe0f5440/attachment.html>


More information about the cfe-dev mailing list