Multi line if clauses #2599
Labels
F: linebreak
How should we split up lines?
R: duplicate
This issue or pull request already exists
T: style
What do we want Blackened code to look like?
Describe the style change
I write python modules that are configured by .yml files which look something like this:
After reading them in, they are addressed like a nested dictionary (see below). Then I write
if
clauses that check if a condition is to be checkedand
if the condition is fulfilled. Black messes that up a bit.Examples in the current Black style
Desired style
Additional context
Note that the line
complicated_settings_dict["Category_X"]["Subcategory_Y"]["Enable_Condition_Z"]
is only 86 characters long. I think black only wants to break it, because it wants to put theand
on the same line. Putting theand
on the next line (as for all binary operators) would make everything more readable in my opinion. In any case there is no reason here not to keep each condition I am checking for in its own single separate line.The text was updated successfully, but these errors were encountered: