flake8-future-import icon indicating copy to clipboard operation
flake8-future-import copied to clipboard

Optionally don't enforce checker on `__init__.py`

Open arclabs561 opened this issue 9 years ago • 3 comments

__init__.py shouldn't be considered code, or at least it should be considered differently.

It doesn't make sense to enforce print_function, division on a file that only contains imports, a docstring, and perhaps __all__.

Perhaps a better option would be, don't enforce for an __init__.py file only having some subset of {imports, docstrings, comments, all = ...}?

Another option would be to have a separate --select or --ignore for __init__.py files.

arclabs561 avatar Feb 07 '17 03:02 arclabs561

require-code=True solves this for empty __init__ files

cleder avatar Sep 28 '18 15:09 cleder

If you don't want a specific error on non-empty __init__.py just add it to your per-file-ignores.

labrys avatar Apr 07 '19 20:04 labrys

Should the require-code option also ignore imports?

DylanYoung avatar Jul 08 '20 19:07 DylanYoung