Add mypy support

This commit is contained in:
Christoph Burgdorf 2019-04-26 15:59:33 +02:00
parent 3c1bbfe738
commit 720b2cf3d2
3 changed files with 18 additions and 0 deletions

16
mypy.ini Normal file
View File

@ -0,0 +1,16 @@
[mypy]
check_untyped_defs = True
disallow_incomplete_defs = True
disallow_untyped_defs = True
disallow_any_generics = True
disallow_untyped_calls = True
disallow_untyped_decorators = True
disallow_subclassing_any = True
ignore_missing_imports = True
strict_optional = True
strict_equality = True
warn_redundant_casts = True
warn_return_any = True
warn_unused_configs = True
warn_unused_ignores = True

View File

@ -14,6 +14,7 @@ extras_require = {
'lint': [ 'lint': [
"flake8==3.4.1", "flake8==3.4.1",
"isort>=4.2.15,<5", "isort>=4.2.15,<5",
"mypy==0.701",
"pydocstyle>=3.0.0,<4", "pydocstyle>=3.0.0,<4",
], ],
'doc': [ 'doc': [

View File

@ -38,6 +38,7 @@ whitelist_externals=make
basepython=python basepython=python
extras=lint extras=lint
commands= commands=
mypy -p {toxinidir}/<MODULE_NAME> --config-file {toxinidir}/mypy.ini
flake8 {toxinidir}/<MODULE_NAME> {toxinidir}/tests flake8 {toxinidir}/<MODULE_NAME> {toxinidir}/tests
isort --recursive --check-only --diff {toxinidir}/<MODULE_NAME> {toxinidir}/tests isort --recursive --check-only --diff {toxinidir}/<MODULE_NAME> {toxinidir}/tests
pydocstyle {toxinidir}/<MODULE_NAME> {toxinidir}/tests pydocstyle {toxinidir}/<MODULE_NAME> {toxinidir}/tests