diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3c6cb6907..b95f5e4b6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,6 +25,16 @@ repos: additional_dependencies: [flake8-import-order] files: ^tobiko/ + - repo: https://github.com/pre-commit/mirrors-mypy + rev: 'v0.782' + hooks: + - id: mypy + files: ^tobiko/ + entry: mypy tobiko/ + pass_filenames: false + # args: [--ignore-missing-imports] + + # - repo: https://github.com/adrienverge/yamllint.git # rev: v1.23.0 # hooks: diff --git a/linters-requirements.txt b/linters-requirements.txt index 0a1b5fff2..4ee9f0d31 100644 --- a/linters-requirements.txt +++ b/linters-requirements.txt @@ -1,8 +1,5 @@ # pep8 and flake8 requirements ansible-lint==4.2.0 # MIT -flake8>=3.8.1 # MIT -flake8-import-order==0.12 # LGPLv3 -mypy>=0.740 # MIT pre-commit >= 2.6.0 # MIT pylint>=2.5.2 # GPLv2 diff --git a/tox.ini b/tox.ini index 62b1c128e..1085af95f 100644 --- a/tox.ini +++ b/tox.ini @@ -79,6 +79,15 @@ commands = pre-commit run -a flake8 +[testenv:mypy] + +basepython = {[testenv:pep8]basepython} +deps = {[testenv:pep8]deps} +envdir = {toxworkdir}/pep8 +commands = + pre-commit run -a mypy + + [testenv:pylint] basepython = {[testenv:pep8]basepython} deps = {[testenv:pep8]deps} @@ -97,7 +106,6 @@ envdir = {toxworkdir}/pep8 commands = pre-commit run -a pre-commit install - mypy --ignore-missing-imports tobiko/ # Ansible lint # [ANSIBLE0012] Commands should not change things if nothing needs doing bash -c 'find roles infrared_plugin/roles -maxdepth 1 -mindepth 1 -type d | \