-
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
inline comments make subscription look really bad #1125
Comments
It's hard to do in the general sense because the comment might have some meaning attached to that line (think code analysis tools like flake8 or mypy), and so moving the comment might change that meaning. |
Related to #1187 I don't know the internals, but if other code analysis tools got simple functions to return all possible pragmas, a feasible solution is to add those to a "dont split inline comment" rule. |
@zsol The existing behaviour creates the same issue in many cases - if not most/all. I really think black should leave inline comments be. As I described in #1187 (comment) inline comments are probably inline for a reason. Code analysis tool is a very strong argument. |
Ok, inline comments should stay inline. But are inline comments handled consistently? # in:
a = 1/3 # Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
b = (
0.333333333333333333333333333333333333333333333333333333333333
) # Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
# out:
a = (
1 / 3
) # Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
b = 0.333333333333333333333333333333333333333333333333333333333333 # Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor Here, Black is clearly doing a terrible job in reducing the max line length. The introduction of parenthesis for |
input:
actual output (v19.10b0):
desired output:
Instead of wrapping long lines so weird, do you think it would be feasible to just move these comment above instead?
The text was updated successfully, but these errors were encountered: