Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unused-async (RUF029) - false positive in .pyi files #11018

Closed
DetachHead opened this issue Apr 19, 2024 · 1 comment · Fixed by #11026
Closed

unused-async (RUF029) - false positive in .pyi files #11018

DetachHead opened this issue Apr 19, 2024 · 1 comment · Fixed by #11026
Assignees
Labels
bug Something isn't working

Comments

@DetachHead
Copy link

async def foo() -> int: ... # error: Function `foo` is declared `async`, but doesn't `await` or use `async` features.

this is a stub for a function that returns Coroutine[Any, Any, int]. removing the async will result in an incorrect return type

@charliermarsh charliermarsh added the bug Something isn't working label Apr 19, 2024
@charliermarsh
Copy link
Member

I think we should omit stubs entirely.

@charliermarsh charliermarsh self-assigned this Apr 19, 2024
charliermarsh added a commit that referenced this issue Apr 19, 2024
## Summary

We should ignore methods that appear to be stubs, e.g.:

```python
async def foo() -> int: ...
```

Closes #11018.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants