-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathMakefile
More file actions
66 lines (51 loc) · 2.08 KB
/
Copy pathMakefile
File metadata and controls
66 lines (51 loc) · 2.08 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
.PHONY: help install lint lint-python lint-ansible format typecheck test update-hooks run-hooks scan-secrets run-gitleaks run-detect-secrets audit-detect-secrets-report hal-completion
help: ## Show this help message
@echo 'Usage: make [target]'
@echo ''
@echo 'Targets:'
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " %-20s %s\n", $$1, $$2}' $(MAKEFILE_LIST)
install: ## Install dependencies and setup pre-commit hooks
uv sync --locked
uv audit
uv run ansible-galaxy collection install community.general
uv run pre-commit install
@if command -v gitleaks >/dev/null 2>&1; then \
echo "gitleaks already installed"; \
else \
HOMEBREW_NO_AUTO_UPDATE=1 brew install --quiet gitleaks; \
fi
$(MAKE) update-hooks
lint: lint-python lint-ansible ## Run all linters
lint-python: ## Run ruff formatter check and linter
uv run ruff format --check .
uv run ruff check .
lint-ansible: ## Run ansible-lint and a playbook syntax check
uv run ansible-lint playbooks/
cd playbooks && ansible-playbook site.yml --syntax-check
format: ## Auto-format and fix lint issues
uv run ruff format .
uv run ruff check --fix .
typecheck: ## Run ty type checker
uv run ty check
test: ## Run tests
uv run pytest tests/ -v
update-hooks: ## Update pre-commit hooks to latest versions
uv run pre-commit autoupdate
run-hooks: ## Run all pre-commit hooks on all files
uv run pre-commit run --all-files
scan-secrets: run-gitleaks run-detect-secrets ## Scan for secrets using all scanners
run-gitleaks: ## Scan full git history for secrets
gitleaks git . --verbose --no-banner
run-detect-secrets: ## Scan for secrets in the codebase
@if [ ! -f .secrets.baseline ]; then \
echo "Creating new baseline..."; \
uv run detect-secrets scan | tee .secrets.baseline; \
else \
echo "Updating existing baseline..."; \
uv run detect-secrets scan --baseline .secrets.baseline; \
fi
audit-detect-secrets-report: ## Interactively review detected secrets
uv run detect-secrets audit .secrets.baseline
hal-completion: ## Regenerate zsh completion script for hal
uv run python scripts/generate-completion.py
hal sync