[clang] [clang-format] Add AlignConsecutiveEnums (PR #194154)

via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 27 05:41:57 PDT 2026


================
@@ -301,6 +301,17 @@ struct FormatStyle {
   /// \endcode
   /// \version 11
   AlignConsecutiveStyle AlignConsecutiveBitFields;
+  /// Style of aligning consecutive enum assignments.
+  ///
+  /// ``Consecutive`` will align the enum assignments of consecutive lines.
+  /// This will result in formattings like:
+  /// \code
+  ///   flag_aaaa = 1,
+  ///   flag_b    = 12,
+  ///   flag_ccc  = 8,
+  /// \endcode
+  /// \version 23
+  AlignConsecutiveStyle AlignConsecutiveEnums;
----------------
aaronsms wrote:

Sure this can be done, but note that `AlignConsecutiveMacros` is not sorted alphabetically.

https://github.com/llvm/llvm-project/pull/194154


More information about the cfe-commits mailing list