Pre-commit hook runs lint+fmt-check, not full check (TDD)
Tests are deliberately excluded from the pre-commit hook so that the TDD red-phase commit (failing tests landing before implementation) can land on a feature branch. CI still runs full make check via docker build so a red branch cannot reach main.
This commit is contained in:
8
Makefile
8
Makefile
@@ -36,6 +36,10 @@ docker:
|
||||
docker build -t quack .
|
||||
|
||||
hooks:
|
||||
@printf '#!/bin/sh\nset -e\nmake check\n' > .git/hooks/pre-commit
|
||||
@printf '#!/bin/sh\nset -e\nmake lint\nmake fmt-check\n' > .git/hooks/pre-commit
|
||||
@chmod +x .git/hooks/pre-commit
|
||||
@echo "Installed pre-commit hook (runs make check)."
|
||||
@echo "Installed pre-commit hook (runs make lint && make fmt-check)."
|
||||
@echo "Note: tests are deliberately not in the pre-commit hook so the"
|
||||
@echo "TDD red-phase commit (failing tests, no implementation yet)"
|
||||
@echo "can land. CI runs make check via docker build, which catches"
|
||||
@echo "any branch that ships red."
|
||||
|
||||
Reference in New Issue
Block a user