From ace77df8002543d8590afbedb472f22f93680f5a Mon Sep 17 00:00:00 2001 From: Matthew W Date: Tue, 14 Dec 2021 17:42:42 -0600 Subject: [PATCH] support lists for exclude option in TOML #11329 added support for nicer `exclude` lists TOML has a built-in list syntax, and it would be nice to use that for specifying lists for the `exclude` option. This change tries the ini-style first: if `exclude` is set to a multiline string, it will split that on newlines, otherwise it will assume it's a list. --- mypy/config_parser.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mypy/config_parser.py b/mypy/config_parser.py index 24e61df0441c..ea9b8c18c4aa 100644 --- a/mypy/config_parser.py +++ b/mypy/config_parser.py @@ -143,6 +143,7 @@ def check_follow_imports(choice: str) -> str: 'disable_error_code': try_split, 'enable_error_code': try_split, 'package_root': try_split, + 'exclude': lambda s: [p.strip() for p in (s.split('\n') if isinstance(s, str) else s) if p.strip()], })