[PATCH] D54628: Extend format with AllowShortEnumsOnASingleLine option

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 14 07:21:44 PST 2019


MyDeveloperDay added a subscriber: mitchell-stellar.
MyDeveloperDay added a comment.

Thanks for rebasing, I think this is a good idea I'm just not sure about how the option presents itself, would you consider changing it?



================
Comment at: clang/lib/Format/TokenAnnotator.cpp:3109
     return Right.HasUnescapedNewline;
+  if (isAllmanBrace(Left) && !Style.AllowShortEnumsOnASingleLine &&
+      (Line.startsWith(tok::kw_enum) ||
----------------
would you be happy to consider this being something like this instead?

`if (isAllmanBrace(Left) && Style.BraceWrapping.AfterEnum == FormatStyle::BWAE_Attach &...`


There is now precedent for the BraceWrapping styles to be an enum (see work by @mitchell-stellar who did something similar for `AfterControlStylement`)


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

https://reviews.llvm.org/D54628





More information about the cfe-commits mailing list