Skip to content

CI: file length caps and listed lint suppressions (sc-9611) - #264

Open
ndbroadbent wants to merge 2 commits into
ci-migrationsfrom
ci-limits
Open

ndbroadbent wants to merge 2 commits into
ci-migrationsfrom
ci-limits

Conversation

@ndbroadbent

@ndbroadbent ndbroadbent commented Dec 5, 2026 •

Copy link
Copy Markdown
Member

Eighth PR for sc-9611: file length and lint suppressions. It's stacked on #262 and retargets as the stack merges. Both checks run in CI's security job and in the pre-commit hook, in Python with no dependencies.

File length (scripts/ci/check_file_length.py): source files stay at 500 lines or fewer, and tests and migrations at 1,000 or fewer.

  • 42 files are already longer: app/src/mcp/mod.rs has 2,458 lines and frontend/src/styles.css 5,708. Splitting them now would collide with every open branch.
  • Instead, each gets its own cap in scripts/ci/file_lengths.txt: its length today, rounded up to the next hundred, so branches already open still fit. A file can't grow past its cap, so it gets split instead.
  • Once a file is split below the limit, its line has to go, and a line for a file that no longer needs it fails the check. That makes it a ratchet.
  • The hook checks only the staged files.

Lint suppressions (scripts/ci/check_suppressions.py): every #[allow(...)], @ts-expect-error, # noqa, rubocop:disable, shellcheck disable=, zizmor or hadolint ignore (and the rest) is listed in scripts/ci/suppressions.txt with its reason.

  • A new suppression fails until it's listed, so the reason shows in the diff the reviewer reads. A listed one that's gone fails too, so a stale line never covers a later one.
  • The check matches on path and suppression text, not line numbers, so moving code around doesn't trip it.
  • Why a list and not clippy's allow_attributes_without_reason: adding reason = "…" in place would edit crates/visualci-cli (that forces a CLI release) and touch crates in the renderer's inputs hash (that rebuilds the renderer). The list also covers every language in one place.

It starts green. There are 23 suppressions today, each listed with a reason I checked against the code, and the caps hold every long file. Both scripts take about 0.2 s over the whole tree.

Checked locally: a planted # noqa, a deleted list line, and a file over its cap each fail with a message saying what to do. actionlint and typos are clean.


Run Proof
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…apped), and every lint suppression listed with its reason (sc-9611)
… --ignore, eslint with a reason), test_*.py get 1,000 lines, rename hint, no __pycache__ in git (review)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant