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