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
AllowShortCaseLabelsOnASingleLinetotrue. You can experiment in real-time with your.clang-formatconfiguration on this great website: "clang-format-configurator".