-
Notifications
You must be signed in to change notification settings - Fork 750
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
Support visual indent of continuation lines after with/assert/raise. #912
Conversation
print('foo') | ||
with open('/path/to/some/file/you/want/to/read') as file_1, \ | ||
open('/path/to/some/file/being/written', 'w') as file_2: | ||
file_2.write(file_1.read()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
none of these three align properly -- they should produce an error I believe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
they do.
not sure I understand the syntax of the test file actually... I added #: E127:4:...
and looks like tests pass
(the error is produced when manually testing as well)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😕 weird! I'll look into why that is and fix that up 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it work for more than one line continuation as well? |
"with" is likely the most common case, and this indentation is explicitly given as example by PEP8 (under "maximum line length").
Yes, added tests for that. |
"with" is likely the most common case, and this indentation is
explicitly given as example by PEP8 (under "maximum line length").
Closes #569.