Enable mypy pre-commit hook

Change-Id: I266a2866627fcf66d0f5111c9237a37e55414685
This commit is contained in:
Ihar Hrachyshka 2025-01-09 18:10:01 -05:00
parent 9127c121da
commit 434ef3018e
3 changed files with 13 additions and 1 deletions

View File

@ -47,6 +47,16 @@ repos:
- id: hacking
additional_dependencies: ['neutron', 'neutron-lib']
exclude: '^(doc|releasenotes|tools)/.*$'
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.14.1
hooks:
- id: mypy
args: [--config-file=./mypy.ini]
pass_filenames: false
# need to list alembic here; otherwise it doesn't see internals
# necessary to detect one of 'ignored' errors and complains about
# unnecessary ignore; other dependencies can be left out it seems
additional_dependencies: ['alembic']
- repo: local
hooks:
- id: flake8

View File

@ -12,6 +12,8 @@ disable_error_code = import-untyped,var-annotated,import-not-found
# honor excludes by not following there through imports
follow_imports = silent
files = neutron
# NOTE: Gradually enable type checking for each package.
# Finally, when the whole repo is migrated this option can be deleted
# and rules applied to the whole repo.

View File

@ -123,7 +123,7 @@ commands =
[testenv:mypy]
deps = {[testenv:pep8]deps}
commands = mypy --config-file ./mypy.ini neutron
commands = mypy --config-file ./mypy.ini
[testenv:releasenotes]
description =