-
Notifications
You must be signed in to change notification settings - Fork 610
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
Lint unused imports in init modules #447
Conversation
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.
Good find, thanks for fixing this.
No idea why pylint is failing. The module is empty and nothing in the |
@c24t Didn't you already work-around a very similar issue once? |
IIRC something like this for % pylint examples/http/
************* Module http
examples/http/__init__.py:2:0: W0611: Unused namedtuple imported from collections (unused-import)
-----------------------------------
Your code has been rated at 9.83/10 Same error (but only one of two?) for built-in % pylint $(python -c "import http; print(http.__file__)")
************* Module http
/root/.pyenv/versions/3.8.1/lib/python3.8/http/__init__.py:5:0: E0102: class already defined line 5 (function-redefined)
/root/.pyenv/versions/3.8.1/lib/python3.8/http/__init__.py:2:0: W0611: Unused namedtuple imported from collections (unused-import)
-----------------------------------
Your code has been rated at 9.12/10 Changing the name "fixes" the problem: % mv examples/http/ examples/http_too/
% pylint examples/http_too/
------------------------------------
Your code has been rated at 10.00/10 |
FWIW changing pylint's confidence threshold fixes this too, but I'm not sure what other errors that might mask: % pylint --confidence=INFERENCE_FAILURE examples/http/
-------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 9.83/10, +0.17) |
This is currently not working with pylint so long as we have modules with conflicting names. Closing for now. |
Fixing this would require extensive renaming or fixing pylint's name resolution problems. |
See #446 (comment).