-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
89 lines (75 loc) · 2.06 KB
/
Makefile
File metadata and controls
89 lines (75 loc) · 2.06 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
all: format check
format: prettier black ruff pyright
check: mypy checkblack checkruff checkprettier
pyright:
uv run ./node_modules/.bin/pyright
prettier:
@if [ -x ./node_modules/.bin/prettier ]; then \
./node_modules/.bin/prettier --write .; \
elif command -v npx >/dev/null 2>&1; then \
npx --yes prettier --write .; \
else \
echo "prettier not found; skipping (install via 'npm i -D prettier')"; \
fi
mypy:
@if command -v uv >/dev/null 2>&1; then \
echo "Running mypy via uv"; \
uv run mypy .; \
else \
echo "uv not found; falling back to system Python mypy"; \
python3 -m mypy .; \
fi
black:
@if command -v uv >/dev/null 2>&1; then \
uv run black .; \
elif command -v black >/dev/null 2>&1; then \
black .; \
else \
python3 -m black . || echo "black not available"; \
fi
ruff:
@if command -v uv >/dev/null 2>&1; then \
uv run ruff check . --fix; \
elif command -v ruff >/dev/null 2>&1; then \
ruff check . --fix; \
else \
python3 -m ruff check . --fix || echo "ruff not available"; \
fi
checkruff:
@if command -v uv >/dev/null 2>&1; then \
uv run ruff check .; \
elif command -v ruff >/dev/null 2>&1; then \
ruff check .; \
else \
python3 -m ruff check . || echo "ruff not available"; \
fi
checkprettier:
@if [ -x ./node_modules/.bin/prettier ]; then \
./node_modules/.bin/prettier --check .; \
elif command -v npx >/dev/null 2>&1; then \
npx --yes prettier --check .; \
else \
echo "prettier not found; skipping check (install via 'npm i -D prettier')"; \
fi
checkblack:
@if command -v uv >/dev/null 2>&1; then \
uv run black --check .; \
elif command -v black >/dev/null 2>&1; then \
black --check .; \
else \
python3 -m black --check . || echo "black not available"; \
fi
checkeditorconfig:
editorconfig-checker
test:
PYTHONUNBUFFERED=1 \
DEBUG=true \
uv run pytest
install-pre-commit-hook:
@echo "Installing pre-commit hook to git"
@echo "Uninstall the hook with uv run pre-commit uninstall"
uv run pre-commit install
pre-commit:
uv run pre-commit run --all-files
checkbundle:
@echo "skipping checkbundle"