Skip to content

Instantly share code, notes, and snippets.

@rksm
Last active May 23, 2021 17:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rksm/817fd9c9b81dc5be198b876c29e8e5e4 to your computer and use it in GitHub Desktop.
Save rksm/817fd9c9b81dc5be198b876c29e8e5e4 to your computer and use it in GitHub Desktop.
stricter mypy config
# see https://mypy.readthedocs.io/en/stable/config_file.html#the-mypy-configuration-file
# this makes things more strict and enforces checking non-annotated code
[mypy]
# to keep things clean
warn_redundant_casts = True
warn_unused_ignores = True
# Workaround for bug in MyPy
disallow_subclassing_any = False
# enable these for even more strictness
disallow_untyped_calls = False
disallow_untyped_defs = False
# this will enable checks even for non-annotated methods
check_untyped_defs = True
warn_return_any = True
no_implicit_optional = True
strict_optional = True
# this helps when working with untyped libraries
ignore_missing_imports = True
# depends on the project
namespace_packages = True
explicit_package_bases = True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment