X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/93989e995da7fa22c26abf8cc805273940265f5b..4130c65578b9ac2a42b3b18f4f38917607db3500:/src/black/__init__.py diff --git a/src/black/__init__.py b/src/black/__init__.py index 222cb3c..b6611be 100644 --- a/src/black/__init__.py +++ b/src/black/__init__.py @@ -157,6 +157,16 @@ def read_pyproject_toml( "target-version", "Config key target-version must be a list" ) + exclude = config.get("exclude") + if exclude is not None and not isinstance(exclude, str): + raise click.BadOptionUsage("exclude", "Config key exclude must be a string") + + extend_exclude = config.get("extend_exclude") + if extend_exclude is not None and not isinstance(extend_exclude, str): + raise click.BadOptionUsage( + "extend-exclude", "Config key extend-exclude must be a string" + ) + default_map: Dict[str, Any] = {} if ctx.default_map: default_map.update(ctx.default_map)