-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Formatting of if condition can be improved. #649
Comments
@JelleZijlstra @ambv Pls check |
I agree that the formatting with index expressions on their own line isn't great and that your proposed formatting looks nicer in this case. I haven't looked at how realistic it is to implement in general though, and maybe this change would lead to worse formatting in some other case. |
We should at least try to make Black not choose to split on indexes if optional parentheses can yield nicer formattings. |
Still happen in version 19. It would be really nice improvement. |
Could any contributor please point us to how we can modify this behavior ourselves? I'm willing to fork Black and hack the source code. |
I believe this is essentially the same request as the newer #2156, which has some more discussion (though it was initially rejected) and associated PRs. I'll close this issue in favor of it! |
Operating system:
Mac OS X Mojave
Python version:
Python 3.6.7
Black version:
18.9b0
Does also happen on master: Yes
I have a piece of code which looks like
Upon running black on this
I get
Formatting of the
if
condition above is not readable.IMO the following would be more readable, which is done when there are 3 or more checks in
if
The text was updated successfully, but these errors were encountered: