-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Closed
Labels
clang-formatquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!
Description
I'd like to format array initializer to be one item per line, instead of all items in one line.
Example
I want this:
static char *categories[] = {
"Alpha",
"Beta",
"Gamma",
"Delta",
"Epsilon",
"Zeta"
};
Not this:
static char *categories[] = {"Alpha", "Beta", "Gamma", "Delta", "Epsilon", "Zeta"};
There has been multiple question on stackoverflow with no way to achieve this:
https://stackoverflow.com/questions/69537052/clang-format-array-initializer-one-per-line
https://stackoverflow.com/questions/38058627/clang-format-array-initialisers
https://stackoverflow.com/questions/39144255/clang-format-removes-new-lines-in-array-definition-with-designators
https://stackoverflow.com/questions/75572012/clang-format-designated-initializer-one-member-per-line
Metadata
Metadata
Assignees
Labels
clang-formatquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!