Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lx9FNLG2CqeBbVGGd9bFsP
15 lines
486 B
Bash
Executable File
15 lines
486 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Fails when a production Go file exceeds 600 lines (docs/MAINTAINABILITY.md).
|
|
set -euo pipefail
|
|
limit=600
|
|
fail=0
|
|
while IFS= read -r f; do
|
|
[ -f "$f" ] || continue # listed in the index but deleted in the working tree
|
|
n=$(wc -l <"$f")
|
|
if [ "$n" -gt "$limit" ]; then
|
|
echo "$f: $n lines (limit $limit): split it by concern"
|
|
fail=1
|
|
fi
|
|
done < <(git ls-files --cached --others --exclude-standard '*.go' | grep -v '_test\.go$' | grep -v '^web/')
|
|
exit $fail
|