Is it possible to obtain switch
statements formatted as:
switch (index) {
case 0: /* statement */ break;
case 1: /* statement */ break;
default: break;
}
with Clang-Format?
Is it possible to obtain switch
statements formatted as:
switch (index) {
case 0: /* statement */ break;
case 1: /* statement */ break;
default: break;
}
with Clang-Format?
Yes, you need to set
AllowShortCaseLabelsOnASingleLine
totrue
. You can experiment in real-time with your.clang-format
configuration on this great website: "clang-format-configurator".