You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a "dot-chain" extends over the line length, black does different line breaks depending on a number of parameters that I don't fully understand, but I think include e.g.
Whether elements of the chain have brackets (i.e. We are choosing an element from a list or a map)
Whether the chain is standalone, or a function argument.
Possibly the target python version
Simply breaking before or after the dot seems very sensible, but black sometimes does this, sometimes not, even if the line length limit is broken. Beyond that, breaking inside the brackets can make sense, but only if other reasons dictate it. I don't know whether all of this is by design or not, just bringing it up in case it can be changed and improved. As it currently stands, black insists on a style that causes errors in pycodestyle, i.e. Even if I manually break the line, black will in certain cases change it back to being unbroken and crossing the line length limit.
Describe the style change
When a "dot-chain" extends over the line length, black does different line breaks depending on a number of parameters that I don't fully understand, but I think include e.g.
Simply breaking before or after the dot seems very sensible, but black sometimes does this, sometimes not, even if the line length limit is broken. Beyond that, breaking inside the brackets can make sense, but only if other reasons dictate it. I don't know whether all of this is by design or not, just bringing it up in case it can be changed and improved. As it currently stands, black insists on a style that causes errors in pycodestyle, i.e. Even if I manually break the line, black will in certain cases change it back to being unbroken and crossing the line length limit.
Examples in the current Black style
1: Breaks line length limits:
2: Unnecessarily verbose breaking:
Desired style
1:
2:
Additional context
Current example where line is broken "sensibly":
The text was updated successfully, but these errors were encountered: