-
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
Very awkward line break for assert statements #1483
Comments
Seems rather similar to #1190. |
@ichard26 you're absolutely right, thanks for pointing out. I completely agree with #1190 and my example is probably even more compelling. I don't think this is even a philosophical design debate - there is no reasonable justification for this formatting:
If I commit this code, I'll surely be scolded by my manager (don't ask me how I know). |
Now I understand that Black has many concerns about backward compatibility and stuff - I don't mind forking Black and hacking the source code myself. @ichard26 could you please kindly point out which lines of code should I look at? |
Ahh, thanks for assuming that I can code well enough to modify |
@ichard26 no worries, thanks! |
@ichard26 do you know anyone who can help point me to the relevant lines in the source code? Thanks! |
@miriaford One of the core maintainers is probably your best bet. https://github.com/psf/black#authors |
|
|
. |
I'm not sure if this is a bug or feature, but it looks like a bug to me, or at least a super awkward behavior:
To Reproduce
Original lines:
Black:
Expected behavior
The above formatting does not make any sense to me. It is very awkward and reduces readability considerably. This is the expected formatting:
In fact, I can hack the correct behavior by adding a manual break inside the assert error string:
Original file (hack)
Black:
Still, if I remove the space between the adjacent strings, Black reverts back to the above behavior. I have lots of
assert
statements in my code and this becomes a really serious problem.Environment:
Does this bug also happen on master? Yes.
The text was updated successfully, but these errors were encountered: