-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (41 loc) · 1.7 KB
/
Copy pathMakefile
File metadata and controls
56 lines (41 loc) · 1.7 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
NEW_UID = 1000
NEW_GID = 1000
ifdef DOCKER
RUN_PREFIX := docker compose run --rm app
else ifdef POETRY
RUN_PREFIX := poetry run
else
RUN_PREFIX :=
endif
.SILENT: help
all: help
container-build: ## Build the container
docker compose build --build-arg="NEW_UID=${NEW_UID}" --build-arg="NEW_GID=${NEW_GID}"
container-build-sa: ## Build the container for standalone mode
docker compose build --build-arg="NEW_UID=${NEW_UID}" --build-arg="NEW_GID=${NEW_GID}" --build-arg="standalone=true"
up: ## Start the container
docker compose up
bash: ## Runs a bash prompt inside the container
docker compose run --rm app bash
lint: ## Check for linting errors
$(RUN_PREFIX) ruff check --select E4,E7,E9,F,I,Q
$(RUN_PREFIX) ruff format --diff
lint-fix: ## Fix linting errors
$(RUN_PREFIX) ruff check --select E4,E7,E9,F,I,Q --fix --show-fixes
$(RUN_PREFIX) ruff format
type-check: ## Check for typing errors
$(RUN_PREFIX) mypy app tests
safety-check: ## Check for security vulnerabilities
$(RUN_PREFIX) pip-audit --ignore CVE-2026-4539
spelling-check: ## Check spelling mistakes
$(RUN_PREFIX) codespell . --skip="./app/data.py" --skip="./publiccode.yml"
spelling-fix: ## Fix spelling mistakes
$(RUN_PREFIX) codespell . --write-changes --interactive=3 --skip="./app/data.py" --skip="./publiccode.yml"
test: ## Runs automated tests
$(RUN_PREFIX) pytest --cov --cov-report=term --cov-report=xml
check: lint type-check safety-check spelling-check test ## Runs all checks
fix: lint-fix spelling-fix ## Runs all fixers
help: ## Display available commands
echo "Available make commands:"
echo
grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m %-30s\033[0m %s\n", $$1, $$2}'