steam-backlog-enforcer/scripts/file_length
Krzysztof kuhy Rudnicki 10c33690b9 Add the 250-line file-length gate as a pre-commit hook
Vendors ~/utils/file_length into scripts/file_length so the gate is
reachable in CI: pre-commit's `entry:` is not shell-expanded and GitHub
runners have no ~/utils, so an external reference would pass locally and
silently skip on push. The existing pre-commit/action all-files job picks
the hook up with no workflow change.

The vendored copy is excluded from ruff/ruff-format/mypy/pylint and must
stay byte-identical to upstream -- ruff --unsafe-fixes otherwise rewrites
its print() calls to `pass` (T201/F841), which leaves the gate exiting 1
while reporting nothing.

Also:
- name-tests-test now exempts tests/_*.py, so the 35 test-file splits have
  a landing zone for shared helpers (it rejects any non-test_*.py module
  under tests/).
- pylint max-module-lines 1000 -> 250, so both limits agree.

Note: .git/hooks/pre-commit was never installed in this repo (only
pre-push), so no commit-stage hook had ever run. Installed via
`pre-commit install`.

55 files are currently over the cap; they are split in following commits.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PPpmMpTSkp8UziRc5u8B7P
2026-08-23 19:27:09 +02:00
..
__init__.py Add the 250-line file-length gate as a pre-commit hook 2026-08-23 19:27:09 +02:00
_tables.py Add the 250-line file-length gate as a pre-commit hook 2026-08-23 19:27:09 +02:00
check.py Add the 250-line file-length gate as a pre-commit hook 2026-08-23 19:27:09 +02:00
config.py Add the 250-line file-length gate as a pre-commit hook 2026-08-23 19:27:09 +02:00
exemptions.py Add the 250-line file-length gate as a pre-commit hook 2026-08-23 19:27:09 +02:00