-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Added a check to raise error on missing whitespace around arithmetic … #1143
Changes from 2 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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# pylint: disable=missing-docstring,invalid-name,unused-argument | ||
def sample_function(*args, **kwargs): | ||
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. How does this behave to operator with different priorities? For instance, PEP 8 recommends something as 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. pep8 throws an 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. Contradicting to the statement in the documentation 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. FWIW pycodestyle (which is what pep8 was renamed to) has E226 disabled by default. I think having it enabled by default in pylint would be a mistake. 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. In that case, should we have a separate error message for this which is disabled by default? 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. I think this could be made to work with some tweaking. I think this makes sense in the cases where both operands are not 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. @rowillia sure I will try it out.. Can you please explain a bit? |
||
pass | ||
|
||
a = 5*4 # [bad-whitespace] | ||
b = a* 20 # [bad-whitespace] | ||
b = 4 /20 # [bad-whitespace] | ||
c = 4 + 30 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
bad-whitespace:5::"Exactly one space required around arithmetic operator | ||
a = 5*4 # [bad-whitespace] | ||
^" | ||
bad-whitespace:6::"Exactly one space required before arithmetic operator | ||
b = a* 20 # [bad-whitespace] | ||
^" | ||
bad-whitespace:7::"Exactly one space required after arithmetic operator | ||
b = 4 /20 # [bad-whitespace] | ||
^" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
|
||
class MyClass(object): | ||
var1 = [] | ||
var2 = list(value*2 for value in var1) | ||
var2 = list(value * 2 for value in var1) |
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.
Can you check the indentation here? Seems to use tabs or it has too many spaces. Also, this uses the wrong section for the release, it should be the latest.
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.
Also, mind adding a new entry in What's New 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.
I have added it in the right location. Is that it? Or should it be added any where else too?