#!/usr/bin/env bash # Every check this repo has, in one command. There is no CI, so this is the gate: # run it before committing, and treat a checker that cannot run as a failure. # # scripts/check.sh backend and web # scripts/check.sh backend just one half # scripts/check.sh web # # PYTHON picks the interpreter (default: python-backend/.venv/bin/python, else python3). set -euo pipefail repo="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" what="${1:-all}" backend() { cd "$repo/python-backend" local python="${PYTHON:-}" if [[ -z "$python" ]]; then if [[ -x .venv/bin/python ]]; then python=.venv/bin/python; else python=python3; fi fi echo "== backend: pytest" "$python" -m pytest -q echo "== backend: ruff" "$python" -m ruff check . echo "== backend: mypy" "$python" -m mypy } web() { cd "$repo/web" echo "== web: vitest" npm run --silent test echo "== web: tsc + eslint" npm run --silent check } case "$what" in all) backend; web ;; backend) backend ;; web) web ;; *) echo "usage: $0 [all|backend|web]" >&2; exit 2 ;; esac echo "== all checks passed"