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

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 15 03:30:18 PDT 2023


MyDeveloperDay added inline comments.


================
Comment at: clang/lib/Format/Format.cpp:1372
   LLVMStyle.DerivePointerAlignment = false;
+  LLVMStyle.DesignatedInitializerIndentWidth = 4;
   LLVMStyle.DisableFormat = false;
----------------
so lets say someone is using an IndentWidth of 2 and now you introduce this as being 4 here as the default

Without them changing anything, all their DesignatedIntializer code will get refactored to a IndentWidth of 4 rather than the 2 it was previously

This is where we get called out for "changing the defaults", which really we are not we are just reclassifying how it behaves.

What we normally say here is can you point us to a public style that has an independent DesignatedIntializerIndentWidth which is independent from the levels of IndentWidth everywhere else.

Whilst I can see more knobs feels good, this will change code and we'll have to manage that expectation.





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