mirror of
https://github.com/astral-sh/ruff.git
synced 2026-05-06 08:56:57 -04:00
cd8e8d535f
## Summary This PR fixes the last remaining conformance failure on `enums_members.py` in the conformance suite. Implements a new lint rule `invalid-enum-member-annotation` that detects type annotations on enum members. According to the typing spec, enum members should not have explicit type annotations, as the actual runtime type is the enum class itself, not the annotated type. The rule: - Flags annotated enum members (e.g., `DOG: int = 2` in an `Enum` class) - Allows bare `Final` annotations (which don't specify a type) - Excludes dunder names, private names, and special sunder names like `_value_` and `_ignore_` - Excludes pure declarations without values (non-members) ## Test Plan mdtests