Skip to content

Commit 58cbfb4

Browse files
amikropJukkaL
authored andcommitted
Add test case for disable_error_code config file option (python#9538)
1 parent 9503938 commit 58cbfb4

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

mypy/config_parser.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ def check_follow_imports(choice: str) -> str:
9494
'plugins': lambda s: [p.strip() for p in s.split(',')],
9595
'always_true': lambda s: [p.strip() for p in s.split(',')],
9696
'always_false': lambda s: [p.strip() for p in s.split(',')],
97+
'disable_error_code': lambda s: [p.strip() for p in s.split(',')],
98+
'enable_error_code': lambda s: [p.strip() for p in s.split(',')],
9799
'package_root': lambda s: [p.strip() for p in s.split(',')],
98100
'cache_dir': expand_path,
99101
'python_executable': expand_path,

test-data/unit/check-flags.test

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,6 +1078,15 @@ always_true = YOLO1, YOLO
10781078
always_false = BLAH, BLAH1
10791079
[builtins fixtures/bool.pyi]
10801080

1081+
[case testDisableErrorCodeConfigFile]
1082+
# flags: --config-file tmp/mypy.ini --disallow-untyped-defs
1083+
import foo
1084+
def bar():
1085+
pass
1086+
[file mypy.ini]
1087+
\[mypy]
1088+
disable_error_code = import, no-untyped-def
1089+
10811090
[case testCheckDisallowAnyGenericsNamedTuple]
10821091
# flags: --disallow-any-generics
10831092
from typing import NamedTuple

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy