forked from geoopt/geoopt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (31 loc) · 1.35 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
.PHONY: help dockstyle-check codestyle-check linter-check black test lint check sphinx-check
.DEFAULT_GOAL = help
PYTHON = python
PIP = pip
CONDA = conda
SHELL = bash
help:
@printf "Usage:\n"
@grep -E '^[a-zA-Z_-]+:.*?# .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?# "}; {printf "\033[1;34mmake %-15s\033[0m%s\n", $$1, $$2}'
docstyle-check: # Check geoopt with pydocstyle
@printf "Checking documentation with pydocstyle...\n"
pydocstyle geoopt
@printf "\033[1;34mPydocstyle passes!\033[0m\n\n"
sphinx-check:
@printf "Checking sphinx build...\n"
SPHINXOPTS=-W make -C docs -f Makefile clean html
@printf "\033[1;34mSphinx passes!\033[0m\n\n"
codestyle-check: # Check geoopt with black
@printf "Checking code style with black...\n"
black --check --diff geoopt tests
@printf "\033[1;34mBlack passes!\033[0m\n\n"
linter-check: # Check geoopt with pylint
@printf "Checking code style with pylint...\n"
pylint geoopt
@printf "\033[1;34mPylint passes!\033[0m\n\n"
black: # Format code in-place using black.
black geoopt tests
test: # Test code using pytest.
pytest -v geoopt tests --doctest-modules --html=testing-report.html --self-contained-html
lint: linter-check codestyle-check docstyle-check sphinx-check # Lint code using black, pylint, pydocstyle and sphinx.
check: lint test # Both lint and test code. Runs `make lint` followed by `make test`.