From ef7af8ea7bd32a87edc16916a1d95ce65945ecbe Mon Sep 17 00:00:00 2001 From: BryanFRD Date: Fri, 8 May 2026 15:49:53 +0200 Subject: [PATCH] chore(hooks): mirror CI checks in pre-push hook --- .githooks/install.sh | 6 ++++++ .githooks/pre-push | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 .githooks/install.sh create mode 100644 .githooks/pre-push diff --git a/.githooks/install.sh b/.githooks/install.sh new file mode 100644 index 0000000..e1dbf33 --- /dev/null +++ b/.githooks/install.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -euo pipefail +git config core.hooksPath .githooks +chmod +x .githooks/pre-push 2>/dev/null || true +echo "Git hooks installed (core.hooksPath=.githooks)." +echo "pre-push: shellcheck scripts/*.sh + bats tests/ (skipped if tools missing)" diff --git a/.githooks/pre-push b/.githooks/pre-push new file mode 100644 index 0000000..e4dd979 --- /dev/null +++ b/.githooks/pre-push @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +set -euo pipefail + +if command -v shellcheck >/dev/null 2>&1; then + echo "==> shellcheck scripts/*.sh" + shellcheck scripts/*.sh +else + echo "(shellcheck not installed — skipping; CI will run it)" +fi + +if command -v bats >/dev/null 2>&1; then + echo "==> bats tests/" + bats tests/ +else + echo "(bats not installed — skipping; CI will run it)" +fi