-
Notifications
You must be signed in to change notification settings - Fork 756
Special case for nested functions and classes (fixes #28) #555
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -118,6 +118,28 @@ def a(): | |
| a() | ||
| #: | ||
|
|
||
| #: E306:3:5 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks great to me, but could you maybe add some
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea @IanLee1521
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry for the delay. I'm not sure if okay tests apply here, because I just divided a set of already existent error types in two, so non-errors are still the same. |
||
| def a(): | ||
| x = 1 | ||
| def b(): | ||
| pass | ||
| #: E306:3:5 E306:5:9 | ||
| def a(): | ||
| x = 2 | ||
| def b(): | ||
| x = 1 | ||
| def c(): | ||
| pass | ||
| #: E306:3:5 E306:6:5 | ||
| def a(): | ||
| x = 1 | ||
| class C: | ||
| pass | ||
| x = 2 | ||
| def b(): | ||
| pass | ||
| #: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I didn't realize this was to prevent the test from being confused. |
||
|
|
||
| #: E305:8:1 | ||
| # Example from https://github.com/PyCQA/pycodestyle/issues/400 | ||
| import stuff | ||
|
|
||
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.
Would it make sense to store the result of
expand_indent(line)since you use it again in the next line?Could be the same with
line.strip()which is reused asline.lstrip()in L280.Uh oh!
There was an error while loading. Please reload this page.
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.
I decided to do it that way because it keeps the code shorter and the second evaluation is not very frequent.
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.
Fair enough, it's a minor nit anyways. :)
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.
Regarding another approach please read my last comments at the conversation tab.