Skip to content

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

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

jonnyspicer merged 1 commit into
mainfrom
fix/dead-code-gate-via-ops-hook

Conversation

@jonnyspicer

Copy link
Copy Markdown
Contributor

Part of 86cb417ty. Same change as the merged pilot, retina-analytics#13.

Why

tools/check-dead-code.sh reported success when vulture was not on PATH — the shell's command-not-found went to /dev/null and || true discarded exit 127, so the gate printed no dead code found and exited 0. It only ever produced false passes, so nothing surfaced it until CI disagreed with a local run.

The header also claimed a canonical copy lived in offworldlabs/ops. It never did: the file was vendored byte-identically in six repos with no upstream, so there was no single place to fix it.

What changed

ops is now a pre-commit hook repository, and this repo pins it:

repos:
  - repo: https://github.com/offworldlabs/ops
    rev: dead-code-v1.0
    hooks:
      - id: dead-code

The vendored copy is deleted. The rev: pin is the source of truth, so drift is impossible rather than merely detectable — the mechanism claude-shared's scaffold already uses for ruff. Future fixes reach every repo by bumping one line; pre-commit autoupdate does that for you.

The gate now fails closed: absent vulture exits 127 naming the tool.

Not in scope

ruff stays a separate CI step. Aligning these repos with claude-shared's ci-python.yml is worth doing but belongs in its own ticket, not a bug fix.

Verification

pre-commit run --all-filesdead code (vulture)....Passed, exit 0, no findings. Upstream ops CI runs the gate's 9-test suite plus pre-commit try-repo, with REQUIRE_VULTURE=1 so a broken vulture install fails the job instead of silently skipping.

🤖 Generated with Claude Code

https://claude.ai/code/session_013ZcazeseXVpu8XrYA2tE1V

…b417ty)

The vendored copy reported success when vulture was absent. It is now a
pinned pre-commit hook from offworldlabs/ops, so there is one copy and the
gate fails closed.
@jonnyspicer
jonnyspicer merged commit 8143fac into main Aug 11, 2026
2 checks passed
@jonnyspicer
jonnyspicer deleted the fix/dead-code-gate-via-ops-hook branch August 11, 2026 22:41
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