#!/usr/bin/env bash # Run formatters, lint, type checks, and generated-code checks. Marmot checks # its bindings against fresh production storage. test.sh runs this first. # # Run it before every commit. jj never runs git hooks, so pre-commit does not # guard a `jj commit`; this script is the hook for those. set -euo pipefail cd "$(dirname "$0")/.." source test/resources.sh # treefmt runs the formatters and linters configured in nix/treefmt.nix. # It rewrites what it fixes and fails when it had to, so commit the result. nix fmt -- --fail-on-change --no-cache ty check uv lock --check --offline --no-python-downloads --project python test/gleam-lint.sh python3 test/marmot.py --check test/packages.sh check go -C cli/tools/apigen run . -check test -d web/node_modules || npm --prefix web ci --no-audit --no-fund npm --prefix web run generate:check test/property_wrappers.py go -C cli vet ./...