Files
astral-ruff/scripts
Alex Waygood cd8e8d535f [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
2026-03-02 17:31:36 +00:00
..
2026-02-26 14:46:41 -05:00
2026-02-08 19:58:37 +00:00
2025-10-30 17:06:29 -07:00