[PATCH] D22505: clang-format Access Modifier Use Normal Indent

Loki Astari via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 25 11:55:21 PDT 2016


LokiAstari added a comment.

Hope you don't mind me chiming in:

> Roughly go ahead with what you are suggesting, although the option should not be called AccessModifierStandardIndent, as that carries no meaning and actually is far from the "standard" way. Reasonable names that spring to mind are:


Though I personally disagree on the more standard technique :-)  Since I am the newbie to this I am not going to fight on that point (though I suspect if we meet up for some beers we could have a spirited debate).

> AccessModifiersCauseAdditionalIndent or (Additional)IndentAfterAccessModifiers.


How about "AccessModifiersUseNormaIndent" as we are indenting by a normal indent width. But I am not going to fight over the name when it comes down to it.

> Be even more "clever" with AccessModifierOffset (I can come up with various ways from negative numbers to special numbers, none of them really good).


I don't think this is a good idea (but as the newbie no strong feelings). Unfortunately a lot of large projects have stated using this is a standard part of their formatting; got to this project too late to prevent that :-O

> Deprecate AccessModifierOffset and instead use an enum with a few dedicated settings.


The issue with this is getting all projects to update their settings with the new version. Not sure this is a great user experience.


https://reviews.llvm.org/D22505





More information about the cfe-commits mailing list