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

Marek Kurdej via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 31 08:09:26 PDT 2021


curdeius accepted this revision.
curdeius added a comment.
This revision is now accepted and ready to land.

LGTM, but please clean up the comments before landing.



================
Comment at: clang/docs/ClangFormatStyleOptions.rst:2132
+**EmptyLineAfterAccessModifier** (``EmptyLineAfterAccessModifierStyle``)
+  Defines in which cases to put empty line after access modifiers.
+  ``EmptyLineBeforeAccessModifier`` configuration handles the number of
----------------
Please apply this when landing.


================
Comment at: clang/unittests/Format/FormatTest.cpp:9289
+
+  // Check if MaxEmptyLinesToKeep is adhered
+  EXPECT_EQ("struct foo {\n"
----------------
Nit. Here and elsewhere.


================
Comment at: clang/unittests/Format/FormatTest.cpp:9546
+
+  Style.MaxEmptyLinesToKeep = 10u; // Both remove all new lines
+  Style.EmptyLineBeforeAccessModifier = FormatStyle::ELBAMS_Never;
----------------
Please rephrase/move the comment to be clear that it concerns ELBAMS/ELAAMS.


================
Comment at: clang/unittests/Format/FormatTest.cpp:9598
+                   "};\n",
+                   Style)); // Based on new lines in orignal document and not on
+                            // the setting
----------------
Nit.


================
Comment at: clang/unittests/Format/FormatTest.cpp:9605
+  // Newlines are keept if they are greater than zero,
+  // test::messUp removes all new lines which changes the logic
+  EXPECT_EQ("struct foo {\n"
----------------
Please end comments with full stops. Here and elsewhere.


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