-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
previewRelated to preview mode featuresRelated to preview mode featuresruleImplementing or modifying a lint ruleImplementing or modifying a lint rule
Description
I would like to suggest that RUF029 will skip functions that are FastApi routes. In their docs, it is explicitly mentioned that sometimes routes should be declared as async function, even when not doing any asynchronous operation.
As a first step we can introduce a new rule setting that will allow opting into this new behavior.
One caveat is with FastApi dependencies that we should handle the same way but we can't since dependencies are just native functions and can't be detected in their deceleration (only in usage), but I believe that ignoring routes and keeping the current behavior for dependencies is a good step.
If you find this reasonable, I would like to implement it 😊
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
previewRelated to preview mode featuresRelated to preview mode featuresruleImplementing or modifying a lint ruleImplementing or modifying a lint rule