Files
hcie-rust-v3.05/.githooks/semantic_check.sh
T
2026-07-09 02:59:53 +03:00

63 lines
1.3 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
set -euo pipefail
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
SCRIPT="$REPO_ROOT/.githooks/generate_semantic_report.py"
usage() {
cat <<EOF
Kullanım: $0 <command>
Commands:
precommit Layer 1+2 hızlı kontrol (staged)
audit Layer 1+2 son commit analizi
full Layer 1+2+3 tam pre-commit (yavaş)
full-audit Layer 1+2+3 tam post-commit
quick Sadece Layer 1 bağımlılık grafiği
json JSON çıktı (CI için)
help Bu mesaj
Örnek:
./\$(basename "$0") precommit
./\$(basename "$0") full --save
./\$(basename "$0") json
EOF
exit 0
}
[ $# -eq 0 ] && usage
case "$1" in
precommit)
shift
python3 "$SCRIPT" --mode staged "$@"
;;
audit)
shift
python3 "$SCRIPT" --mode last "$@"
;;
full)
shift
python3 "$SCRIPT" --mode staged --semver "$@"
;;
full-audit)
shift
python3 "$SCRIPT" --mode last --semver "$@"
;;
quick)
shift
python3 "$SCRIPT" --mode staged --no-api "$@"
;;
json)
shift
python3 "$SCRIPT" --mode last --json "$@"
;;
help|--help|-h)
usage
;;
*)
echo "Bilinmeyen komut: $1"
usage
;;
esac