Skip to content

Use __all__ variable to indicate __init__ exports

Igor Ponomarev requested to merge igor.ponomarev/ci-collate:init-use-all into main

A lot of code analysis tools will mark the unused variables. Right now there is a comment in the __init__.py that disables the unused variable warning for ruff.

Instead of having to disable each linting tools individually use the __all__ variable to indicate that the variables exist in the file are for exports. Most linters will realise this and will no longer produce warnings.

https://docs.python.org/3/tutorial/modules.html#importing-from-a-package

Merge request reports

Loading