mirror of
https://github.com/kuhyx/utils.git
synced 2026-11-10 19:47:38 +01:00
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
26 lines
914 B
Bash
Executable File
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 "$@"
|