Issue 55475
Summary clang-format: Add AlignConsecutiveShortCaseLabels
Labels new issue
Assignees
Reporter Hedede
    I suggest adding an option to align consecutive short case labels.

I have code like this:

```c++
constexpr string_view describe(log::level level)
{
	switch (level) {
	case log::info:     return "info:     ";
	case log::warning:  return "warning:  ";
	case log::error:    return "error:    ";
	case log::critical: return "critical: ";
	default:            return "";
	};
}
```

clang-format formats removes all alignment like this:

```c++
constexpr string_view describe(log::level level)
{
	switch (level) {
	case log::info: return "info:     ";
	case log::warning: return "warning:  ";
	case log::error: return "error:    ";
	case log::critical: return "critical: ";
	default: return "";
	};
}
```

I want to keep the alignment.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to