Skip to content

Change the formatting behaviour when there is bracket in the if statement, like a list, a function #4516

@mandy6610

Description

@mandy6610

The problem

I'm always frustrated when formatting for a long if statement that involved in. So the if statement shall break with the "and", "or" keyword normally. However, if it is like a "key" in [array_item1, array_item2... ], it will break from the list and create a inconsistent layout with other if.

please think of every variable is with very long name
if a=b and c=d:
normally change to
if (
a=b
and c=d
):

but
if a=b and c in [d, e, f]:
it will change to
if a=b and c in [d,
e, f]:

Solution that I want to have
I hope that it will behave like other situation and become
if a=b
and c in [d, e, f]:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions