Skip to content

Commit 0991bc3

Browse files
emmatypinggvanrossum
authored andcommitted
Ignore specific module (#4316)
Fixes #3476.
1 parent 71332d5 commit 0991bc3

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

docs/source/config_file.rst

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ overridden by the pattern sections matching the module name.
209209
- ``no_implicit_optional`` (Boolean, default false) changes the treatment of
210210
arguments with a default value of None by not implicitly making their type Optional
211211

212-
Example
213-
*******
212+
Examples
213+
********
214214

215215
You might put this in your ``mypy.ini`` file at the root of your repo:
216216

@@ -227,6 +227,17 @@ for all mypy runs in this tree, and also selectively turns on the
227227
package. This issues an error for function definitions without
228228
type annotations in that subdirectory only.
229229

230+
If you would like to ignore specific imports, instead of ignoring all missing
231+
imports with ``--ignore-missing-imports``, use a section of the configuration
232+
file per module such as the following to ignore missing imports from
233+
``lib_module``:
234+
235+
.. code-block:: text
236+
237+
[mypy-lib_module]
238+
ignore_missing_imports = True
239+
240+
230241
.. note::
231242

232243
Configuration flags are liable to change between releases.

0 commit comments

Comments
 (0)