Skip to content

Commit 2662bcf

Browse files
committed
feat: add quality targets to Makefile
Thus, we simplify tox.ini and make it possible to run quality targets with `make`.
1 parent 5fc521d commit 2662bcf

File tree

3 files changed

+23
-10
lines changed

3 files changed

+23
-10
lines changed

Makefile

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
.DEFAULT_GOAL := help
55

6+
PYTHON_FILES = ./code_annotations/ setup.py tests/ test_utils/
7+
68
define BROWSER_PYSCRIPT
79
import os, webbrowser, sys
810
try:
@@ -73,11 +75,27 @@ requirements: ## install development environment requirements
7375
pip-sync requirements/dev.txt requirements/test.txt requirements/private.*
7476
pip install -e .
7577

76-
test: clean ## run tests in the current virtualenv
78+
test: clean test-unit test-quality ## run tests in the current virtualenv
79+
80+
test-unit: ## run unit tests
7781
pytest
7882

83+
test-quality: test-lint test-types test-codestyle test-docstyle test-isort selfcheck ## run all quality tests
84+
85+
test-codestyle: ## run pycodestyle tests
86+
pycodestyle ${PYTHON_FILES}
87+
88+
test-docstyle: ## run pydocstyle tests
89+
pydocstyle ${PYTHON_FILES}
90+
91+
test-isort: ## run isort tests
92+
isort --check-only --diff ${PYTHON_FILES}
93+
94+
test-lint: ## run pylint tests
95+
pylint ${PYTHON_FILES}
96+
7997
test-types: ## run mypy tests on the whole codebase
80-
mypy --ignore-missing-imports --strict code_annotations/ tests/ test_utils/ setup.py
98+
mypy --ignore-missing-imports --strict ${PYTHON_FILES}
8199

82100
diff_cover: test ## find diff lines that need test coverage
83101
diff-cover coverage.xml

docs/testing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ To run just the unit tests:
1515

1616
.. code-block:: bash
1717
18-
$ make test
18+
$ make test-unit
1919
2020
To run just the unit tests and check diff coverage
2121

@@ -27,7 +27,7 @@ To run just the code quality checks:
2727

2828
.. code-block:: bash
2929
30-
$ make quality
30+
$ make test-quality
3131
3232
To run the unit tests under every supported Python version and the code
3333
quality checks:

tox.ini

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,4 @@ deps =
5050
setuptools
5151
-r{toxinidir}/requirements/quality.txt
5252
commands =
53-
pylint code_annotations tests test_utils setup.py
54-
make test-types
55-
pycodestyle code_annotations tests setup.py
56-
pydocstyle code_annotations tests setup.py
57-
isort --check-only --diff tests test_utils code_annotations setup.py
58-
make selfcheck
53+
make test-quality

0 commit comments

Comments
 (0)