Skip to content

Commit ace77df

Browse files
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.
1 parent 5d71f58 commit ace77df

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

mypy/config_parser.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ def check_follow_imports(choice: str) -> str:
143143
'disable_error_code': try_split,
144144
'enable_error_code': try_split,
145145
'package_root': try_split,
146+
'exclude': lambda s: [p.strip() for p in (s.split('\n') if isinstance(s, str) else s) if p.strip()],
146147
})
147148

148149

0 commit comments

Comments
 (0)