Files
the-nexus/.githooks/pre-commit
Timmy 83b53d0659
Some checks failed
Deploy Nexus / deploy (push) Failing after 4s
enforce: 777-line hard limit on JS files — CI gate + pre-commit hook
app.js is a THIN WRAPPER. No file over 777 lines.
Current app.js is 2214 lines — must be broken up before any new features merge.

CI will block PRs that violate this. Pre-commit hook catches it locally.
Install hook: git config core.hooksPath .githooks
2026-03-25 11:16:32 -04:00

20 lines
552 B
Bash
Executable File

#!/usr/bin/env bash
# Pre-commit hook: enforce 777-line limit on JS files
# Install: git config core.hooksPath .githooks
FAIL=0
for f in $(git diff --cached --name-only --diff-filter=ACM | grep '\.js$' | grep -v node_modules | grep -v tests/); do
LINES=$(wc -l < "$f" | tr -d ' ')
if [ "$LINES" -gt 777 ]; then
echo "BLOCKED: $f is $LINES lines (max: 777)"
echo " Extract into a module. app.js is a thin wrapper."
FAIL=1
fi
done
if [ $FAIL -eq 1 ]; then
echo ""
echo "No JS file may exceed 777 lines. Break it up."
exit 1
fi