commands.sh

mypy

all

Type check Python code.

More info →

Options (5)

-m, --moduleboolean

Type check a specific module

Example: mypy {{[-m|--module]}} {{module_name}}
-p, --packageboolean

Type check a specific package

Example: mypy {{[-p|--package]}} {{package_name}}
-c, --commandboolean

Type check a string of code

Example: mypy {{[-c|--command]}} "{{code}}"
--tbboolean

Show detailed error messages

Example: mypy {{[--tb|--show-traceback]}} {{path/to/file_or_directory}}
-h, --helpboolean

Display help

Example: mypy {{[-h|--help]}}

Examples (8)

Type check a specific file

mypy path/to/file.py

Type check a specific module

mypy [-m|--module] module_name

Type check a specific package

mypy [-p|--package] package_name

Type check a string of code

mypy [-c|--command] "code"

Ignore missing imports

mypy --ignore-missing-imports path/to/file_or_directory

Show detailed error messages

mypy [--tb|--show-traceback] path/to/file_or_directory

Specify a custom configuration file

mypy --config-file path/to/config_file

Display help

mypy [-h|--help]
made by @shridhargupta | data from tldr-pages