From c19014c1db1b5f8688c2eaf321d955a31d55e18b Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 6 Apr 2021 16:13:08 +0200 Subject: [PATCH 1/2] Pre-commit: add mypy --- .pre-commit-config.yaml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b48da86ee57d..526a6825231e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -30,13 +30,10 @@ repos: - --ignore=E203,W503 - --max-complexity=25 - --max-line-length=88 -# FIXME: fix mypy errors and then uncomment this -# - repo: https://github.com/pre-commit/mirrors-mypy -# rev: v0.782 -# hooks: -# - id: mypy -# args: -# - --ignore-missing-imports + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v0.812 + hooks: + - id: mypy - repo: https://github.com/codespell-project/codespell rev: v2.0.0 hooks: From cd3c2d29cad7fbfd0ae331c8fb820fbdcbc49c94 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Wed, 7 Apr 2021 09:34:19 +0200 Subject: [PATCH 2/2] mypy --config-file mypy.ini Our `mypy.ini` file does `--ignore-missing-imports` so our tests should pass even if we have none of our dependencies. I sense that mypy in our pre-commit is not finding / reading our `mypy.ini` file. --- .pre-commit-config.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 526a6825231e..8fbd9eb3ce8e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,6 +34,8 @@ repos: rev: v0.812 hooks: - id: mypy + args: + - --config-file mypy.ini - repo: https://github.com/codespell-project/codespell rev: v2.0.0 hooks: