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

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

shirley breuer via cfe-dev
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.

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: [clang-format] Allow custom BraceWrapping to be based on existing BreakBeforeBraces style

shirley breuer via cfe-dev
Hi,

please take a look at https://reviews.llvm.org/D94906 if that's what you need.
If possible please provide a link to a definition of Allman for Lambdas. A quick
search did not result in anything.

Kind regards,
Björn.

Am 06.01.2021 um 18:14 schrieb Oleksandr Koval via cfe-dev:

> 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.
>
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev