Skip to content

Commit

Permalink
support lists for exclude option in TOML
Browse files Browse the repository at this point in the history
python#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.
  • Loading branch information
mawillcockson committed Dec 14, 2021
1 parent 5d71f58 commit ace77df
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mypy/config_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()],
})


Expand Down

0 comments on commit ace77df

Please sign in to comment.