From 1de9764ae9fb5f757b18df4269b048aacac95a8d Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Thu, 9 Jan 2025 18:20:40 -0500 Subject: [PATCH] Enable mypy pre-commit hook Change-Id: I740bc58ae57e22c878b52215e72aaec6ebca1299 --- .pre-commit-config.yaml | 6 ++++++ mypy.ini | 2 ++ tox.ini | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7e540ea00..69e650c35 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,6 +29,12 @@ repos: hooks: - id: remove-tabs exclude: '.*\.(svg)$' + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.14.1 + hooks: + - id: mypy + args: [--config-file=./mypy.ini] + pass_filenames: false - repo: local hooks: - id: flake8 diff --git a/mypy.ini b/mypy.ini index f8d5beba4..18530c4e0 100644 --- a/mypy.ini +++ b/mypy.ini @@ -11,3 +11,5 @@ disable_error_code = import-untyped,var-annotated,import-not-found # honor excludes by not following there through imports follow_imports = silent + +files = neutron_lib diff --git a/tox.ini b/tox.ini index 0267bb486..5ba7bb92d 100644 --- a/tox.ini +++ b/tox.ini @@ -23,7 +23,7 @@ commands = [testenv:mypy] deps = {[testenv:pep8]deps} commands = - mypy --config-file ./mypy.ini neutron_lib + mypy --config-file ./mypy.ini [testenv:pep8] deps =