-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathMakefile
More file actions
78 lines (59 loc) · 2.7 KB
/
Copy pathMakefile
File metadata and controls
78 lines (59 loc) · 2.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
.PHONY: help install install-deps lint lint-python lint-tui lint-bridge test test-python test-tui build build-tui build-bridge check-commits check-pr-title check-large-files ci clean
PYTHON ?= python3
PYTHON_LINT_TARGETS ?= scripts/check_commit_file.py scripts/check_commit_messages.py scripts/check_pr_title.py scripts/check_large_files.py scripts/commit_lint.py tests/test_commit_lint.py tests/test_large_file_check.py
COMMIT_RANGE ?= origin/main..HEAD
help:
@echo "Targets:"
@echo " install Install Python deps, Node deps, and git hooks"
@echo " install-deps Install Python deps only (CI uses this)"
@echo " lint Run Python, TUI, and bridge lint gates"
@echo " lint-python Ruff-check the current lint target set"
@echo " lint-tui TypeScript lint + RPC drift check"
@echo " lint-bridge Bridge package build check"
@echo " test Run focused Python checks and TUI tests"
@echo " check-commits Validate Conventional Commit subjects"
@echo " check-pr-title Validate the PR title in PR_TITLE"
@echo " check-large-files Validate PR files avoid blocked assets and size bloat"
@echo " ci Run the local CI gate"
@echo " clean Remove generated caches and build output"
install-deps:
uv sync --frozen --extra dev --dev
install: install-deps
uv run pre-commit install
uv run pre-commit install --hook-type commit-msg
npm ci
npm ci --prefix ui-tui
npm ci --prefix bridge
lint: lint-python lint-tui lint-bridge
lint-python:
uv run --extra dev ruff check $(PYTHON_LINT_TARGETS)
uv run --extra dev ruff format --check $(PYTHON_LINT_TARGETS)
lint-tui:
npm run lint --prefix ui-tui
npm run lint:rpc --prefix ui-tui
npm run type-check --prefix ui-tui
lint-bridge:
npm run build --prefix bridge
test: test-python test-tui
test-python:
uv run --extra dev pytest tests/test_commit_lint.py tests/test_large_file_check.py tests/test_cli_smoke.py tests/test_litellm_setup.py -q
test-tui:
npm test --prefix ui-tui
build: build-tui build-bridge
build-tui:
npm run build --prefix ui-tui
build-bridge:
npm run build --prefix bridge
check-commits:
npx commitlint --from origin/main --to HEAD --config commitlint.config.cjs
PYTHONPATH=. uv run --extra dev python scripts/check_commit_messages.py $(COMMIT_RANGE)
check-pr-title:
PYTHONPATH=. uv run --extra dev python scripts/check_pr_title.py
check-large-files:
PYTHONPATH=. uv run --extra dev python scripts/check_large_files.py $(COMMIT_RANGE)
ci: lint test build
clean:
rm -rf .pytest_cache .ruff_cache .uv-cache .mypy_cache htmlcov dist build
rm -rf ui-tui/dist ui-tui/coverage ui-tui/.vitest-cache ui-tui/packages/hermes-ink/dist
rm -rf bridge/dist
find . -type d -name __pycache__ -prune -exec rm -rf {} +