mypy: add page (#12847)

Co-authored-by: Alejandro Cervera <96702705+tricantivu@users.noreply.github.com>
pull/28/head
spageektti 2024-05-28 08:00:26 +02:00 committed by GitHub
parent ea6ccc8128
commit d4be3a8709
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 36 additions and 0 deletions

36
pages/common/mypy.md Normal file
View File

@ -0,0 +1,36 @@
# mypy
> Type check Python code.
> More information: <https://mypy.readthedocs.io/en/stable/running_mypy.html>.
- Type check a specific file:
`mypy {{path/to/file.py}}`
- Type check a specific [m]odule:
`mypy -m {{module_name}}`
- Type check a specific [p]ackage:
`mypy -p {{package_name}}`
- Type check a string of code:
`mypy -c "{{code}}"`
- Ignore missing imports:
`mypy --ignore-missing-imports {{path/to/file_or_directory}}`
- Show detailed error messages:
`mypy --show-traceback {{path/to/file_or_directory}}`
- Specify a custom configuration file:
`mypy --config-file {{path/to/config_file}}`
- Display [h]elp:
`mypy -h`