-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
bugSomething isn't workingSomething isn't workingtype-inferenceRequires more advanced type inference.Requires more advanced type inference.
Description
Hello 👋 , I think I found a false positive on RUF009 rule.
test_ruff.py:
from dataclasses import dataclass
from typing import Final, NewType
State = NewType("State", str)
@dataclass
class System:
state: Final[State] = State("Enabled")
@dataclass
class System2:
state: Final[str] = "Enabled"version:
❯ ruff --version
ruff 0.0.283bug.toml:
select = ["RUF"]output:
❯ ruff check --config=bug.toml test_ruff.py
test_ruff.py:9:27: RUF009 Do not perform function call `State` in dataclass defaults
Found 1 error.Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingtype-inferenceRequires more advanced type inference.Requires more advanced type inference.