napari / cookiecutter-napari-plugin

Cookiecutter for napari plugins
BSD 3-Clause "New" or "Revised" License
69 stars 41 forks source link

precommit config fails on `__init__.py` #169

Closed jo-mueller closed 1 year ago

jo-mueller commented 1 year ago

The current pre-commit config throws a failed check on every __init__.py file:

src/my_plugin/__init__.py:3:15: F401 [*] `._my_module` imported but unused
Czaki commented 1 year ago

Did you define __all__ in your file? Good programming practices require the explicit export of imported symbols.

An example of per-file ignore configuration can be found here:

https://github.com/napari/napari/blob/2f6c7073709a10e1e46e113e50ca298dfadb715f/pyproject.toml#L122-L130

jo-mueller commented 1 year ago

@Czaki , thanks for the hint about including __all__ in the init - that should probably fix it. I wasn't aware that it was good practice. Thanks for the hint - will close this then.