From 478e7527aa084256d66e581056da2a251bea108f Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Mon, 28 Mar 2022 16:06:13 +0100 Subject: [PATCH] `mypy_test`: Add two more config options (#7560) `--enable-error-code ignore-without-code` means that mypy will ignore any type: ignore comments that don't have mypy error codes. It doesn't appear to have any effect on type: ignore comments that mypy_test doesn't use (e.g. because they're pyright- or stubtest-specific). `--strict-equality` means that mypy will raise errors if we do something silly like `if sys.version_info == "linux"`. flake8-pyi should also check this for us, but I don't see any reason not to have mypy check this as well. --- tests/mypy_test.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/mypy_test.py b/tests/mypy_test.py index aeaf82c94..66e1b1ebe 100755 --- a/tests/mypy_test.py +++ b/tests/mypy_test.py @@ -207,6 +207,9 @@ def get_mypy_flags(args, major: int, minor: int, temp_name: str, *, custom_types "--warn-incomplete-stub", "--show-error-codes", "--no-error-summary", + "--enable-error-code", + "ignore-without-code", + "--strict-equality", ] if custom_typeshed: # Setting custom typeshed dir prevents mypy from falling back to its bundled