Skip to content

Conversation

Sija
Copy link
Member

@Sija Sija commented Jul 10, 2023

This rule is used to identify usage of min/max/minmax calls that follow map.

For example, this is considered invalid:

%w[Alice Bob].map(&.size).min
%w[Alice Bob].map(&.size).max
%w[Alice Bob].map(&.size).minmax

And it should be written as this:

%w[Alice Bob].min_of(&.size)
%w[Alice Bob].max_of(&.size)
%w[Alice Bob].minmax_of(&.size)

@Sija Sija added the rule label Jul 10, 2023
@Sija Sija added this to the 1.5.0 milestone Jul 10, 2023
@Sija Sija requested a review from veelenga July 10, 2023 13:37
@Sija Sija self-assigned this Jul 10, 2023
@Sija Sija force-pushed the feature/minmax-after-map-rule branch from 7a7c055 to ddff8d2 Compare July 10, 2023 13:46
Co-authored-by: Vitalii Elenhaupt <3624712+veelenga@users.noreply.github.com>
@Sija Sija requested a review from veelenga July 10, 2023 14:09
Copy link
Member

@veelenga veelenga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@Sija Sija merged commit 33c8273 into master Jul 10, 2023
@Sija Sija deleted the feature/minmax-after-map-rule branch July 10, 2023 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants