]> 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:

Bump mypy to 0.780 in pre-commit config (#1887)
authorRichard Si <63936253+ichard26@users.noreply.github.com>
Mon, 28 Dec 2020 02:38:11 +0000 (21:38 -0500)
committerGitHub <noreply@github.com>
Mon, 28 Dec 2020 02:38:11 +0000 (18:38 -0800)
To avoid hitting a mypy bug causes pre-commit to always fail on CPython
3.9. Even though it's still an outdated version, the bug effectively
blocks development on CPython 3.9 so that's why this commit exists
instead of waiting for cooperlees to finish his bump to 0.790 PR.

Also this fixes primer to ensure it always raises CalledProcessError
with an int error code. I stole the patch from cooperlees's mypy bump
PR.

It's funny how mypy 0.790 is already asked for in our
Pipfile.lock file, but oh well mypy is probably more commonly run
through pre-commit than standalone I guess.

Oh and if you're curious why the bug doesn't up on CPython 3.8 or lower:
there was some subscription AST changes in CPython 3.9.

.pre-commit-config.yaml
src/black_primer/lib.py

index 667b22d6328f1d3581aeaf4d59a64092c75978ca..4e12e46f8d816cd82882d99bd4ebb24ac344ead5 100644 (file)
@@ -18,7 +18,7 @@ repos:
         additional_dependencies: [flake8-bugbear]
 
   - repo: https://github.com/pre-commit/mirrors-mypy
-    rev: v0.770
+    rev: v0.780
     hooks:
       - id: mypy
         exclude: ^docs/conf.py
index afeb0721cc4fbbcde60811e1203409d57a2bab47..5c5576e1ff334f8b8d22f2d58d704438914c6f25 100644 (file)
@@ -59,10 +59,12 @@ async def _gen_check_output(
         raise
 
     if process.returncode != 0:
+        returncode = process.returncode
+        if returncode is None:
+            returncode = 69
+
         cmd_str = " ".join(cmd)
-        raise CalledProcessError(
-            process.returncode, cmd_str, output=stdout, stderr=stderr
-        )
+        raise CalledProcessError(returncode, cmd_str, output=stdout, stderr=stderr)
 
     return (stdout, stderr)