@@ -149,7 +149,7 @@ def pytest(context, name=NAME, image_ver=IMAGE_VER, local=INVOKE_LOCAL):
149
149
# pty is set to true to properly run the docker commands due to the invocation process of docker
150
150
# https://docs.pyinvoke.org/en/latest/api/runners.html - Search for pty for more information
151
151
# 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"
153
153
run_cmd (context , exec_cmd , name , image_ver , local )
154
154
155
155
@@ -185,6 +185,20 @@ def flake8(context, name=NAME, image_ver=IMAGE_VER, local=INVOKE_LOCAL):
185
185
run_cmd (context , exec_cmd , name , image_ver , local )
186
186
187
187
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
+
188
202
@task
189
203
def pylint (context , name = NAME , image_ver = IMAGE_VER , local = INVOKE_LOCAL ):
190
204
"""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):
277
291
pylint (context , name , image_ver , local )
278
292
yamllint (context , name , image_ver , local )
279
293
pydocstyle (context , name , image_ver , local )
294
+ mypy (context , name , image_ver , local )
280
295
bandit (context , name , image_ver , local )
281
296
pytest (context , name , image_ver , local )
282
297
0 commit comments