From ae2962fc016c2aa62a594e2ff5f7f98a98200e80 Mon Sep 17 00:00:00 2001 From: Stepan Burlakov Date: Mon, 24 Jan 2022 12:04:35 +0200 Subject: [PATCH 1/3] add mypy pre-commit hook --- .pre-commit-config.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8682406a57b..ba87c6d9cce 100755 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -45,3 +45,14 @@ repos: additional_dependencies: - flake8-tidy-imports - flake8-quotes + - repo: local + hooks: + - id: mypy + name: mypy + entry: "mypy src" + language: python + language_version: python3.7 + additional_dependencies: ["mypy==0.910"] + types: [python] + require_serial: true + verbose: true From 8e5bd84a3afb7307e798b1483fb39de5b34e0b45 Mon Sep 17 00:00:00 2001 From: Stepan Burlakov Date: Mon, 24 Jan 2022 12:05:12 +0200 Subject: [PATCH 2/3] remove redundant mypy run --- .github/workflows/code-check.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/code-check.yml b/.github/workflows/code-check.yml index 759ebfa992e..e474926b1c2 100644 --- a/.github/workflows/code-check.yml +++ b/.github/workflows/code-check.yml @@ -26,7 +26,3 @@ jobs: uses: pre-commit/action@v2.0.3 with: extra_args: --all-files - - - name: Type check with mypy - run: | - mypy src From ff86be2c9d8ed501d17e5e42b6c14e2ac7a1d291 Mon Sep 17 00:00:00 2001 From: Stepan Burlakov Date: Mon, 24 Jan 2022 13:28:57 +0200 Subject: [PATCH 3/3] fix mypy pre-commit hook --- .pre-commit-config.yaml | 7 +++---- setup.cfg | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ba87c6d9cce..6c0b401b23a 100755 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -49,10 +49,9 @@ repos: hooks: - id: mypy name: mypy - entry: "mypy src" - language: python - language_version: python3.7 - additional_dependencies: ["mypy==0.910"] + entry: mypy + language: system types: [python] require_serial: true verbose: true + pass_filenames: false diff --git a/setup.cfg b/setup.cfg index c5c2558a72e..c000a3dd7e5 100755 --- a/setup.cfg +++ b/setup.cfg @@ -57,6 +57,7 @@ firebolt = py.typed plugins = pydantic.mypy disallow_untyped_defs = True show_error_codes = True +files = src/ [pydantic-mypy] warn_required_dynamic_aliases = True