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

Enhance Rails/RedundantEqualityComparisonBlock to support regular expressions #339

Closed
vlad-pisanov opened this issue Feb 9, 2023 · 0 comments · Fixed by #340
Closed

Comments

@vlad-pisanov
Copy link
Contributor

Rails/RedundantEqualityComparisonBlock could be enhanced to recognize blocks that perform regex matching:

# bad
list.all? { |item| item =~ /pattern/ }
list.all? { |item| /pattern/.match? item }

# good
list.all?(/pattern/)
@koic koic closed this as completed in #340 Feb 11, 2023
koic added a commit that referenced this issue Apr 9, 2023
#339 has been feature changed to #347.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant