|
1 | 1 | SHELL=/bin/bash
|
2 | 2 | DATETIME:=$(shell date -u +%Y%m%dT%H%M%SZ)
|
3 | 3 |
|
4 |
| -help: # preview Makefile commands |
| 4 | +help: # Preview Makefile commands |
5 | 5 | @awk 'BEGIN { FS = ":.*#"; print "Usage: make <target>\n\nTargets:" } \
|
6 | 6 | /^[-_[:alpha:]]+:.?*#/ { printf " %-15s%s\n", $$1, $$2 }' $(MAKEFILE_LIST)
|
7 | 7 |
|
8 |
| -## ---- Dependency commands ---- ## |
| 8 | +####################### |
| 9 | +# Dependency commands |
| 10 | +####################### |
9 | 11 |
|
10 |
| -install: # install Python dependencies |
| 12 | +install: # Install Python dependencies |
11 | 13 | pipenv install --dev
|
12 | 14 | pipenv run pre-commit install
|
13 | 15 |
|
14 |
| -update: install # update Python dependencies |
| 16 | +update: install # Update Python dependencies |
15 | 17 | pipenv clean
|
16 | 18 | pipenv update --dev
|
17 | 19 |
|
18 |
| -## ---- Unit test commands ---- ## |
| 20 | +###################### |
| 21 | +# Unit test commands |
| 22 | +###################### |
19 | 23 |
|
20 |
| -test: # run tests and print a coverage report |
| 24 | +test: # Run tests and print a coverage report |
21 | 25 | pipenv run coverage run --source=my_app -m pytest -vv
|
22 | 26 | pipenv run coverage report -m
|
23 | 27 |
|
24 |
| -coveralls: test # write coverage data to an LCOV report |
| 28 | +coveralls: test # Write coverage data to an LCOV report |
25 | 29 | pipenv run coverage lcov -o ./coverage/lcov.info
|
26 | 30 |
|
| 31 | +#################################### |
| 32 | +# Code quality and safety commands |
| 33 | +#################################### |
27 | 34 |
|
28 |
| -## ---- Code quality and safety commands ---- ## |
| 35 | +lint: black mypy ruff safety # Run linters |
29 | 36 |
|
30 |
| -lint: black mypy ruff safety # run linters |
31 |
| - |
32 |
| -black: # run 'black' linter and print a preview of suggested changes |
| 37 | +black: # Run 'black' linter and print a preview of suggested changes |
33 | 38 | pipenv run black --check --diff .
|
34 | 39 |
|
35 |
| -mypy: # run 'mypy' linter |
| 40 | +mypy: # Run 'mypy' linter |
36 | 41 | pipenv run mypy .
|
37 | 42 |
|
38 |
| -ruff: # run 'ruff' linter and print a preview of errors |
| 43 | +ruff: # Run 'ruff' linter and print a preview of errors |
39 | 44 | pipenv run ruff check .
|
40 | 45 |
|
41 |
| -safety: # check for security vulnerabilities and verify Pipfile.lock is up-to-date |
| 46 | +safety: # Check for security vulnerabilities and verify Pipfile.lock is up-to-date |
42 | 47 | pipenv check
|
43 | 48 | pipenv verify
|
44 | 49 |
|
45 |
| -lint-apply: # apply changes with 'black' and resolve 'fixable errors' with 'ruff' |
| 50 | +lint-apply: # Apply changes with 'black' and resolve 'fixable errors' with 'ruff' |
46 | 51 | black-apply ruff-apply
|
47 | 52 |
|
48 |
| -black-apply: # apply changes with 'black' |
| 53 | +black-apply: # Apply changes with 'black' |
49 | 54 | pipenv run black .
|
50 | 55 |
|
51 |
| -ruff-apply: # resolve 'fixable errors' with 'ruff' |
| 56 | +ruff-apply: # Resolve 'fixable errors' with 'ruff' |
52 | 57 | pipenv run ruff check --fix .
|
0 commit comments