vulture
vulture copied to clipboard
Fix false positive when iterating over `Enum`
Description
- Creates dictionary
enum_class_vars
that maps subclasses ofEnum
to variables defined within them - Updates
visit_Call
to add values inenum_class_vars
toused_names
if the function islist
,tuple
, orset
and the argument is a subclass ofEnum
- Implements
visit_For
to handle the case where we iterate over anEnum
, i.e.for e in E
Related Issue
Resolves #304
Checklist:
- [x] I have updated the documentation in the README.md file or my changes don't require an update.
- [X] I have added an entry in CHANGELOG.md.
- [X] I have added or adapted tests to cover my changes.
- [X] I have run
tox -e fix-style
to format my code and checked the result withtox -e style
.
Codecov Report
Merging #312 (8743ead) into main (e2e84d0) will increase coverage by
0.03%
. The diff coverage is100.00%
.
:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more
@@ Coverage Diff @@
## main #312 +/- ##
==========================================
+ Coverage 98.94% 98.98% +0.03%
==========================================
Files 21 21
Lines 665 689 +24
==========================================
+ Hits 658 682 +24
Misses 7 7
Impacted Files | Coverage Δ | |
---|---|---|
vulture/core.py | 98.63% <100.00%> (+0.09%) |
:arrow_up: |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more