mypy(1) Optional Static Typing for Python


usage: mypy [-h] [-v] [-V] [--python-version x.y] [--py2] [-s] [--silent]
[--almost-silent] [--disallow-untyped-calls] [--disallow-untyped-defs] [--check-untyped-defs] [--fast-parser] [-i] [-f] [--pdb] [--use-python-path] [--stats] [--inferstats] [--custom-typing MODULE] [--html-report DIR] [--old-html-report DIR] [--xslt-html-report DIR] [--xml-report DIR] [--txt-report DIR] [--xslt-txt-report DIR] [--linecount-report DIR] [-m MODULES] [-c COMMAND] [-p PACKAGE] [files [files ...]]

optional arguments:

-h, --help
show this help message and exit
-v, --verbose
more verbose messages
-V, --version
show program's version number and exit
--python-version x.y
use Python x.y
use Python 2 mode
-s, --silent-imports
don't follow imports to .py files
deprecated name for --silent-imports
like --silent-imports but reports the imports as errors
disallow calling functions without type annotations from functions with type annotations
disallow defining functions without type annotations or with incomplete type annotations
type check the interior of functions without type annotations
enable experimental fast parser
-i, --incremental
enable experimental module cache
-f, --dirty-stubs
don't warn if typeshed is out of sync
invoke pdb on fatal error
an anti-pattern
dump stats
dump type inference stats
--custom-typing MODULE
use a custom typing module

report generation:

Generate a report in the specified format.
--html-report DIR
--old-html-report DIR
--xslt-html-report DIR
--xml-report DIR
--txt-report DIR
--xslt-txt-report DIR
--linecount-report DIR

How to specify the code to type check:

-m MODULES, --module MODULES
type-check module; can repeat for more modules
-c COMMAND, --command COMMAND
type-check program passed in as string
-p PACKAGE, --package PACKAGE
type-check all files in a directory
type-check given files or directories

environment variables: MYPYPATH additional module search path