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
to true
. You can experiment in real-time with your .clang-format
configuration on this great website: "clang-format-configurator".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With