fix: Makefile target hooks makes precommit work finally

This commit is contained in:
Bernd Worsch 2025-09-13 21:58:19 +00:00
parent 9dd1a655d7
commit 77c1323ae5
6 changed files with 5 additions and 20 deletions

View file

@ -23,9 +23,12 @@ help: ## Show this help
grep -E '^[a-zA-Z0-9_-]+:.*?## ' $(MAKEFILE_LIST) | sort | sed 's/:.*##/: /'
# ---- Git hooks ----
hooks: ## Configure git to use repo-local hooks (.githooks)
hooks: ## Configure git to use repo-local hooks (.githooks) and ensure executables
@mkdir -p .githooks
git config core.hooksPath .githooks
@echo "✔ hooks enabled (core.hooksPath=.githooks)"
@test -f .githooks/pre-commit || (echo "❌ Missing .githooks/pre-commit"; exit 1)
chmod +x .githooks/pre-commit
@echo "✔ hooks enabled and pre-commit is executable"
hooks-test: ## Test secrets hook blocks plaintext in secrets/
@mkdir -p secrets && echo 'PLAINTEXT_TEST=true' > secrets/_hook_test.yaml