-
Notifications
You must be signed in to change notification settings - Fork 892
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
yapf --style=pep8 produces E124 closing bracket does not match visual indentation #26
Comments
Confirmed in master. |
Interesting. Our version of pylint doesn't agree with PEP 8 on this. If I move the |
I think you're aware (not sure if you're talking pep8 the linter or pep8 the spec), but it seems pylint and pep8 the linter don't agree. Here's another example of yapf output:
This raises pep8 linter E124 "closing bracket does not match visual indentation". If I add another space to the last line, you instead get pylint C0330 "wrong continued indentation"! The pep8 spec says the following: "The closing brace/bracket/parenthesis on multi-line constructs may either line up under the first non-whitespace character of the last line of list [example1] or it may be lined up under the first character of the line that starts the multi-line construct [example2]". example1 shows this:
example2 (not relevant to this discussion really, just included for completeness):
It seems pylint & yapf are wrong, in this case. The pep8 linter error is correct. |
I think the test testClosingBracketIndent in reformatter_test.py is wrong, it claims this is correct layout:
|
@alexjurkiewicz It seems like this is a conflict between Google's version and PEP 8. I'll need to add a knob to control this... |
I added 9439278. Let's see if that fixes this for you. |
Beaut! Thanks @gwelymernans 👍 |
Reformatting the following valid (but gross) code:
Results in the following (better but invalid) code:
The text was updated successfully, but these errors were encountered: