Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix false positive when iterating over Enum #312

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

anudaweerasinghe
Copy link

@anudaweerasinghe anudaweerasinghe commented May 6, 2023

Description

  • Creates dictionary enum_class_vars that maps subclasses of Enum to variables defined within them
  • Updates visit_Call to add values in enum_class_vars to used_names if the function is list, tuple, or set and the argument is a subclass of Enum
  • Implements visit_For to handle the case where we iterate over an Enum, i.e. for e in E

Related Issue

Resolves #304

Checklist:

  • I have updated the documentation in the README.md file or my changes don't require an update.
  • I have added an entry in CHANGELOG.md.
  • I have added or adapted tests to cover my changes.
  • I have run tox -e fix-style to format my code and checked the result with tox -e style.

@codecov-commenter
Copy link

codecov-commenter commented May 6, 2023

Codecov Report

Merging #312 (8743ead) into main (e2e84d0) will increase coverage by 0.03%.
The diff coverage is 100.00%.

📣 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%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

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.

False positive when enum is used in iteration
4 participants