-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
bugSomething isn't workingSomething isn't workingfixesRelated to suggested fixes for violationsRelated to suggested fixes for violations
Description
Thanks @InSyncWithFoo for adding an autofix in #14217 .
- A minimal code snippet that reproduces the bug.
I did notice an issue that I think should be possible to handle. This case:
class Container(tuple):
def __new__(cls: Type[Container], *args, **kwargs) -> Container: ...gets autofixed to
class Container(tuple):
def __new__(cls: Type[Container], *args, **kwargs) -> Self: ...Which causes type error:
error: "Self" cannot be used in a function with a `self` or `cls` parameter that has a type annotation other than "Self" (reportGeneralTypeIssues)
I think it should be:
class Container(tuple):
def __new__(cls, *args, **kwargs) -> Self: ...- The command you invoked (e.g.,
ruff /path/to/file.py --fix), ideally including the--isolatedflag.
ruff check --select=PYI034 --fix --preview --unsafe-fixes --isolated
- The current Ruff settings (any relevant sections from your
pyproject.toml).
None
- The current Ruff version (
ruff --version).
ruff 0.7.4
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingfixesRelated to suggested fixes for violationsRelated to suggested fixes for violations