Skip to content

Commit

Permalink
mypy: Disallow "Any" type in some circumstances
Browse files Browse the repository at this point in the history
This is only to prevent us from introducing needless problems in the
future.

This change also moves the duplicated mypy configuration into one single
place (setup.cfg).
  • Loading branch information
walles committed Jul 23, 2017
1 parent 4f014b3 commit f84abf6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ if python --version 2>&1 | grep " 3" ; then
# Verson of "python" binary is 3, do static type analysis. Mypy requires
# Python 3, that's why we do this only on Python 3.
pip install -r requirements-dev-py3.txt
mypy --py2 --ignore-missing-imports --check-untyped-defs ./*.py ./*/*.py
mypy ./*.py ./*/*.py
fi

# FIXME: We want to add to the coverage report, not overwrite it. How do we do
Expand Down
6 changes: 6 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,9 @@ max-line-length = 100

[tool:pytest]
testpaths = tests

[mypy]
python_version = 2.7
disallow_any = unimported,explicit,generics
ignore_missing_imports = True
check_untyped_defs = True
2 changes: 1 addition & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function do-tests() {
# Verson of "python" binary is 3, do static type analysis. Mypy requires
# Python 3, that's why we do this only on Python 3.
pip install -r requirements-dev-py3.txt
mypy --py2 --ignore-missing-imports --check-untyped-defs ./*.py ./*/*.py
mypy ./*.py ./*/*.py
fi

# Run tests
Expand Down

0 comments on commit f84abf6

Please sign in to comment.