#!/usr/bin/env bash # The static checks: formatters, linters, type checks and the generated-code # checks. Seconds, no daemon. test.sh runs it 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: the formatters and linters CI runs (Gleam, Go, Nix, Python with Ruff # format and check, shell). It rewrites what it fixes and fails when it had to, # so commit the result nix fmt -- --fail-on-change --no-cache ty check test/gleam-lint.sh 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 go -C cli vet ./...