Skip to content

Commit 608e290

Browse files
committed
Added invoke commands for running mypy and cleaning up after it
1 parent 6c2b319 commit 608e290

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tasks.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,21 @@ def pytest_clean(context):
5353
rmrf(dirs)
5454
namespace_clean.add_task(pytest_clean, 'pytest')
5555

56+
@invoke.task
57+
def mypy(context):
58+
"Run mypy optional static type checker"
59+
context.run("mypy main.py")
60+
namespace.add_task(mypy)
61+
namespace.add_task(mypy)
62+
63+
@invoke.task
64+
def mypy_clean(context):
65+
"Remove mypy cache directory"
66+
#pylint: disable=unused-argument
67+
dirs = ['.mypy_cache']
68+
rmrf(dirs)
69+
namespace_clean.add_task(mypy_clean, 'mypy')
70+
5671
@invoke.task
5772
def tox(context):
5873
"Run unit and integration tests on multiple python versions using tox"

0 commit comments

Comments
 (0)