feat(ci,tooling): add vulture dead code detection to just & ci#2621
Conversation
The `is_create` field on `Message` was added in c40db83 ("refactor(spec-specs): Refactor state changes and frame hierarchy (ethereum#1841)") but was never read anywhere. It is assigned in four locations (`message.py`, `fork.py`, `system.py` x2) yet no logic branches on its value. Vulture correctly flagged it as unused. Remove the field from the dataclass and all assignment sites rather than whitelisting it.
`ForkLoad._forks` was assigned in `__init__` but never read. It became dead code in 0d2c52c ("feat(spec-tools): teach `Hardfork` to clone forks") which refactored `ForkLoad` to store a `hardfork: Final[Hardfork]` and rewrote `proof_of_stake` and `is_after_fork()` to use it directly, but did not remove the orphaned `_forks` attribute or its `Hardfork.discover()` call. Remove the annotation and the assignment rather than whitelisting it.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## forks/amsterdam #2621 +/- ##
================================================
Coverage 86.24% 86.24%
================================================
Files 599 599
Lines 36984 36984
Branches 3795 3795
================================================
Hits 31895 31895
Misses 4525 4525
Partials 564 564
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
danceratopz
left a comment
There was a problem hiding this comment.
This looks good to me! I removed two instances of dead code, @SamWilsn are you happy with those removals? Please see the commit messages for more details.
|
@fselmo added |
Yeah |
Summary
just staticpipeline so it runs automatically in CI alongside other lint checksWhat changed
Justfile: addeddeadcoderecipe, included it instatictargetvulture_whitelist.py: added entries for 7 groups of false positives with comments explaining eachTest plan
uv run vulture src/ vulture_whitelist.pyexits cleanly with 0 findingsjust deadcoderuns successfullyfixes #2531