-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
acceptedReady for implementationReady for implementationformatterRelated to the formatterRelated to the formatter
Milestone
Description
Given:
with (
open('file') # trailing
):
pass
while (
True # trailing
):
pass
match (
some # trailing
):
case (
pattern # trailing
):
passFormatted as:
with open("file"): # trailing
pass
while (
True # trailing
):
pass
match (
some # trailing
):
case (
pattern # trailing
):
passNotice that for with and case pattern the formatting is not collapsed while it does happen for the rest. The case pattern formatting was adopted from with which is the reason they both are the same.
I think the reason is that the nodes are different i.e, WithItem and Pattern* for with and case pattern while it's an expression for while which can utilize the maybe_parenthesized_expression helper directly.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
acceptedReady for implementationReady for implementationformatterRelated to the formatterRelated to the formatter