black icon indicating copy to clipboard operation
black copied to clipboard

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

Open mandy6610 opened this issue 1 year ago • 2 comments

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 avatar Nov 22 '24 11:11 mandy6610

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

speco29 avatar Dec 06 '24 19:12 speco29