mirror of
https://github.com/kuhyx/steam-backlog-enforcer.git
synced 2026-11-10 20:27:03 +01:00
Also bumps mcp 2.2.0, ruff 0.16.7, types-requests 2.33.0.20260906 and, in web/, react 19.3.0, vitest 5.0.0 (+ coverage-v8), eslint 10.10.0, typescript-eslint 8.70.0, vite 8.3.0 and the small ones, so the freshness gate lets this through. Web lint/build/tests/coverage (100 %) unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AwtowrowDXx6ccmWVPkCaF
41 lines
1.3 KiB
Bash
Executable File
41 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# ============================================================================
|
|
# Fail if any file exceeds the shared 250-line cap.
|
|
#
|
|
# A file that cannot be read in one piece forces re-reads and partial edits,
|
|
# which is the largest avoidable cost in an LLM-assisted workflow. The cap
|
|
# applies to code AND prose; generated files, markup and data are exempt.
|
|
#
|
|
# This is a VENDORED copy of ~/src/utils/file_length/. It is vendored rather than
|
|
# referenced because pre-commit's `entry:` is not shell-expanded and CI
|
|
# runners have no ~/src/utils -- an external reference would pass locally and
|
|
# silently skip on push.
|
|
#
|
|
# Usage:
|
|
# scripts/check_file_length.sh <file> [<file> ...] # pre-commit passes these
|
|
# scripts/check_file_length.sh --all # whole tree, from cwd
|
|
# ============================================================================
|
|
|
|
set -euo pipefail
|
|
|
|
SCRIPTS_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
readonly SCRIPTS_ROOT
|
|
readonly CHECKER="$SCRIPTS_ROOT/file_length/check.py"
|
|
|
|
main() {
|
|
if [[ $# -eq 0 ]]; then
|
|
echo "Usage: $(basename "$0") <file>... | --all" >&2
|
|
exit 1
|
|
fi
|
|
if [[ ! -f "$CHECKER" ]]; then
|
|
echo "Error: checker not found at $CHECKER" >&2
|
|
exit 1
|
|
fi
|
|
|
|
PYTHONPATH="$SCRIPTS_ROOT${PYTHONPATH:+:$PYTHONPATH}" \
|
|
python3 "$CHECKER" "$@"
|
|
}
|
|
|
|
main "$@"
|