Skip to content

Commit 83a182e

Browse files
committed
Add back mypy and coverage
1 parent e84b3c1 commit 83a182e

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

tasks.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def pytest(context, name=NAME, image_ver=IMAGE_VER, local=INVOKE_LOCAL):
149149
# pty is set to true to properly run the docker commands due to the invocation process of docker
150150
# https://docs.pyinvoke.org/en/latest/api/runners.html - Search for pty for more information
151151
# Install python module
152-
exec_cmd = "pytest -vv"
152+
exec_cmd = "pytest --cov=diffsync --cov-config pyproject.toml --cov-report html --cov-report term -vv"
153153
run_cmd(context, exec_cmd, name, image_ver, local)
154154

155155

@@ -185,6 +185,20 @@ def flake8(context, name=NAME, image_ver=IMAGE_VER, local=INVOKE_LOCAL):
185185
run_cmd(context, exec_cmd, name, image_ver, local)
186186

187187

188+
@task
189+
def mypy(context, name=NAME, image_ver=IMAGE_VER, local=INVOKE_LOCAL):
190+
"""This will run mypy for the specified name and Python version.
191+
Args:
192+
context (obj): Used to run specific commands
193+
name (str): Used to name the docker image
194+
python_ver (str): Will use the Python version docker image to build from
195+
"""
196+
# pty is set to true to properly run the docker commands due to the invocation process of docker
197+
# https://docs.pyinvoke.org/en/latest/api/runners.html - Search for pty for more information
198+
exec_cmd = 'find . -name "*.py" | xargs mypy --show-error-codes'
199+
run_cmd(context, exec_cmd, name, image_ver, local)
200+
201+
188202
@task
189203
def pylint(context, name=NAME, image_ver=IMAGE_VER, local=INVOKE_LOCAL):
190204
"""This will run pylint for the specified name and Python version.
@@ -277,6 +291,7 @@ def tests(context, name=NAME, image_ver=IMAGE_VER, local=INVOKE_LOCAL):
277291
pylint(context, name, image_ver, local)
278292
yamllint(context, name, image_ver, local)
279293
pydocstyle(context, name, image_ver, local)
294+
mypy(context, name, image_ver, local)
280295
bandit(context, name, image_ver, local)
281296
pytest(context, name, image_ver, local)
282297

0 commit comments

Comments
 (0)