From cf14db5670b68e8cf621759eb4a5a9d109d14e3c Mon Sep 17 00:00:00 2001 From: EllAchE <26192612+EllAchE@users.noreply.github.com> Date: Mon, 23 Nov 2026 03:51:17 -0500 Subject: [PATCH] Run release mutation testing before local pushes Use a tracked pre-push hook to report missed release-package mutations. Warn and continue if the report cannot run. --- .githooks/pre-push | 5 +++++ README.md | 10 +++++++++- scripts/mutation-test.sh | 4 ++-- 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100755 .githooks/pre-push diff --git a/.githooks/pre-push b/.githooks/pre-push new file mode 100755 index 0000000..6027d5d --- /dev/null +++ b/.githooks/pre-push @@ -0,0 +1,5 @@ +#!/bin/sh + +if ! ./scripts/mutation-test.sh ./internal/release &2 +fi diff --git a/README.md b/README.md index 3583efb..9d14661 100644 --- a/README.md +++ b/README.md @@ -297,7 +297,15 @@ The first command of a new release also rewrites the skill wherever it is alread ### Mutation testing -`scripts/mutation-test.sh` runs [gremlins](https://github.com/go-gremlins/gremlins) (pinned to v0.6.0) on one package. It plants small faults and reports which ones no test catches. It is opt-in and report-only: CI does not run it, and it never fails on a low score. +`scripts/mutation-test.sh` runs [gremlins](https://github.com/go-gremlins/gremlins) (pinned to v0.6.0) on one package. It plants small faults and reports which ones no test catches. The report has no pass threshold. + +To run the release package check before every local push, enable the tracked Git hook once per clone. + +```bash +git config --local core.hooksPath .githooks +``` + +If you already use custom hooks, call `scripts/mutation-test.sh ./internal/release` from your existing pre-push hook. The tracked hook prints the report or a warning and lets the push proceed. To check any package manually, run the script directly. ```bash scripts/mutation-test.sh ./internal/release [--out report.json] [--workers 2] diff --git a/scripts/mutation-test.sh b/scripts/mutation-test.sh index c2807bf..ddb7069 100755 --- a/scripts/mutation-test.sh +++ b/scripts/mutation-test.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Mutation-test Go packages with gremlins. Opt-in and report-only: nothing in CI runs it, and it -# never fails on a low score. +# Mutation-test Go packages with gremlins. Scores are for review and carry no pass threshold. +# The local pre-push hook checks the release package. # # Usage: # scripts/mutation-test.sh [--out ] [--workers ]