2026-07-21 11:10:20 -05:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
|
|
cd "$(dirname "$0")/.."
|
|
|
|
|
|
|
|
|
|
cargo fmt --check
|
|
|
|
|
cargo test
|
|
|
|
|
cargo run -- dictionary generate
|
|
|
|
|
|
|
|
|
|
test -s dictionary/actions.jsonl
|
|
|
|
|
test -s dictionary/actions.index.json
|
2026-07-21 11:25:45 -05:00
|
|
|
test -s dictionary/model.codebook.json
|
|
|
|
|
test -s dictionary/model.examples.jsonl
|
|
|
|
|
test -s dictionary/static-base.json
|
|
|
|
|
|
|
|
|
|
python3 - <<'PY'
|
|
|
|
|
import json
|
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
|
|
for path in [
|
|
|
|
|
"dictionary/actions.index.json",
|
|
|
|
|
"dictionary/model.codebook.json",
|
|
|
|
|
"dictionary/static-base.json",
|
|
|
|
|
]:
|
|
|
|
|
json.loads(Path(path).read_text())
|
|
|
|
|
|
|
|
|
|
for path in ["dictionary/actions.jsonl", "dictionary/model.examples.jsonl"]:
|
|
|
|
|
for line_number, line in enumerate(Path(path).read_text().splitlines(), start=1):
|
|
|
|
|
if line.strip():
|
|
|
|
|
json.loads(line)
|
|
|
|
|
PY
|
2026-07-21 11:10:20 -05:00
|
|
|
|
|
|
|
|
echo "precommit check complete"
|