Add error on non-list target-version in config file (#1284)
This commit is contained in:
parent
544ea9c217
commit
9938c92fd7
6
black.py
6
black.py
@ -296,6 +296,12 @@ def read_pyproject_toml(
|
||||
if not config:
|
||||
return None
|
||||
|
||||
target_version = config.get("target_version")
|
||||
if target_version is not None and not isinstance(target_version, list):
|
||||
raise click.BadOptionUsage(
|
||||
"target-version", f"Config key target-version must be a list"
|
||||
)
|
||||
|
||||
default_map: Dict[str, Any] = {}
|
||||
if ctx.default_map:
|
||||
default_map.update(ctx.default_map)
|
||||
|
Loading…
Reference in New Issue
Block a user