]> git.madduck.net Git - etc/vim.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Add error on non-list target-version in config file (#1284)
authorAndrew Zhou <andrewfzhou@gmail.com>
Fri, 8 May 2020 13:01:42 +0000 (08:01 -0500)
committerGitHub <noreply@github.com>
Fri, 8 May 2020 13:01:42 +0000 (06:01 -0700)
black.py

index ff4f098db0271e964b9602553b38a1dcbd2455d6..b3f387ac24465ca5fa7a99ec8076f6832886e15f 100644 (file)
--- a/black.py
+++ b/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)