ruff
cd8e8d53 - [ty] Add `invalid-enum-member-annotation` lint rule (#23648)

Commit
63 days ago
[ty] Add `invalid-enum-member-annotation` lint rule (#23648) ## 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
Author
Parents
Loading