ruff/crates/ruff_linter
Brent Westbrook 1c7ea690a8
[`flake8-type-checking`] Fix `TC003` false positive with `future-annotations` (#21125)
Summary
--

Fixes #21121 by upgrading `RuntimeEvaluated` annotations like
`dataclasses.KW_ONLY` to `RuntimeRequired`. We already had special
handling for
`TypingOnly` annotations in this context but not `RuntimeEvaluated`.
Combining
that with the `future-annotations` setting, which allowed ignoring the
`RuntimeEvaluated` flag, led to the reported bug where we would try to
move
`KW_ONLY` into a `TYPE_CHECKING` block.

Test Plan
--

A new test based on the issue
2025-10-30 14:14:29 -04:00
..
resources [`flake8-type-checking`] Fix `TC003` false positive with `future-annotations` (#21125) 2025-10-30 14:14:29 -04:00
src [`flake8-type-checking`] Fix `TC003` false positive with `future-annotations` (#21125) 2025-10-30 14:14:29 -04:00
Cargo.toml Bump 0.14.2 (#21051) 2025-10-23 15:17:22 -04:00