File size: 742 Bytes
3d5c3e3
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh
set -e
# Prefer the repo venv: a bare `python` resolves to system Python in normal
# shells and fails collection (no pydantic). Windows venv layout first.
if [ -x ".venv/Scripts/python.exe" ]; then PY=".venv/Scripts/python.exe";
elif [ -x ".venv/bin/python" ]; then PY=".venv/bin/python";
else PY="python"; fi
CHANGED=$(git diff --cached --name-only --diff-filter=ACM || true)
CHANGED_PY=$(echo "$CHANGED" | grep '\.py$' || true)
if [ -n "$CHANGED_PY" ]; then "$PY" scripts/guards/no_raw_clients.py $CHANGED_PY; fi
# Mojibake lives in string content, not Python syntax — scan all staged text files.
if [ -n "$CHANGED" ]; then "$PY" scripts/guards/no_mojibake.py $CHANGED; fi
"$PY" -m ruff check .
"$PY" -m pytest -q