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

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 10 03:04:54 PST 2021


MyDeveloperDay added a comment.

Just out of interest and we are supposed to ask for this but can you point to public style guide that uses this style.   (actually I don't mind if other formatting tools have this capability and you highlight it, like astyle or editorConfig etc)

>From my perspective this seems like a reasonable suggestion. (even if I'm unlikely to use it myself ;-))



================
Comment at: clang/unittests/Format/FormatTest.cpp:9205
+               "};";
+  EXPECT_EQ(test1NL, format(test0NL));
+  verifyFormat(test1NL);
----------------
why can't you just verifyFormat them all?


================
Comment at: clang/unittests/Format/FormatTest.cpp:9212
+  StyleWithLine.EmptyLinesAfterAccessModifier = 1u;
+  EXPECT_EQ(test2NL, format(test0NL, StyleWithLine));
+  EXPECT_EQ(test2NL, format(test1NL, StyleWithLine));
----------------
yeah I'm not a fan of this like this... sorry... just write the test out in long form, when it goes wrong I don't have to be a compiler to understand what is going wrong I can just see it.


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