Type object
Schema URL https://catalog.lintel.tools/schemas/schemastore/pyproject/_shared/latest--partial-mypy.json
Parent schema pyproject
Type: object

Properties

mypy_path string | string[]

Specifies the paths to use, after trying the paths from MYPYPATH environment variable. Useful if you'd like to keep stubs in your repo, along with the config file. Multiple paths are always separated with a : or , regardless of the platform. User home directory and environment variables will be expanded.

files string | string[]

A comma-separated list of paths which should be checked by mypy if none are given on the command line. Supports recursive file globbing using glob, where * (e.g. *.py) matches files in the current directory and **/ (e.g. **/*.py) matches files in any directories below the current one. User home directory and environment variables will be expanded.

modules string | string[]

A comma-separated list of packages which should be checked by mypy if none are given on the command line. Mypy will not recursively type check any submodules of the provided module.

packages string | string[]

A comma-separated list of packages which should be checked by mypy if none are given on the command line. Mypy will recursively type check any submodules of the provided package. This flag is identical to modules apart from this behavior.

exclude string | string[]

A regular expression that matches file names, directory names and paths which mypy should ignore while recursively discovering files to check. Use forward slashes (/) as directory separators on all platforms.

exclude_gitignore boolean

This flag will add everything that matches .gitignore file(s) to exclude (https://mypy.readthedocs.io/en/stable/config_file.html#confval-exclude). This option may only be set in the global section ([mypy]).

Default: false
namespace_packages boolean

Enables PEP 420 style namespace packages. See the corresponding flag --no-namespace-packages for more information.

Default: true
explicit_package_bases boolean

This flag tells mypy that top-level packages will be based in either the current directory, or a member of the MYPYPATH environment variable or mypy_path config option. This option is only useful in the absence of __init__.py. See Mapping file paths to modules for details.

Default: false
ignore_missing_imports boolean

Suppresses error messages about imports that cannot be resolved.

Default: false
follow_untyped_imports boolean

Makes mypy analyze imports from installed packages even if missing a py.typed marker or stubs.

Default: false
follow_imports string

Directs what to do with imports when the imported module is found as a .py file and not part of the files, modules and packages provided on the command line.

Default: "normal"
Values: "normal" "silent" "skip" "error"
follow_imports_for_stubs boolean

Determines whether to respect the follow_imports setting even for stub (.pyi) files.

Default: false
python_executable string

Specifies the path to the Python executable to inspect to collect a list of available PEP 561 packages. User home directory and environment variables will be expanded. Defaults to the executable used to run mypy.

no_site_packages boolean

Disables using type information in installed packages (see PEP 561). This will also disable searching for a usable Python executable. This acts the same as --no-site-packages command line flag.

Default: false
no_silence_site_packages boolean

Enables reporting error messages generated within installed packages (see PEP 561 for more details on distributing type information). Those error messages are suppressed by default, since you are usually not able to control errors in 3rd party code.

Default: false
python_version string

Specifies the Python version used to parse and check the target program. The string should be in the format MAJOR.MINOR (for example, 2.7). The default is the version of the Python interpreter used to run mypy.

platform string

Specifies the OS platform for the target program, for example darwin or win32 (meaning OS X or Windows, respectively). The default is the current platform as revealed by Python's sys.platform variable.

always_true string | string[]

Specifies a list of variables that mypy will treat as compile-time constants that are always true.

always_false string | string[]

Specifies a list of variables that mypy will treat as compile-time constants that are always false.

disallow_any_unimported boolean

Disallows usage of types that come from unfollowed imports (anything imported from an unfollowed import is automatically given a type of Any).

Default: false
disallow_any_expr boolean

Disallows all expressions in the module that have type Any.

Default: false
disallow_any_decorated boolean

Disallows functions that have Any in their signature after decorator transformation.

Default: false
disallow_any_explicit boolean

Disallows explicit Any in type positions such as type annotations and generic type parameters.

Default: false
disallow_any_generics boolean

Disallows usage of generic types that do not specify explicit type parameters.

Default: false
disallow_subclassing_any boolean

Disallows subclassing a value of type Any.

Default: false
disallow_untyped_calls boolean

Disallows calling functions without type annotations from functions with type annotations. Note that when used in per-module options, it enables/disables this check inside the module(s) specified, not for functions that come from that module(s).

Default: false
untyped_calls_exclude string | string[]

Selectively excludes functions and methods defined in specific packages, modules, and classes from action of disallow_untyped_calls. This also applies to all submodules of packages (i.e. everything inside a given prefix). Note, this option does not support per-file configuration, the exclusions list is defined globally for all your code.

disallow_untyped_defs boolean

Disallows defining functions without type annotations or with incomplete type annotations (a superset of disallow_incomplete_defs).

Default: false
disallow_incomplete_defs boolean

Disallows defining functions with incomplete type annotations, while still allowing entirely unannotated definitions.

Default: false
check_untyped_defs boolean

Type-checks the interior of functions without type annotations.

Default: false
allow_untyped_decorators boolean

Allow decorating typed functions with untyped decorators.

Default: false
disallow_untyped_decorators boolean

Reports an error whenever a function with type annotations is decorated with a decorator without annotations.

Default: false
implicit_optional boolean

Causes mypy to treat arguments with a None default value as having an implicit Optional type.

Default: false
no_implicit_optional boolean

Inverse of implicit_optional.

Default: true
no_implicit_reexport boolean

By default, imported values to a module are treated as exported and mypy allows other modules to import them. This flag changes the behavior to not re-export unless the item is imported using from-as or is included in __all__. Note this is always treated as enabled for stub files.

Default: false
strict_bytes boolean

Disable treating bytearray and memoryview as subtypes of bytes. This will be enabled by default in mypy 2.0.

Default: false
strict_optional boolean

Enables or disables strict Optional checks. If False, mypy treats None as compatible with every type.

Default: true
warn_redundant_casts boolean

Warns about casting an expression to its inferred type.

Default: false
warn_unused_ignores boolean

Warns about unneeded # type: ignore comments.

Default: false
warn_no_return boolean

Shows errors for missing return statements on some execution paths.

Default: true
warn_return_any boolean

Shows a warning when returning a value with type Any from a function declared with a non-Any return type.

Default: false
warn_unreachable boolean

Shows a warning when encountering any code inferred to be unreachable or redundant after performing type analysis.

Default: false
ignore_errors boolean

Ignores all non-fatal errors.

Default: false
allow_untyped_globals boolean

Causes mypy to suppress errors caused by not being able to fully infer the types of global and class variables.

Default: false
allow_redefinition_new boolean

By default, mypy won't allow a variable to be redefined with an unrelated type. This experimental flag enables the redefinition of unannotated variables with an arbitrary type. You will also need to enable local_partial_types.

Default: false
allow_redefinition boolean

Allows variables to be redefined with an arbitrary type, as long as the redefinition is in the same block and nesting level as the original definition.

Default: false
local_partial_types boolean

Disallows inferring variable type for None from two assignments in different scopes. This is always implicitly enabled when using the mypy daemon.

Default: false
disable_error_code string | string[]

Allows disabling one or multiple error codes globally.

enable_error_code string | string[]

Allows enabling one or multiple error codes globally.

implicit_reexport boolean

By default, imported values to a module are treated as exported and mypy allows other modules to import them. When false, mypy will not re-export unless the item is imported using from-as or is included in __all__. Note that mypy treats stub files as if this is always disabled.

Default: true
strict_concatenate boolean

Make arguments prepended via Concatenate be truly positional-only.

Default: false
extra_checks boolean

Enable additional checks that are technically correct but impractical.

Default: false
strict_equality boolean

Prohibit equality checks, identity checks, and container checks between non-overlapping types.

Default: false
strict_equality_for_none boolean

Include None in strict equality checks. Requires strict_equality to be activated.

https://mypy.readthedocs.io/en/stable/config_file.html#confval-strict_equality_for_none

Default: false
strict boolean

Enable all optional error checking flags. You can see the list of flags enabled by strict mode in the full mypy --help output. The exact list of flags enabled by strict may change over time.

Default: false
show_error_context boolean

Prefixes each error with the relevant context.

Default: false
show_column_numbers boolean

Shows column numbers in error messages.

Default: false
hide_error_codes boolean

Hides error codes in error messages. See Error codes for more information.

Default: false
pretty boolean

Use visually nicer output in error messages: use soft word wrap, show source code snippets, and show error location markers.

Default: false
color_output boolean

Shows error messages with color enabled.

Default: true
error_summary boolean

Shows a short summary line after error messages.

Default: true
show_absolute_path boolean

Show absolute paths to files.

Default: false
force_uppercase_builtins boolean

Always use List instead of list in error messages, even on Python 3.9+.

Default: false
force_union_syntax boolean

Always use Union[] and Optional[] for union types in error messages (instead of the | operator), even on Python 3.10+.

Default: false
incremental boolean
Default: true
cache_dir string

Specifies the location where mypy stores incremental cache info. User home directory and environment variables will be expanded. This setting will be overridden by the MYPY_CACHE_DIR environment variable.

Default: ".mypy_cache"
sqlite_cache boolean

Use an SQLite database to store the cache.

Default: false
cache_fine_grained boolean

Include fine-grained dependency information in the cache for the mypy daemon.

Default: false
skip_version_check boolean

Makes mypy use incremental cache data even if it was generated by a different version of mypy. (By default, mypy will perform a version check and regenerate the cache if it was written by older versions of mypy.)

Default: false
skip_cache_mtime_checks boolean

Skip cache internal consistency checks based on mtime.

Default: false
fixed_format_cache boolean

Use a new experimental cache format for faster incremental builds. Makes incremental builds up to twice as fast. This is experimental and currently only supported when using a compiled version of mypy.

https://mypy.readthedocs.io/en/stable/config_file.html#confval-fixed_format_cache

Default: false
plugins string | string[]

A comma-separated list of mypy plugins. See Extending mypy using plugins.

pdb boolean

Invokes pdb on fatal error.

Default: false
show_traceback boolean

Shows traceback on fatal error.

Default: false
raise_exceptions boolean

Raise exception on fatal error.

Default: false
custom_typing_module string

Specifies a custom module to use as a substitute for the typing module.

custom_typeshed_dir string

This specifies the directory where mypy looks for standard library typeshed stubs, instead of the typeshed that ships with mypy. This is primarily intended to make it easier to test typeshed changes before submitting them upstream, but also allows you to use a forked version of typeshed.

warn_incomplete_stub boolean

Warns about missing type annotations in typeshed. This is only relevant in combination with disallow_untyped_defs or disallow_incomplete_defs.

Default: false
any_exprs_report string

Causes mypy to generate a text file report documenting how many expressions of type Any are present within your codebase.

cobertura_xml_report string

Causes mypy to generate a Cobertura XML type checking coverage report.

linecount_report string

Causes mypy to generate a text file report documenting the functions and lines that are typed and untyped within your codebase.

linecoverage_report string

Causes mypy to generate a JSON file that maps each source file's absolute filename to a list of line numbers that belong to typed functions in that file.

lineprecision_report string

Causes mypy to generate a flat text file report with per-module statistics of how many lines are typechecked etc.

xml_report string

Causes mypy to generate an XML type checking coverage report.

junit_xml string

Causes mypy to generate a JUnit XML test result document with type checking results. This can make it easier to integrate mypy with continuous integration (CI) tools.

scripts_are_modules boolean

Makes script x become module x instead of __main__. This is useful when checking multiple scripts in a single run.

Default: false
warn_unused_configs boolean

Warns about per-module sections in the config file that do not match any files processed when invoking mypy. (This requires turning off incremental mode using incremental = False.)

Default: false
verbosity integer

Controls how much debug output will be generated. Higher numbers are more verbose.

Default: 0
show_error_codes boolean

DEPRECATED and UNDOCUMENTED: Now defaults to true, use hide_error_codes if you need to disable error codes instead.

Default: true
disable_bytearray_promotion boolean

UNDOCUMENTED. Disables automatic promotion of bytearray to bytes type. Is set to true in strict mode.

Default: false
disable_memoryview_promotion boolean

UNDOCUMENTED. Disables automatic promotion of memoryview to bytes type. Is set to true in strict mode.

Default: false
enable_incomplete_feature string | string[]

Enable a preview of incomplete features that are not yet enabled by default by the current version of mypy. Note that it is not guaranteed that all features will be ultimately enabled by default.

overrides object[]
install_types boolean

Install detected missing library stub packages using pip

Default: false
non_interactive boolean

Install stubs without asking for confirmation and hide errors, with --install-types

Default: false