From 507fb6f2a2328a092069d6e5fadff0372da36fda Mon Sep 17 00:00:00 2001 From: Vinston Date: Thu, 26 Feb 2026 13:53:01 -0500 Subject: [PATCH] chore: add pre-commit hook for fmt-check and lint --- .githooks/pre-commit | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 .githooks/pre-commit diff --git a/.githooks/pre-commit b/.githooks/pre-commit new file mode 100755 index 0000000..db35dde --- /dev/null +++ b/.githooks/pre-commit @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +set -euo pipefail + +echo "🔍 Running fmt check..." +make fmt-check 2>&1 || { + echo "❌ Format check failed. Run 'make fmt' and re-commit." + exit 1 +} + +echo "🔍 Running lint..." +if ! make lint 2>&1; then + echo "⚠️ Lint warnings found. Review above before pushing." + echo " To skip: git commit --no-verify" +fi + +echo "✅ Pre-commit checks passed."