ruff
15813a65 - Update return type for `PT022` autofix (#7613)

Commit
2 years ago
Update return type for `PT022` autofix (#7613) ## Summary This PR fixes the autofix behavior for `PT022` to create an additional edit for the return type if it's present. The edit will update the return type from `Generator[T, ...]` to `T`. As per the [official documentation](https://docs.python.org/3/library/typing.html?highlight=typing%20generator#typing.Generator), the first position is the yield type, so we can ignore other positions. ```python typing.Generator[YieldType, SendType, ReturnType] ``` ## Test Plan Add new test cases, `cargo test` and review the snapshots. fixes: #7610
Author
Parents
Loading