-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
There are a number of cases where you have a choice between class based syntax and functional syntax. The specific case I'm considering is Enum - though I do vaguely recall that there are other cases.
For example, you defined an enum using either of these methods:
class Color(Enum):
RED = auto()
YELLOW = auto()
GREEN = auto()Color = Enum(
"Color",
[
"RED",
"YELLOW",
"GREEN",
],
)What you prefer is a matter of taste (though honestly, if you prefer functional style, you're a little crazy) - however, I'd like to make sure we prefer the former throughout our codebase at work. This lint could obviously warn in either direction.
I'm a little surprised this suggestion didn't exist before tbh, so feel free to point me to the old ticket if it exists. I did search for "enums" and "functional" to try to find this issue, but I couldn't find it (I also tried a few others queries, but you get the idea).