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

Björn Schäpers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 23 12:26:52 PDT 2022


HazardyKnusperkeks added a comment.

Please mark things as done.



================
Comment at: clang/include/clang/Format/Format.h:297
   AlignConsecutiveStyle AlignConsecutiveDeclarations;
+  /// Style of aligning consecutive trailing comments.
+  ///
----------------
Run clang/docs/tools/dump_format_style.py.


================
Comment at: clang/include/clang/Format/Format.h:306
+  /// \endcode
+  /// \version ???
+  AlignConsecutiveStyle AlignConsecutiveTrailingComments;
----------------
16

I'm pretty sure we don't need longer than that. :)

But mention that it existed as `AlignTrailingComments` since 3.7. There should be examples for that in this file.


================
Comment at: clang/include/clang/Format/Format.h:385
   /// \version 3.7
   bool AlignTrailingComments;
 
----------------
Take a look at D127578.


================
Comment at: clang/lib/Format/Format.cpp:635
                      Style.SpaceBeforeParens);
+      IO.mapOptional("AlignTrailingComments", Style.AlignConsecutiveTrailingComments.Enabled);
     }
----------------
Please sort.


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