[PATCH] D93846: Add flag to suppress empty line insertion before access modifier

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 27 14:17:44 PST 2020


MyDeveloperDay added a comment.

Thank you for this patch, a few process issues.



================
Comment at: clang/include/clang/Format/Format.h:58
 
+  /// If true, the empty line is inserted before access modifiers
+  /// \code
----------------
you need to run clang/doc/tools/dump_style.py so that it regenerates the ClangFormatsStyleOptions.rst file


================
Comment at: clang/include/clang/Format/Format.h:68
+  /// \endcode
+  bool InsertEmptyLineBeforeAccessModifier;
+
----------------
quite a mouthful... maybe just `NewLineBeforeAccessModifier` ?


================
Comment at: clang/test/Format/access-modifiers.cpp:1
+// RUN: grep -Ev "// *[A-Z-]+:" %s \
+// RUN:   | clang-format -style="{BasedOnStyle: LLVM, InsertEmptyLineBeforeAccessModifier: true}" -lines=1:10 \
----------------
This is good to add, but could you also add a test in `clang/unittests/Format/FormatTests.cpp`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93846



More information about the cfe-commits mailing list