Add mypy to CI

Since we already have some type hints in the codebase let's make sure
they're actually consistent.
This commit is contained in:
Jakub Stasiak 2018-09-19 12:33:48 +02:00
parent 2c30c776e6
commit 8c7df47b88
2 changed files with 12 additions and 1 deletions

View File

@ -17,4 +17,8 @@ matrix:
- { python: "3.7", dist: xenial, sudo: true } - { python: "3.7", dist: xenial, sudo: true }
install: install:
- pip install pytest "typing$TYPING_VERSION" "pytest-cov>=2.5.1" - pip install pytest "typing$TYPING_VERSION" "pytest-cov>=2.5.1"
script: py.test -vv --cov=injector --cov-branch --cov-report html --cov-report term # mypy can't be installed on pypy
- if [[ "${TRAVIS_PYTHON_VERSION}" != "pypy"* ]] ; then pip install mypy ; fi
script:
- py.test -vv --cov=injector --cov-branch --cov-report html --cov-report term
- if [[ "${TRAVIS_PYTHON_VERSION}" != "pypy"* ]] ; then mypy injector.py ; fi

7
mypy.ini Normal file
View File

@ -0,0 +1,7 @@
[mypy]
ignore_missing_imports = true
follow_imports = error
warn_no_return = true
warn_redundant_casts = true
# TODO: disallow untyped defs once we have full type hint coverage
disallow_untyped_defs = false