Skip to content

Commit

Permalink
Add special enum attributes to whitelist. (#306)
Browse files Browse the repository at this point in the history
Closes #305
  • Loading branch information
eltoder committed Feb 27, 2023
1 parent 392a742 commit e2e84d0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
* Add `UnicodeEncodeError` exception handling to `core.py` (milanbalazs, #299).
* Add whitelist for `Enum` attributes `_name_` and `_value_` (Eugene Toder, #305).

# 2.7 (2023-01-08)

Expand Down
10 changes: 10 additions & 0 deletions vulture/whitelists/enum_whitelist.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import enum


class EnumWhitelist(enum.Enum):
EnumWhitelist = 1


# Special attributes used by enum classes.
EnumWhitelist.EnumWhitelist._name_
EnumWhitelist.EnumWhitelist._value_

0 comments on commit e2e84d0

Please sign in to comment.