#19359·ruff

Add `from __future__ import annotations` in more rules

Author: ntBreCreated Jul 15, 2025Updated Sep 16, 2026
Labelsruletracking

https://github.com/astral-sh/ruff/pull/19100 added support for importing future annotations for TC001, TC002, TC003, UP037, and RUF013 as a proof of concept, but other rules could also be affected. In particular,

all currently rely on future-rewritable-type-annotation (FA100) for similar behavior, but they could just add the import themselves. This would likely mean deprecating FA100 eventually.

Similarly, runtime-import-in-type-checking-block (TC004) uses much of the same infrastructure as TC001-003. Adding a future import could be another option instead of Action::Quote in its implementation (the whole Action enum can likely be replaced by the new TypingReference enum).

runtime-string-union (TC010) could also offer a fix by unquoting the flagged annotation and adding the future import.

Status