Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mandy6610 opened this issue Nov 22, 2024 · 1 comment
Labels
T: enhancement New feature or request

Comments

@mandy6610
Copy link

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]:

@mandy6610 mandy6610 added the T: enhancement New feature or request label Nov 22, 2024
@speco29
Copy link

speco29 commented Dec 6, 2024

i can correct it down, should i enhance it and give myself PR??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants