From 8c7df47b8820bb69a80499c8788cc3c9d7177075 Mon Sep 17 00:00:00 2001 From: Jakub Stasiak Date: Wed, 19 Sep 2018 12:33:48 +0200 Subject: [PATCH] Add mypy to CI Since we already have some type hints in the codebase let's make sure they're actually consistent. --- .travis.yml | 6 +++++- mypy.ini | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 mypy.ini diff --git a/.travis.yml b/.travis.yml index 111690f..7828dc9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,4 +17,8 @@ matrix: - { python: "3.7", dist: xenial, sudo: true } install: - 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 diff --git a/mypy.ini b/mypy.ini new file mode 100644 index 0000000..3ee84ca --- /dev/null +++ b/mypy.ini @@ -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