From 07e18043145f3d91c8ea7ec3ad41b3c905585277 Mon Sep 17 00:00:00 2001 From: Ethan Werner Date: Wed, 1 Jul 2026 09:42:39 +0400 Subject: 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 --- .githooks/pre-commit | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 .githooks/pre-commit (limited to '.githooks') 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 -- cgit v1.3.1