[PATCH] D14484: Formatting constructor initializer lists by putting them always on different lines

Daniel Jasper via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 4 02:14:52 PST 2016


djasper added a comment.

The Google and Unity style guides have explicit examples of using the one-line version. The other style guide (at least to me) isn't clear on forbidding what clang-format currently does.

My gut feeling is that it is not worth the cost of renaming and extending the current style option. If you are trying to convince ~70 people to use clang-format, there will be several things where it doesn't do 100% what the current practice is. However, this issue (like probably several of the others) is quite an infrequent issue with very limited impact on readability.


================
Comment at: unittests/Format/FormatTest.cpp:9753
@@ +9752,3 @@
+  CHECK_PARSE("ConstructorInitializer: false", ConstructorInitializer,
+              FormatStyle::CI_Compact);
+  CHECK_PARSE("ConstructorInitializer: true", ConstructorInitializer,
----------------
The reason we commonly accept true/false after migrating to an enum is so that the config files remain backwards compatible. If we rename the style attribute, however, more needs to be done to keep this backwards compatible. Setting the old name to true or false should set the corresponding value of the new name unless that one is explicitly set.


Repository:
  rL LLVM

http://reviews.llvm.org/D14484





More information about the cfe-commits mailing list