[PATCH] D98237: [clang-format] Option for empty lines after an access modifier.

Max Sagebaum via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 23 08:03:57 PDT 2021


Max_S added a comment.

In D98237#2643815 <https://reviews.llvm.org/D98237#2643815>, @MyDeveloperDay wrote:

> If you follow people tweeting about clang-format (as I do) and you look through the bug tracking system, one major criticism of clang-format is that the second clang-format can be different from the first, sometimes an equilibrium can be found sometimes not.
>
> When I started working on clang-format I was encouraged to use verifyFormat() as it tests that scenario and also tries to mess up the format and ensure it returns to the desired state. It found bugs in my code which would have made clang-format worse.
>
> Apart from it being the convention I believe it makes for much more readable code, even if there is repetition as I don't need to keep cross referencing variables with rather obscure names `NL_B_3_A_0_I_0` this is unnecessary noise and makes the code overly verbose.
>
> No you'll need to check out what the messUp() function is actually doing but I think by and large IMHO we should stick with verifyFormat.

Ok then I will change the tests accordingly. This reasoning should be written down somewhere.

In D98237#2643880 <https://reviews.llvm.org/D98237#2643880>, @MyDeveloperDay wrote:

> I'd be quite interested to understand what the impact (if any) would be on javascript and C# formatting

I have not done anything in javascript a quick google search showed no such modifiers in classes. Do you have an example? C# seems to handle it like java and then the modifiers become properties of the functions member, there should be no influence.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98237/new/

https://reviews.llvm.org/D98237



More information about the cfe-commits mailing list