tox.ini: Add static type checking using mypy.

Signed-off-by: Chris PeBenito <pebenito@ieee.org>
This commit is contained in:
Chris PeBenito 2020-10-02 15:40:12 -04:00
parent 49dd143df4
commit 41632dce9d
4 changed files with 30 additions and 1 deletions

1
.gitignore vendored
View File

@ -1,5 +1,6 @@
/.eggs
/.idea
/.mypy_cache
/build
/dist
/setools.egg-info

13
.mypy.ini Normal file
View File

@ -0,0 +1,13 @@
[mypy]
no_implicit_optional = True
pretty = True
# NetworkX does not have annotations
[mypy-networkx]
ignore_missing_imports = True
[mypy-networkx.*]
ignore_missing_imports = True
[mypy-PyQt5.*]
ignore_missing_imports = True

View File

@ -24,6 +24,7 @@ matrix:
include:
- env: TOX_ENV=pep8
- env: TOX_ENV=lint
- env: TOX_ENV=mypy
# - env: TOX_ENV=coverage
# allow_failures:

16
tox.ini
View File

@ -1,6 +1,6 @@
[tox]
minversion = 1.4
envlist = py3, pep8, lint
envlist = py3, pep8, lint, mypy
[pycodestyle]
max-line-length = 100
@ -33,6 +33,20 @@ commands = pylint -E --rcfile .pylintrc setools tests seinfo seinfoflow s
# pylint can't see all members introduced by PyQt uic
pylint -E --rcfile .pylintrc --disable=no-member,import-error setoolsgui apol
[testenv:mypy]
deps = {[testenv]deps}
mypy
commands_pre = mypy --version
commands = mypy -p setools
mypy -p setoolsgui
mypy seinfo
mypy seinfoflow
mypy sedta
mypy sesearch
mypy sediff
mypy sechecker
mypy apol
[testenv]
passenv = USERSPACE_SRC
deps = networkx==2.0