[PATCH] D132131: [clang-format] Adds a formatter for aligning trailing comments over empty lines

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 5 06:17:53 PDT 2022


MyDeveloperDay added a comment.

My personal preference is a new struct without Enabled



================
Comment at: clang/lib/Format/Format.cpp:1196
   LLVMStyle.AlignConsecutiveMacros = {};
+  LLVMStyle.AlignConsecutiveTrailingComments = {};
+  LLVMStyle.AlignConsecutiveTrailingComments.Enabled = true;
----------------
Won’t you need to initialise the members here as above


================
Comment at: clang/unittests/Format/FormatTestComments.cpp:2908
+  Style.MaxEmptyLinesToKeep = 0;
+  EXPECT_EQ("int a;   // comment\n"
+            "int ab;  // comment\n"
----------------
Any reason why these are not verifyformats.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132131



More information about the cfe-commits mailing list