Hi all,
I've been playing around with the clang for a while now and really enjoy it. Unfortunately clang-format does not yet do what I like it to do, so I started hacking it. So here is my first successful attempt to get something working.
The issue: ConstructorInitializerAllOnOneLineOrOnePerLine only works if 'If the constructor initializers don’t fit on a line', while I prefer it to always work. In other words, I use the following formatting:
Constructor() : a(a) , b(b)
Since everyone can benefit from upstreaming, I like to share my changes and get some feedback.
Here is already some of the stuff which I was uncertain about:
- Should I keep ConstructorInitializerAllOnOneLineOrOnePerLine or rename it (currently the second one)
- How to name the values, currently: Compact (old: false), BestFit (old: true), OnePerLine (new)
- Is the back-ward compatibility in ScalarEnumerationTraits a good idea? (On rename most likely not)
JVApen
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.