ruff
d40597a2 - [`flake8-pyi`] Implement `custom_type_var_return_type` (`PYI019`) (#6204)

Commit
2 years ago
[`flake8-pyi`] Implement `custom_type_var_return_type` (`PYI019`) (#6204) ## Summary Implements `Y019` from [flake8-pyi](https://github.com/PyCQA/flake8-pyi). The rule checks if - instance methods that return `self` - class methods that return an instance of `cls` - `__new__` methods Return a custom `TypeVar` instead of `typing.Self` and raises a violation if this is the case. The rule also covers [PEP-695](https://peps.python.org/pep-0695/) syntax as introduced in upstream in https://github.com/PyCQA/flake8-pyi/pull/402 ## Test Plan Added fixtures with test cases from upstream implementation (plus additional one for an excluded edge case, mentioned in upstream implementation)
Author
Parents
Loading