Skip to content

Commit

Permalink
Mention that unused-import skips __init__.py files
Browse files Browse the repository at this point in the history
- Explained why __init__.py files may have unused imports by design.
- Linked to the config option that overrides this behavior

Fixes #10162
  • Loading branch information
amelenty committed Jan 12, 2025
1 parent d94194b commit fb61237
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/data/messages/u/unused-import/details.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
By default, this check is skipped for ``__init__.py`` files, as they often contain imports from submodules for the convenience of end users. While these imports are not used within ``__init__.py``, they serve the purpose of providing intuitive import paths for the module's important classes and constants.
1 change: 1 addition & 0 deletions doc/data/messages/u/unused-import/related.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- `The --init-import configuration option <https://pylint.readthedocs.io/en/latest/user_guide/configuration/all-options.html#init-import>`_

0 comments on commit fb61237

Please sign in to comment.