Files
boxmaker/scripts/check-lines.sh
T
kyle 8dc04b1d48 Add Cargo workspace, crate skeletons and the gate
Implemented-By: Laguna S 2.1 (OpenCode)
2026-09-17 06:45:02 -07:00

15 lines
439 B
Bash

#!/bin/sh
# Fails if any *.rs file under ROOT/crates has more than 500 lines.
# Files under any target/ directory are ignored. Test files count.
ROOT="${1:-.}"
bad=$(find "$ROOT/crates" -type f -name '*.rs' ! -path '*/target/*' \
-exec awk 'END { exit !(NR > 500) }' {} \; -print 2>/dev/null)
if [ -n "$bad" ]; then
echo "$bad" | while read -r f; do
[ -n "$f" ] && echo "check-lines: $f" >&2
done
exit 1
fi
exit 0