fix: Makefile target hooks makes precommit work finally
This commit is contained in:
parent
9dd1a655d7
commit
77c1323ae5
6 changed files with 5 additions and 20 deletions
7
Makefile
7
Makefile
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue