Add error on non-list target-version in config file (#1284)

This commit is contained in:
Andrew Zhou 2020-05-08 08:01:42 -05:00 committed by GitHub
parent 544ea9c217
commit 9938c92fd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)