Unify if/when condition formatting

This commit is contained in:
Joshua Warner 2024-12-01 17:54:39 -08:00
parent cfec120b13
commit 4a0dce714b
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
5 changed files with 69 additions and 78 deletions

View file

@ -0,0 +1,27 @@
When(
@5-6 SpaceAfter(
Var {
module_name: "",
ident: "n",
},
[
Newline,
LineComment(
"s",
),
],
),
[
WhenBranch {
patterns: [
@13-14 Tag(
"O",
),
],
value: @16-17 Num(
"1",
),
guard: None,
},
],
)

View file

@ -0,0 +1,3 @@
when n
#s
is O->1

View file

@ -657,6 +657,7 @@ mod test_snapshots {
pass/when_in_function_python_style_indent.expr,
pass/when_in_parens.expr,
pass/when_in_parens_indented.expr,
pass/when_newline_after_condition.expr,
pass/when_result_list.expr,
pass/when_with_alternative_patterns.expr,
pass/when_with_function_application.expr,