[llvm] [UTC] Indent switch cases (PR #165212)
Kunqiu Chen via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 27 05:23:55 PDT 2025
================
@@ -260,9 +260,14 @@ def update_test(ti: common.TestInfo):
skip_same_checks=dropped_previous_line,
):
# This input line of the function body will go as-is into the output.
- # Except make leading whitespace uniform: 2 spaces. 4 for debug records.
+ # Except make leading whitespace uniform: 2 spaces. 4 for debug records/switch cases.
indent = (
- " " if not common.IS_DEBUG_RECORD_RE.match(input_line) else " "
+ " " * 4
+ if (
+ common.IS_DEBUG_RECORD_RE.match(input_line)
+ or common.IS_SWITCH_CASE_RE.match(input_line)
----------------
Camsyn wrote:
> I'd also consider gating this under a new UTC version. I think this will produce just enough test churn to be annoying.
Do you mean some change like this?
```suggestion
or (
ti.args.version > 4
and common.IS_SWITCH_CASE_RE.match(input_line)
)
```
https://github.com/llvm/llvm-project/pull/165212
More information about the llvm-commits
mailing list