Skip to content

Consume the dead-code gate from ops instead of vendoring it - #26

Merged
jonnyspicer merged 1 commit into
mainfrom
fix/dead-code-gate-via-ops-hook
Aug 12, 2026
Merged

Consume the dead-code gate from ops instead of vendoring it#26
jonnyspicer merged 1 commit into
mainfrom
fix/dead-code-gate-via-ops-hook

Conversation

@jonnyspicer

Copy link
Copy Markdown
Contributor

Part of 86cb4jfhz.

This repo was missed

86cb417ty fixed the fail-open dead-code gate and deleted the vendored copies — from six repos. There were nine. That ticket said the script was vendored "in at least six repos" and listed six; the list was verified exhaustively and the hedge was read past.

This repo still carried the pre-fix script at blob 117e0e5e, byte-identical to the buggy version:

findings="$(vulture . $WHITELIST ... 2>/dev/null | grep -vE '...' || true)"
if [ -z "$findings" ]; then echo "no dead code found"; exit 0; fi

With vulture absent from PATH, command-not-found goes to /dev/null, || true discards exit 127, and the gate reports a clean scan having checked nothing.

Not currently biting in CIlint.yml installs vulture==2.14 explicitly, so the gate does run. But the fail-open behaviour is live for any local invocation, and for a silently failed install step.

What changed

The vendored copy is deleted; the gate now comes from offworldlabs/ops pinned at hooks-v1.0, the same way the other six repos consume it. pre-commit==4.6.2 joins the existing pinned install line, and vulture==2.14 stays on it — the dead-code hook is language: script, so pre-commit builds no environment and vulture must be on PATH.

Deliberately not included

The ruff-config hook. This repo's shared ruff standard lives in ruff.toml, and check-ruff-config.py currently reads pyproject.toml only — it exits 2 here. The standard is present and matches canonical exactly, but it is unenforced. Tracked as 86cb4jfzk.

Verification

  • pre-commit run --all-filesdead code (vulture)....Passed
  • Fails closed now: run with vulture genuinely absent from PATH, the hook exits 127 with check-dead-code: vulture is not installed or not on PATH. Previously that same input printed no dead code found and exited 0.

🤖 Generated with Claude Code

https://claude.ai/code/session_013ZcazeseXVpu8XrYA2tE1V

…b4jfhz)

This repo was missed by 86cb417ty, which removed the vendored copy from six
repos. There were nine. This one still carried the pre-fix script at blob
117e0e5 — no `command -v vulture` guard, so with vulture absent it printed
"no dead code found" and exited 0 having checked nothing.

Not currently biting in CI, which installs vulture explicitly, but live for
any local run and for a silently failed install step.

ruff-config is deliberately not added: this repo's shared ruff standard lives
in ruff.toml and check-ruff-config.py reads pyproject.toml only. Tracked as
86cb4jfzk.
@jonnyspicer
jonnyspicer merged commit 5da33c0 into main Aug 12, 2026
1 check passed
@jonnyspicer
jonnyspicer deleted the fix/dead-code-gate-via-ops-hook branch August 12, 2026 18:22
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