[PATCH] D90232: [clang-format] Formatting constructor initializer lists by putting them always on different lines (update to D14484)
Marek Kurdej via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 8 00:19:38 PST 2020
curdeius requested changes to this revision.
curdeius added a comment.
This revision now requires changes to proceed.
I agree with @MyDeveloperDay that the existing tests should not be altered.
================
Comment at: clang/docs/ClangFormatStyleOptions.rst:1473
-**ConstructorInitializerAllOnOneLineOrOnePerLine** (``bool``)
- If the constructor initializers don't fit on a line, put each
- initializer on its own line.
+**ConstructorInitializer** (``ConstructorInitializerKind``)
+ Formatting of the constructor initializer.
----------------
MyDeveloperDay wrote:
> We can't easily remove an option once its been released, I know you have code to handle it, but I think it needs to remain in the documentation and hence the Format.h and somehow be marked deprecated otherwise someone is going to look at the documentation and say, I could of sworn I used to be able to use this setting...
I agree that `ConstructorInitializerAllOnOneLineOrOnePerLine` should be kept for backwards compatibility and translated to the new option `ConstructorInitializer`: `true` -> `BinPack` (`BestFit`) and `false` -> `Compact`, as it is done for example with `AlwaysBreakAfterDefinitionReturnType`.
================
Comment at: clang/docs/ClangFormatStyleOptions.rst:1481-1483
+ * ``CI_BestFit`` (in configuration: ``BestFit``)
+ Eiter all initializers are on a single line (it this fits),
+ otherwise every initializer has its own line.
----------------
Shouldn't that be called something like `BinPack` to match existing options (`BinPackArguments`, `BinPackParameters`)?
================
Comment at: clang/docs/ClangFormatStyleOptions.rst:1489-1500
true:
SomeClass::Constructor()
: aaaaaaaa(aaaaaaaa), aaaaaaaa(aaaaaaaa), aaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaa) {
return 0;
}
false:
----------------
Please modify examples.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D90232/new/
https://reviews.llvm.org/D90232
More information about the cfe-commits
mailing list