Enable mypy pre-commit hook
Change-Id: I266a2866627fcf66d0f5111c9237a37e55414685
This commit is contained in:
@@ -47,6 +47,16 @@ repos:
|
|||||||
- id: hacking
|
- id: hacking
|
||||||
additional_dependencies: ['neutron', 'neutron-lib']
|
additional_dependencies: ['neutron', 'neutron-lib']
|
||||||
exclude: '^(doc|releasenotes|tools)/.*$'
|
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
|
- repo: local
|
||||||
hooks:
|
hooks:
|
||||||
- id: flake8
|
- id: flake8
|
||||||
|
2
mypy.ini
2
mypy.ini
@@ -12,6 +12,8 @@ disable_error_code = import-untyped,var-annotated,import-not-found
|
|||||||
# honor excludes by not following there through imports
|
# honor excludes by not following there through imports
|
||||||
follow_imports = silent
|
follow_imports = silent
|
||||||
|
|
||||||
|
files = neutron
|
||||||
|
|
||||||
# NOTE: Gradually enable type checking for each package.
|
# NOTE: Gradually enable type checking for each package.
|
||||||
# Finally, when the whole repo is migrated this option can be deleted
|
# Finally, when the whole repo is migrated this option can be deleted
|
||||||
# and rules applied to the whole repo.
|
# and rules applied to the whole repo.
|
||||||
|
2
tox.ini
2
tox.ini
@@ -123,7 +123,7 @@ commands =
|
|||||||
|
|
||||||
[testenv:mypy]
|
[testenv:mypy]
|
||||||
deps = {[testenv:pep8]deps}
|
deps = {[testenv:pep8]deps}
|
||||||
commands = mypy --config-file ./mypy.ini neutron
|
commands = mypy --config-file ./mypy.ini
|
||||||
|
|
||||||
[testenv:releasenotes]
|
[testenv:releasenotes]
|
||||||
description =
|
description =
|
||||||
|
Reference in New Issue
Block a user