-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Various docs improvements #16836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Various docs improvements #16836
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -305,16 +305,20 @@ not catch errors in its use. | |
| The ``.*`` after ``foobar`` will ignore imports of ``foobar`` modules | ||
| and subpackages in addition to the ``foobar`` top-level package namespace. | ||
|
|
||
| 3. To suppress *all* missing import errors for *all* libraries in your codebase, | ||
| invoke mypy with the :option:`--ignore-missing-imports <mypy --ignore-missing-imports>` command line flag or set | ||
| the :confval:`ignore_missing_imports` | ||
| config file option to True | ||
| in the *global* section of your mypy config file:: | ||
| 3. To suppress *all* missing import errors for *all* untyped libraries | ||
| in your codebase, use :option:`--disable-error-code=import-untyped <mypy --ignore-missing-imports>`. | ||
| See :ref:`code-import-untyped` for more details on this error code. | ||
|
|
||
| You can also set :confval:`disable_error_code`, like so:: | ||
|
|
||
| [mypy] | ||
| ignore_missing_imports = True | ||
| disable_error_code = import-untyped | ||
|
|
||
|
|
||
| We recommend using this approach only as a last resort: it's equivalent | ||
| You can also set the :option:`--ignore-missing-imports <mypy --ignore-missing-imports>` | ||
| command line flag or set the :confval:`ignore_missing_imports` config file | ||
| option to True in the *global* section of your mypy config file. We | ||
| recommend avoiding ``--ignore-missing-imports`` if possible: it's equivalent | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't that also what
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, if you have a typo, your error code will be import-not-found instead of import-untyped. I link to the import-untyped docs that explain this |
||
| to adding a ``# type: ignore`` to all unresolved imports in your codebase. | ||
|
|
||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.