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.
This commit is contained in:
Alex Waygood
2022-03-28 16:06:13 +01:00
committed by GitHub
parent c41034c354
commit 478e7527aa

View File

@@ -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