Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .githooks/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

if ! ./scripts/mutation-test.sh ./internal/release </dev/null; then
printf '%s\n' 'Release mutation testing did not complete. Continuing with the push.' >&2
fi
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions scripts/mutation-test.sh
Original file line number Diff line number Diff line change
@@ -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 <package-path> [--out <report.json>] [--workers <n>]
Expand Down
Loading