Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (33 loc) · 1.51 KB
/
Copy pathMakefile
File metadata and controls
44 lines (33 loc) · 1.51 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
UV := $(or $(shell command -v uv 2>/dev/null),$(HOME)/.local/bin/uv)
.PHONY: help lint format test test-functional typecheck install-hooks ci security check-deps
help:
@echo "Available commands:"
@echo " make install-hooks - Install pre-commit hooks (RUN THIS FIRST)"
@echo " make lint - Run ruff linter"
@echo " make format - Format code with ruff"
@echo " make test - Run unit tests with coverage (fast, ~30s)"
@echo " make test-functional - Run functional tests (slow, 9+ min, requires PC access)"
@echo " make typecheck - Run mypy type checking"
@echo " make security - Run bandit security scan"
@echo " make check-deps - Check published deps against ntnx SDK client pins (needs network)"
@echo " make ci - Run all checks (format, lint, typecheck, test)"
install-hooks:
@echo "Installing pre-commit hooks..."
$(UV) run pre-commit install
@echo "Pre-commit hooks installed. Code will be formatted on each commit."
lint:
$(UV) run ruff check .
format:
$(UV) run ruff format .
typecheck:
$(UV) run mypy ztf/ --ignore-missing-imports
test:
$(UV) run python -m pytest tests/ --ignore=tests/functional -v --cov=ztf --cov-report=term-missing --cov-fail-under=95
test-functional:
$(UV) run python -m pytest tests/functional -v --timeout=600
security:
$(UV) run bandit -r ztf/ -c pyproject.toml
check-deps:
$(UV) run python scripts/check_dependency_compat.py
ci: format lint typecheck test
@echo "All checks passed!"