Should Ruff check for use of incomaptible async APIs #13159
rafalkrupinski
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
I guess that depends. Ruff focuses on linting your project files but I suspect you want to check that no method (including third-party code) mixes Either way. Ruff isn't powerful enough today to do this kind of analysis because the analysis is limited to a single file. We're working on the red knot to support multi-file analysis that would also allow us to follow call expressions to functions defined in other files (at least for as long as the callee isn't dynamic). |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The use case is:
This will cause an exception since running any of those two
sleep
function requires the code to run in appropriate event loop, and it can't run in two event loops at the same time.Would Ruff be the right project to check whether a function or any of its known callees makes call to competing async APIs?
Related discussion in anyio.
Beta Was this translation helpful? Give feedback.
All reactions