30 lines
675 B
Bash
Executable File
30 lines
675 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
cd "$ROOT"
|
|
|
|
PYTHON_BIN="python3"
|
|
if [ -x "$ROOT/.venv/bin/python" ]; then
|
|
PYTHON_BIN="$ROOT/.venv/bin/python"
|
|
fi
|
|
|
|
echo "[qwen-check] Python syntax compile check"
|
|
"$PYTHON_BIN" -m compileall app run.py >/dev/null
|
|
|
|
echo "[qwen-check] Optional ruff check"
|
|
if command -v ruff >/dev/null 2>&1; then
|
|
ruff check app run.py
|
|
else
|
|
echo "[qwen-check] ruff not installed, skipping"
|
|
fi
|
|
|
|
echo "[qwen-check] Optional pytest"
|
|
if command -v pytest >/dev/null 2>&1 && [ -d tests ]; then
|
|
pytest -q
|
|
else
|
|
echo "[qwen-check] tests/ or pytest not found, skipping"
|
|
fi
|
|
|
|
echo "[qwen-check] Done"
|