mypy: Use ‘strict’ option to enable (almost) all strictness flags.

The ‘strict’ configuration option has been supported since mypy 0.770,
and I added it to their documentation in 0.920.

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

This has the effect of enabling the new ‘strict_concatenate’ option
from 0.950.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2022-05-31 14:57:19 -07:00 committed by Tim Abbott
parent 483c84da61
commit 944c036df1
1 changed files with 2 additions and 13 deletions

View File

@ -17,23 +17,12 @@ show_traceback = true
mypy_path = "$MYPY_CONFIG_FILE_DIR/stubs" mypy_path = "$MYPY_CONFIG_FILE_DIR/stubs"
cache_dir = "$MYPY_CONFIG_FILE_DIR/var/mypy-cache" cache_dir = "$MYPY_CONFIG_FILE_DIR/var/mypy-cache"
# These are all the options that would be enabled by mypy --strict, in # Enable strict mode, with some exceptions.
# the order listed by the mypy --help documentation of --strict. We strict = true
# do not yet enable all of them.
warn_unused_configs = true
disallow_any_generics = true
disallow_subclassing_any = false disallow_subclassing_any = false
disallow_untyped_calls = false disallow_untyped_calls = false
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = false disallow_untyped_decorators = false
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_return_any = false warn_return_any = false
no_implicit_reexport = true
strict_equality = true
# Display the codes needed for # type: ignore[code] annotations. # Display the codes needed for # type: ignore[code] annotations.
show_error_codes = true show_error_codes = true