-
Notifications
You must be signed in to change notification settings - Fork 82
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
Don't remove imports from __init__.py #35
Comments
I think having such an option makes sense. It might be useful to get some metrics on how common this is. That would help us get an idea on whether this new behavior should be an option or the default. Currently, |
It's pretty standard: e.g., https://github.com/numpy/numpy/blob/master/numpy/linalg/__init__.py It's better to do it this way than to explicitly list things in the Also, I don't think it should be an option, or at least the option should default to true. Things imported by |
I agree, about the option setting. It makes sense to by default be conservative and not remove things. I'll accept a pull request to make such a change. Otherwise, I'll take a look in a few months when I'm less busy. Thanks! |
Thanks! |
Working on this issue, may I be assigned to it? Thanks! |
When used, this new CLI argument will cause autoflake to ignore unused imports when checking any __init__.py files. New tests have also been added to accompany this new feature. Closes PyCQA#35
When used, this new CLI argument will cause autoflake to ignore unused imports when checking any __init__.py files. New tests have also been added to accompany this new feature. Closes PyCQA#35
When used, this new CLI argument will cause autoflake to ignore unused imports when checking any __init__.py files. New tests have also been added to accompany this new feature. Closes PyCQA#35
When used, this new CLI argument will cause autoflake to ignore unused imports when checking any __init__.py files. New tests have also been added to accompany this new feature. Closes PyCQA#35
When used, this new CLI argument will cause autoflake to ignore unused imports when checking any __init__.py files. New tests have also been added to accompany this new feature. Closes PyCQA#35
When used, this new CLI argument will cause autoflake to ignore unused imports when checking any __init__.py files. New tests have also been added to accompany this new feature. Closes PyCQA#35
When used, this new CLI argument will cause autoflake to ignore unused imports when checking any __init__.py files. New tests have also been added to accompany this new feature. Closes PyCQA#35
When used, this new CLI argument will cause autoflake to ignore unused imports when checking any __init__.py files. New tests have also been added to accompany this new feature. Closes PyCQA#35
Just a note, as I was having a similar issue and came here before but didn't find this info. You can exclude a single line adding a comment from .endpoints import role, token, user, utils # noqa I also submitted a PR adding that to the docs: #43 |
When used, this new CLI argument will cause autoflake to ignore unused imports when checking any __init__.py files. New tests have also been added to accompany this new feature. Closes #35
A typical way to set up a project is to have the modules specify
__all__
variables and then have the__init__.py
from .module_name import *
. This causes autoflake to remove all of the imports.Please consider leaving the imports in
__init__.py
.The text was updated successfully, but these errors were encountered: