19 lines
899 B
Bash
Executable File
19 lines
899 B
Bash
Executable File
#!/bin/sh
|
|
# Pre-review gate: build rules plus house rules.
|
|
set -eu
|
|
cargo fmt --check
|
|
cargo clippy --all-targets --features test-support -- -D warnings
|
|
cargo test --lib --features test-support --quiet
|
|
fail=0
|
|
files=$(git ls-files -co --exclude-standard '*.rs')
|
|
multi=$(awk 'FNR==1{prev=0} /^[[:space:]]*\/\// {if(prev) print FILENAME":"FNR; prev=1; next} {prev=0}' $files)
|
|
[ -z "$multi" ] || { echo "multi-line comments:"; echo "$multi"; fail=1; }
|
|
for f in $files AGENTS.md README.md TASKS.md tasks/*.md; do
|
|
n=$(wc -l < "$f")
|
|
[ "$n" -le 500 ] || { echo "$f has $n lines"; fail=1; }
|
|
done
|
|
components=$(find src -name '*.rs' ! -path 'src/theme/*' ! -path 'src/motion/*' ! -path '*/tests/*' ! -name 'tests.rs')
|
|
raw=$(awk '/#\[cfg\(test\)\]/{nextfile} /(^|[^.[:alnum:]_])px\(/{print FILENAME":"FNR": "$0}' $components)
|
|
[ -z "$raw" ] || { echo "raw px in components:"; echo "$raw"; fail=1; }
|
|
exit $fail
|