diff --git a/mypy/config_parser.py b/mypy/config_parser.py index 7e1f16f56b25..27aeca3fe5b9 100644 --- a/mypy/config_parser.py +++ b/mypy/config_parser.py @@ -94,6 +94,8 @@ def check_follow_imports(choice: str) -> str: 'plugins': lambda s: [p.strip() for p in s.split(',')], 'always_true': lambda s: [p.strip() for p in s.split(',')], 'always_false': lambda s: [p.strip() for p in s.split(',')], + 'disable_error_code': lambda s: [p.strip() for p in s.split(',')], + 'enable_error_code': lambda s: [p.strip() for p in s.split(',')], 'package_root': lambda s: [p.strip() for p in s.split(',')], 'cache_dir': expand_path, 'python_executable': expand_path, diff --git a/test-data/unit/check-flags.test b/test-data/unit/check-flags.test index 048d49d91843..1cee362422f8 100644 --- a/test-data/unit/check-flags.test +++ b/test-data/unit/check-flags.test @@ -1078,6 +1078,15 @@ always_true = YOLO1, YOLO always_false = BLAH, BLAH1 [builtins fixtures/bool.pyi] +[case testDisableErrorCodeConfigFile] +# flags: --config-file tmp/mypy.ini --disallow-untyped-defs +import foo +def bar(): + pass +[file mypy.ini] +\[mypy] +disable_error_code = import, no-untyped-def + [case testCheckDisallowAnyGenericsNamedTuple] # flags: --disallow-any-generics from typing import NamedTuple