Skip to content

ci: gate dead-code detection with vulture#921

Merged
tcoratger merged 1 commit into
leanEthereum:mainfrom
leolara:ci/vulture-dead-code
Jun 11, 2026
Merged

ci: gate dead-code detection with vulture#921
tcoratger merged 1 commit into
leanEthereum:mainfrom
leolara:ci/vulture-dead-code

Conversation

@leolara

@leolara leolara commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

What

Follow-up to #915 (which added vulture and a curated whitelist). This wires vulture into CI so a regression that introduces dead code fails the build.

  • Adds a dead-code job to .github/workflows/ci.yml that runs just deadcode.
    • Kept as a separate job rather than folded into just check, so local just check stays fast and a contributor working on an unrelated change is not surprise-failed mid-work; CI is where the gate is enforced.
    • Pins a single Python version: vulture's AST analysis is version-independent, so the lint job's 3-version matrix is unnecessary here.
    • Runs on ubuntu-latest (lightweight; the macOS runners are reserved for the SNARK-heavy filler).
  • Whitelists one fixture field, is_justifiable, that landed on main after chore: add vulture dead-code detection and remove findings #915 merged. It is a JustifiabilityOutput Pydantic field set through a constructor keyword and serialized to the fixture JSON, never read by attribute, so vulture cannot see the use. Adding it keeps the new gate green and demonstrates the intended maintenance flow for the tight whitelist.

Verification

  • just deadcode → clean (exit 0)
  • just check → passes (whitelist stays excluded from ruff and ty)

Add a dead-code job to CI that runs `just deadcode`, so a regression
that introduces unused code fails the build. The job pins a single
Python version because vulture's analysis is version-independent.

Also whitelist a justifiability fixture field that landed after the
initial vulture setup, so the new gate starts green. The field is set
through a constructor keyword and serialized to the fixture JSON, never
read by attribute, which vulture cannot see.

@tcoratger tcoratger left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@tcoratger tcoratger merged commit e751986 into leanEthereum:main Jun 11, 2026
14 checks passed
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.

2 participants