perfect-postcode/check.sh

41 lines
1.1 KiB
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$ROOT_DIR"
step() {
printf '\n==> %s\n' "$1"
shift
"$@"
}
step "Python lint: ruff" uv run ruff check .
step "Python dependency lint: deptry" uv run deptry .
step "Python unit tests" uv run pytest \
pipeline/utils/test_haversine.py \
pipeline/utils/test_poi_counts.py \
pipeline/download/test_naptan.py \
pipeline/transform/postcode_boundaries/test_postcode_boundaries.py
(
cd "$ROOT_DIR/frontend"
step "Frontend lint: ESLint" npm run lint
step "Frontend format check: Prettier" npm run format:check
step "Frontend typecheck: TypeScript" npm run typecheck
step "Frontend i18n completeness" npm run check:i18n
step "Frontend unit tests: Vitest" npm run test
)
(
cd "$ROOT_DIR/screenshot"
step "Screenshot service unit tests" npm run test
)
(
cd "$ROOT_DIR/server-rs"
step "Rust lint: clippy" cargo clippy --all-targets -- -D warnings
step "Rust format check" cargo fmt --all --check
step "Rust dependency lint: cargo machete" cargo machete
step "Rust unit tests" cargo test
)