New check: consider using any/all #5008
Labels
Enhancement ✨
Improvement to a component
Good first issue
Friendly and approachable by new contributors
Hacktoberfest
Help wanted 🙏
Outside help would be appreciated, good for new contributors
Milestone
Current problem
Here is a function from Astroid:
What does it do? Evidently it loops over the node's ancestors and returns whether any of them are decorators. Well, why not just say that?
Desired solution
The
any
andall
functions are generally shorter and more declarative than explicit looping, so add a check to suggest using them when appropriate.Implmenting this check so as to avoid too many false positives might be an interesting challenge!
Additional context
No response
The text was updated successfully, but these errors were encountered: