[PATCH] D54628: Extend format with AllowShortEnumsOnASingleLine option

Florian Kauer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 16 04:36:54 PST 2018


koalo created this revision.
koalo added reviewers: djasper, rsmith.
Herald added a subscriber: cfe-commits.

Before, clang-format has tried to put enums on a single line whenever possible (unless in styles where the opening brace was put on a seperate line anyway).
AllowShortEnumsOnASingleLine that defaults to true (matching the conventional behaviour) can be set to false to force enums on multiple lines.

This feature is requested from time to time, e.g. here <https://stackoverflow.com/questions/23072223/clang-format-style-options-for-enums>, and should be unobtrusive for users that do not set this option to false.


Repository:
  rC Clang

https://reviews.llvm.org/D54628

Files:
  clang/docs/ClangFormatStyleOptions.rst
  clang/include/clang/Format/Format.h
  clang/lib/Format/Format.cpp
  clang/lib/Format/TokenAnnotator.cpp
  clang/unittests/Format/FormatTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54628.174355.patch
Type: text/x-patch
Size: 6324 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181116/69bfa993/attachment-0001.bin>


More information about the cfe-commits mailing list