-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Description
Bugzilla Link | 43901 |
Version | unspecified |
OS | Windows NT |
Reporter | LLVM Bugzilla Contributor |
CC | @mydeveloperday |
Extended Description
I was wondering if it would be possible to add an option to always break constructor initializers. For example:
AlwaysBreakConstructorInitializers (booL)
if true, always break the constructor initializer list, regardless if they can all fit on a single line (the style is dictated by BreakConstructorInitializers:
true:
Constructor() :
initializer1(),
initializer2()
false:
Constructor() : initializer1(), initializer2()
IMO... clang-format works too hard to get everything to fit on a single line, but this specific instance really makes the code hard to read. It also makes it had to add // NOLINT tags as clang-format will move the comment around. For example:
Constructor() : // NOLINT
initializer1(),
initializer2()
becomes
Constructor() :
// NOLINT
initializer1(),
initializer2()