[PATCH] D133589: [clang-format] JSON formatting add new option for controlling newlines in json arrays

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 10 06:04:56 PDT 2022


MyDeveloperDay added inline comments.


================
Comment at: clang/docs/ClangFormatStyleOptions.rst:3115
 
+**JsonMultilineArrays** (``Boolean``) :versionbadge:`clang-format 16`
+  If ``true``, clang-format will always break after a Json array `[`
----------------
MyDeveloperDay wrote:
> curdeius wrote:
> > Why limiting to JSON only?
> > Could we name it in a general fashion (we comment that it's JSON only for the time being). I believe it may be an interesting option for various languages.
> > 
> > How about BreakMultilineArrays, or just BreakArrays to follow the naming of existing options a bit?
> I'm going to change the name to be `BreakArrays` but I'm not 100% sure who it might help other languages, but maybe we can look at this afterwards so having a good name now will help us later on.
> Why limiting to JSON only?

I'm slightly wondering if it would get over rrules by code later on, but we could try I guess, I think we'd need to handle the [] / {} separately I think.




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

https://reviews.llvm.org/D133589



More information about the cfe-commits mailing list