[PATCH] D78982: [clang-format] Fix Microsoft style for C++ enums

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 29 08:00:57 PDT 2020


MyDeveloperDay added inline comments.


================
Comment at: clang/docs/ClangFormatStyleOptions.rst:721
-
-**InsertTrailingCommas** (``TrailingCommaStyle``) can be set to ``TCS_Wrapped``
-  to insert trailing commas in container literals (arrays and objects) that wrap
----------------
asmith wrote:
> MyDeveloperDay wrote:
> > ? are you removing something?
> These are changes from running the python script to regenerate the docs. Someone forgot to run the script. This info is no longer in the header.
If a change isn't related to your feature, simply ignore it, but don't include other changes in yours. If this has truly gone then we need to handle that separately


================
Comment at: clang/lib/Format/Format.cpp:1143
   Style.PenaltyReturnTypeOnItsOwnLine = 1000;
+  Style.AllowShortEnumsOnASingleLine = (Language != FormatStyle::LK_Cpp);
   Style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_None;
----------------
asmith wrote:
> MyDeveloperDay wrote:
> > I think its ok to leave it was, just if up the unit tests
> > 
> > (the fact you didn't see this suggests you are not running the unit tests please ensure you are)
> You need to use the latest changes. The is only applied when the style is Msft and C++. See the GetMicrosoftStyle() method.
I don't think you should change the style based on the language here, either on or off, but not changing based on language because what about "ObjectiveC"?

As I added the Microsoft style to allow C# development I think its ok to set this to what you originally had, but fix up the tests


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

https://reviews.llvm.org/D78982





More information about the cfe-commits mailing list