utils/scripts/check_repo_contract.sh
Krzysztof kuhy Rudnicki 6c71d531bb repo contract + coverage_gaps gates, test_changed, dependency bumps
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-10-04 16:27:28 +02:00

26 lines
914 B
Bash
Executable File

#!/bin/bash
# ============================================================================
# Fail if the current repo breaks the repo contract: CLAUDE.md `## Commands`
# with run / test / test-changed / lint / coverage / coverage-gaps entries and
# a quiet scripts/test_changed.sh. See repo_contract/README.md.
#
# This is the REAL gate. Per-repo scripts/check_repo_contract.sh files are thin
# shims that exec this one -- do not overwrite this file with a shim.
#
# Usage: scripts/check_repo_contract.sh [--repo PATH] # default: cwd
# Exit: 0 pass, 1 violations, 2 not a repo / unreadable.
# ============================================================================
set -euo pipefail
UTILS_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
readonly UTILS_ROOT
main() {
PYTHONPATH="$UTILS_ROOT${PYTHONPATH:+:$PYTHONPATH}" \
python3 "$UTILS_ROOT/repo_contract/check.py" "$@"
}
main "$@"