diff options
| author | Ethan Werner <mail@ethanwerner.com> | 2026-07-01 09:42:39 +0400 |
|---|---|---|
| committer | Ethan Werner <mail@ethanwerner.com> | 2026-07-01 09:42:39 +0400 |
| commit | 07e18043145f3d91c8ea7ec3ad41b3c905585277 (patch) | |
| tree | 2bdeae46973f4bdfce263679a4008ac768011f28 /.githooks | |
initial commit: ts time series analysis library v0.1.0
- 354 financial and mathematical time-series indicators
- Uniform C11 API with consistent function signatures
- 349 passing tests with -Werror
- Static and shared library builds
- pkg-config integration
- Python bindings
- Fuzzing and sanitizer support
- Security hardening flags
Diffstat (limited to '.githooks')
| -rwxr-xr-x | .githooks/pre-commit | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/.githooks/pre-commit b/.githooks/pre-commit new file mode 100755 index 0000000..b931987 --- /dev/null +++ b/.githooks/pre-commit @@ -0,0 +1,28 @@ +#!/bin/sh +set -e + +# Pre-commit hook: run tests before allowing commit +# Skip with: SKIP_PRE_COMMIT=1 git commit +# Skip on force push: git commit --no-verify + +if [ "$SKIP_PRE_COMMIT" = "1" ]; then + exit 0 +fi + +# Only run tests if C/H/Makefile changed +staged=$(git diff --cached --name-only --diff-filter=d) +if echo "$staged" | grep -qE '\.(c|h)$|^Makefile$'; then + # Run build check + if ! make >/dev/null 2>&1; then + echo "PRE-COMMIT FAILED: build did not succeed." + exit 1 + fi + + # Run tests + if ! make test >/dev/null 2>&1; then + echo "PRE-COMMIT FAILED: tests did not pass." + exit 1 + fi +fi + +exit 0 |