[PATCH] D146101: [clang-format] Add DesignatedInitializerIndentWidth option.

Jon Phillips via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 30 07:07:14 PDT 2023


jp4a50 added a comment.

So at the risk of adding to the number of decisions we need to come to a consensus on, I was about to update the KJ style guide to explicitly call out the difference in indentation for designated initializers when I realized that we (both KJ code authors and clang-format contributors) should consider whether users should have the option to configure other similar types of indentation following opening braces.

I chatted to the owner of the KJ style guide and, whilst he did not have extremely strong opinions one way or another, he and I agreed that it probably makes more sense for such a config option to apply to other types of braced init lists.

Broadly speaking, these include aggregate initialization and list initialization (possibly direct initialization with braces too). See the initialization <https://en.cppreference.com/w/cpp/language/initialization> cppref article for links to all these.

As such, I would propose to actually rename `DesignatedInitializerIndentWidth` to `BracedInitializerIndentWidth` (but open to suggestiosn on exact naming) and have it apply to all the above types of initialization.

What does everyone think?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146101/new/

https://reviews.llvm.org/D146101



More information about the cfe-commits mailing list