-
Notifications
You must be signed in to change notification settings - Fork 17
Pylint: global-statement, no-else-raise, unneccessary-pass #5
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
Comments
Yes, you should be able to remove the (object) from the class line. It's a python2ism that got here somehow.
I don't believe the global piece is needed either because the if doesn't create a new scope. I'd disable those pylint checks by adding a comment at the end of the relevant line, which should limit that disable to the single line.
This seems similar to the Here is the similar return case: if foo:
return True
else:
return bar Should be: if foo:
return True
return bar
Returning NotImplementedError would be ok but isn't related to the lint error. For things that define a new block ( |
@tannewt Thanks! That was actually quite informative. I'll make the changes you've suggested. |
This is completed. |
Here's pylint's output:
As far as the useless-object-inheritance goes, @brentru I should be able to do the same thing you did in adafruit/Adafruit_CircuitPython_CursorControl#17, correct?
For global-statement and import-outside-toplevel, here's the offending code:
If I understand correctly, this checks if the board is a circuitpython board and if it isn't, it imports serial, although I'm not sure why line 143 is necessary.
For no-else-raise:
I'm not sure why this is an issue, it makes sense to me why this would be done, although I don't understand this code well enough to make an informed decision on that.
For unneccessary-pass
Unless there's some weird python mechanic I don't understand going on here, I think that this would be the right place to raise a NotImplementedError.
Referencing main issue: adafruit/Adafruit_CircuitPython_Bundle#232
The text was updated successfully, but these errors were encountered: