Skip to content

Commit e556fe1

Browse files
committed
clarified that mypy ignores new functions
1 parent 7ccfd38 commit e556fe1

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

doc/devel/coding_guide.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,11 @@ We generally use `stub files
8989
the type information for ``colors.py``. A notable exception is ``pyplot.py``,
9090
which is type hinted inline.
9191

92-
Type hints are checked by the mypy :ref:`pre-commit hook <pre-commit-hooks>`,
93-
can often be verified by running ``tox -e stubtest``.
92+
Type hints can be validated by the ``stubtest`` tool, which can be run
93+
locally using ``tox -e stubtest`` and is a part of the :ref:`automated-tests`
94+
suite. Type hints for existing functions are also checked by the mypy
95+
:ref:`pre-commit hook <pre-commit-hooks>`.
96+
9497

9598
New modules and files: installation
9699
===================================

doc/devel/development_setup.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,3 +254,9 @@ listed in ``.pre-commit-config.yaml``, against the full codebase with ::
254254
To run a particular hook manually, run ``pre-commit run`` with the hook id ::
255255

256256
pre-commit run <hook id> --all-files
257+
258+
259+
Please note that the ``mypy`` pre-commit hook cannot check the :ref:`type-hints`
260+
for new functions; instead the stubs for new functions are checked using the
261+
``stubtest`` :ref:`CI check <automated-tests>` and can be checked locally using
262+
``tox -e stubtest``.

0 commit comments

Comments
 (0)