Skip to content

Golden mypy config

Published:

Table of contents

Open Table of contents

Config

Live version can be found on GitHub Gist

[mypy]
# Disallow dynamic typing
disallow_any_unimported = True
disallow_any_expr = True
disallow_any_decorated = True
disallow_any_generics = True
disallow_any_explicit = True
disallow_subclassing_any = True

# Disallow untyped definitions and calls
disallow_untyped_calls = True
disallow_untyped_defs = True
disallow_incomplete_defs = True
check_untyped_defs = True
disallow_untyped_decorators = True

# None and optional handling
no_implicit_optional = True

# Configuring warnings
warn_unused_ignores = True
warn_no_return = True
warn_return_any = True
warn_redundant_casts = True

# Misc things
strict_equality = True

# Config file
warn_unused_configs = True