Skip to content

Disable custom gates and hooks by default #428

Disable custom gates and hooks by default

Disable custom gates and hooks by default #428

Workflow file for this run

name: size-budget
on:
pull_request:
push:
branches:
- main
jobs:
enforce-file-size:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Enforce 800 LOC budget on elixir/lib/**/*.ex
run: |
set -euo pipefail
# Hard ceiling for any single Elixir source file under elixir/lib/.
# Rationale: anything north of ~800 LOC is a refactoring smell. The
# repo's own CLAUDE.md flags ">600 mandatory split" — we use 800 to
# absorb the realistic post-split tail (helpers + types + specs).
# Bumped 800→850: orchestrator.ex absorbs Gate D result handler
# until a dedicated GateResultHandler sibling is extracted.
# 850 restored after SYM-18 extracted AgentExit sibling
# (PR #178, commit pending).
LIMIT=850
fail=0
while IFS= read -r path; do
loc=$(wc -l < "$path" | tr -d ' ')
if [ "$loc" -gt "$LIMIT" ]; then
echo "::error file=$path::$loc LOC exceeds $LIMIT-LOC budget. Split it or raise LIMIT in .github/workflows/size-budget.yml."
fail=1
fi
done < <(find elixir/lib -type f -name '*.ex')
exit "$fail"