Skip to content
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

Use RESTRICT_ON_SEND for the rest of cops #8644

Merged
merged 1 commit into from Sep 3, 2020

Conversation

fatkodima
Copy link
Contributor

Closes #8606

/cc @marcandre

Copy link
Contributor

@marcandre marcandre left a comment

Choose a reason for hiding this comment

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

Good job!


def_node_matcher :multiple_compare?, <<~PATTERN
(send (send _ {:< :> :<= :>=} $_) {:< :> :<= :>=} _)
(send (send _ {:< :> :<= :>=} $_) {:#{COMPARISON_METHODS.join(' :')}} _)
Copy link
Contributor

Choose a reason for hiding this comment

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

FYI, if COMPARISON_METHODS was a set, you could use %COMPARISON_METHODS here... but I'm also working on optimizing {:list :of :literals} into a set, so no need to change this. For the future though, might be more readable :-)

@mergify mergify bot merged commit df5a45a into rubocop:master Sep 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cops using on_send can be optimized
2 participants