You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to have a lint rule that checks for convoluted type annotations, similar to rules that check for complicated functions.
The recommendation would be to move the type information to a type alias or to create a new data type (such as a NamedTuple) to refactor type information.
I don't have a specific idea about how the rule should measure type complexity (it could involve measuring nesting, unions, or just the number of parameters); I am more interested in checking if there would be an appetite for any such rule in Ruff at the moment!
The text was updated successfully, but these errors were encountered:
tjkuson
changed the title
Rule idea: check for convoluted function type annotations
Rule idea: check for complex function type annotations
Oct 7, 2023
Thanks for the feature request! I'm going to close this in favour of #2323, as it seems like basically the same idea to me (happy to reopen if I'm mistaken!)
It would be nice to have a lint rule that checks for convoluted type annotations, similar to rules that check for complicated functions.
The recommendation would be to move the type information to a type alias or to create a new data type (such as a
NamedTuple
) to refactor type information.I don't have a specific idea about how the rule should measure type complexity (it could involve measuring nesting, unions, or just the number of parameters); I am more interested in checking if there would be an appetite for any such rule in Ruff at the moment!
The text was updated successfully, but these errors were encountered: