mirror of
https://github.com/astral-sh/ruff.git
synced 2025-11-03 21:24:29 +00:00
## Summary Part of #18972 This PR makes [typing-only-first-party-import (TC001)](https://docs.astral.sh/ruff/rules/typing-only-first-party-import/#typing-only-first-party-import-tc001)'s example error out-of-the-box. The old example raised `TC002` instead of `TC001`, so this makes it a `from .` import to fix that. [Old example](https://play.ruff.rs/1fdbb293-86fc-4ed2-b2ff-b4836cea0c59) ```py from __future__ import annotations import local_module def func(sized: local_module.Container) -> int: return len(sized) ``` [New example](https://play.ruff.rs/b886535c-9203-48bb-812b-1aa306f2c287) ```py from __future__ import annotations from . import local_module def func(sized: local_module.Container) -> int: return len(sized) ``` The "Use instead" section was also modified similarly. ## Test Plan <!-- How was it tested? --> N/A, no functionality/tests affected |
||
|---|---|---|
| .. | ||
| resources | ||
| src | ||
| Cargo.toml | ||