-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Closed
Copy link
Labels
bugSomething isn't workingSomething isn't working
Description
Summary
playground: https://play.ruff.rs/10ce19b3-ce84-44e2-be98-19ece9acdf9d
pyproject.toml
[project]
name = "TC-TEST"
version = "0.1.0"
description = "TC-TEST"
readme = "README.md"
requires-python = ">=3.13"
dependencies = ["ruff>=0.14.2"]
[tool.ruff.lint]
select = ["TC"]
extend-safe-fixes = ["TC"]
future-annotations = truefrom dataclasses import KW_ONLY, dataclass
@dataclass
class DataClass:
a: int
_: KW_ONLY
b: intruff (v0.14.2) check TC003 for importing KW_ONLY in python 3.13.
Auto (unsafe) fix result:
from __future__ import annotations
from dataclasses import dataclass
from typing import TYPE_CHECKING
from dataclasses import KW_ONLYKW_ONLY import in TYPE_CHECKING block cause TC004.
from __future__ import annotations
from dataclasses import dataclass
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from dataclasses import KW_ONLY
@dataclass
class DataClass:
a: int
_: KW_ONLY
b: intRelative to #12859
Version
ruff 0.14.2 (83a3bc4 2025-10-23)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working