#!/usr/bin/env bash
# Run the fixture regression check when the linter itself (lint.py), its
# shared foundation (textcore.py), or the fixtures were touched in this
# commit. (uv startup makes running it on every commit noticeably slow,
# so it only runs when relevant.)
#
# Enable with: git config core.hooksPath .githooks

set -euo pipefail

REPO_ROOT="$(git rev-parse --show-toplevel)"

if git -C "${REPO_ROOT}" diff --cached --name-only | grep -qE '^skills/natural-japanese/scripts/lint\.py$|^skills/natural-japanese/scripts/textcore\.py$|^skills/natural-japanese/scripts/fixtures/'; then
  "${REPO_ROOT}/dev/check-fixtures.sh"
fi
