- docs/MAINTAINABILITY.md: limits and architecture rules - .golangci.yml (pinned v2.14.0) + file-size check; make lint runs first in every gate - web/go.mod stops the Go tool from walking web/node_modules - layering: Target -> internal/snmptarget, TableKey -> profile.Metric.TableKey; poller no longer imports discovery Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lx9FNLG2CqeBbVGGd9bFsP
14 lines
406 B
Bash
Executable File
14 lines
406 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
|
|
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
|