-
Notifications
You must be signed in to change notification settings - Fork 70
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
Incorrect indentation for functions with end paren on a separate line. #126
Comments
Thanks for the report. See #127. Not sure if this won't break other things - at least it was testing for this behavior previously. JFI: it is only looking upward, so it does not matter if the closing paren is on the first level / not indented - but it will indent like you expect it to. |
Thanks |
Just a heads up, this change results in the following auto indentation
Which should be
per https://www.python.org/dev/peps/pep-0008/#indentation
This is why I mentioned the end parenthesis specifically. In the case where the ending parenthesis is on the same line as the last argument, the double indentation is correct. |
I see. |
That would be satisfactory to me. Even if the indentation doesn't work as I type, it would be nice if when I select a block like this and auto-indent it
I'd get this
By the way, I really appreciate you taking the time to look into this and converse with me. |
👍 |
With
to
(with the cursor at |
Let me know how it works for you, happy to follow up more on this.. :) |
This is beautiful. Thanks again for being so responsive. |
You're welcome - thanks for the detailed report in the first place.. :) Initially I've thought that it should look for the matching closing parenthesis via Let me know any findings, and we can have more tests / fixes here.. ;) |
Hope it's working well still.. :) Just found that this also should be handled for type annotations in a similar way / just for reference: #130 |
PEP8 indentation style is funny.
But I still think the above looks a bit better than
or
😄 😄 😄 |
So you prefer 1 over 2? IIRC this was changed to use 2 instead of 1 here. |
Yeah, I know, it's just my preference. I use
in function/class definitions, and use
when I'm calling them. |
There doesn't seem to be a consensus on this topic. The pylint team seams to be against this: I don't know if this goes against the spirit of this plugin, but would it be possible to parameterize this feature using a global flag? Like I would be happy to make the PR, if the maintainers don't mind. |
Before auto indentation
After auto indentation
There is no reason for the extra indentation if the argument list's closing parenthesis is on its own line.
The text was updated successfully, but these errors were encountered: