与 Docker 构建的 tsc -b 对齐,避免类型错误在服务器构建才暴露。 Co-authored-by: Cursor <cursoragent@cursor.com>
11 lines
393 B
Bash
Executable File
11 lines
393 B
Bash
Executable File
#!/usr/bin/env bash
|
||
set -euo pipefail
|
||
|
||
ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
||
git -C "$ROOT_DIR" config core.hooksPath .githooks
|
||
echo "已启用 .githooks:"
|
||
echo " pre-commit: 暂存的 Python 格式 + 前端 TypeScript"
|
||
echo " pre-push: 上述检查 + pytest"
|
||
echo " TYPECHECK=1 git push 可额外跑 Pyright"
|
||
echo "紧急绕过:git push --no-verify 或 SKIP_TESTS=1 git push"
|