From 944c036df1d22103588e4f853d6917408f1fc471 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Tue, 31 May 2022 14:57:19 -0700 Subject: [PATCH] =?UTF-8?q?mypy:=20Use=20=E2=80=98strict=E2=80=99=20option?= =?UTF-8?q?=20to=20enable=20(almost)=20all=20strictness=20flags.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- pyproject.toml | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 3e50e937fa..e3b92d0dc1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,23 +17,12 @@ show_traceback = true mypy_path = "$MYPY_CONFIG_FILE_DIR/stubs" cache_dir = "$MYPY_CONFIG_FILE_DIR/var/mypy-cache" -# These are all the options that would be enabled by mypy --strict, in -# the order listed by the mypy --help documentation of --strict. We -# do not yet enable all of them. -warn_unused_configs = true -disallow_any_generics = true +# Enable strict mode, with some exceptions. +strict = true disallow_subclassing_any = false disallow_untyped_calls = false -disallow_untyped_defs = true -disallow_incomplete_defs = true -check_untyped_defs = true disallow_untyped_decorators = false -no_implicit_optional = true -warn_redundant_casts = true -warn_unused_ignores = true warn_return_any = false -no_implicit_reexport = true -strict_equality = true # Display the codes needed for # type: ignore[code] annotations. show_error_codes = true