-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
New lint: Use Reverse with sort_by_key #5578
Comments
I can implement this. |
I'm curious if this will work with a lambda that does any transformation to Another (contrived) example: |
I think it should be possible to lint anything where |
New lint: Use Reverse with sort_by_key Implements #5578
New lint: Use Reverse with sort_by_key Implements #5578 changelog: New lint: [`unnecessary_sort_by`]
Closed with #5623 |
Suggesting a new lint to prefer using
Reverse
andsort_by_key
.Bad:
Good:
It should work the same for
sort_unstable_by
/sort_unstable_by_key
.Lint name idea: sort_by_key_reverse
Maybe there are other cases where
Reverse
can simplify a sort?The text was updated successfully, but these errors were encountered: