Files
mp-ai-module-controller/scripts/precommit-check.sh
T

37 lines
899 B
Bash
Raw Normal View History

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
2026-07-21 13:14:52 -05:00
python3 -m unittest tests/test_generate_training_data.py
python3 scripts/generate_training_data.py --dry-run
2026-07-21 11:10:20 -05:00
echo "precommit check complete"