test-driver: add mypy support

It's a good idea to expand this in future to test code as well,
so we get type checking there as well.
This commit is contained in:
Jörg Thalheim 2019-11-08 10:01:29 +00:00
parent 556a169f14
commit 03e6ca15e2
No known key found for this signature in database
GPG key ID: B3F5D81B0C6967C4
2 changed files with 103 additions and 91 deletions

View file

@ -26,7 +26,7 @@ in rec {
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ (python3.withPackages (p: [ p.ptpython ])) ];
checkInputs = with python3Packages; [ pylint black ];
checkInputs = with python3Packages; [ pylint black mypy ];
dontUnpack = true;
@ -34,6 +34,9 @@ in rec {
doCheck = true;
checkPhase = ''
mypy --disallow-untyped-defs \
--no-implicit-optional \
--ignore-missing-imports ${testDriverScript}
pylint --errors-only ${testDriverScript}
black --check --diff ${testDriverScript}
'';