napari / cookiecutter-napari-plugin

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

precommit config fails on `__init__.py` #169

Closed jo-mueller closed 10 months ago

jo-mueller commented 10 months 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 10 months 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 10 months 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.