File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -2550,6 +2550,29 @@ enable_all_error_codes = True
25502550\[mypy-tests.*]
25512551disable_error_code = ignore-without-code
25522552
2553+ [case testSpotCheckEnableAllErrorCodesConfigCountermand]
2554+ # flags: --config-file tmp/mypy.ini
2555+ # This test makes sure that the user can still countermand error codes disables
2556+ # by *using* enable_all_error_codes on a more-specific level.
2557+ import tests.foo
2558+ import bar
2559+ [file bar.py]
2560+ def foo() -> int: ...
2561+ if foo: ... # E: Function "foo" could always be true in boolean context
2562+ 42 + "no" # type: ignore
2563+ [file tests/__init__.py]
2564+ [file tests/foo.py]
2565+ def foo() -> int: ...
2566+ if foo: ... # E: Function "foo" could always be true in boolean context
2567+ 42 + "no" # type: ignore # E: "type: ignore" comment without error code (consider "type: ignore[operator]" instead)
2568+ [file mypy.ini]
2569+ \[mypy]
2570+ disable_error_code = ignore-without-code
2571+
2572+ \[mypy-tests.*]
2573+ enable_all_error_codes = True
2574+
2575+
25532576[case testSpotCheckEnableAllErrorCodesCountermand]
25542577# flags: --enable-all-error-codes --disable-error-code unused-ignore
25552578x = 2 # type: ignore # E: "type: ignore" comment without error code
You can’t perform that action at this time.
0 commit comments