-
Notifications
You must be signed in to change notification settings - Fork 171
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
Tadpole operator to String#match?
#802
Conversation
Codecov Report
@@ Coverage Diff @@
## master #802 +/- ##
==========================================
+ Coverage 80.26% 80.91% +0.65%
==========================================
Files 54 54
Lines 7397 7419 +22
==========================================
+ Hits 5937 6003 +66
+ Misses 1235 1191 -44
Partials 225 225
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hachi8833 this looks great! thanks for the work! But I will hold the merge a little longer because it's a breaking change.
No problem! I leave this to you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rubocop style guides also suggests that
=~
is not (partially) recommended: https://github.com/rubocop-hq/ruby-style-guide#no-perl-regexp-last-matchers
My understanding of that guide section is that it suggests not to use numbered captures - the expression with the tadpole (/(regexp)/ =~ string
) is just something they use as example.
Regardless of this, I'm very used to the operator, but I also use Perl a lot 😂, so 👍 for the change.
@hachi8833 I think this can go out in version |
Thank you! |
This is just my idea that the tadpole operator
=~
looks cryptic and is a legacy from Perl, so changing this tomatch?
is better for clarification.Rubocop style guides also suggests that
=~
is not (partially) recommended: https://github.com/rubocop-hq/ruby-style-guide#no-perl-regexp-last-matchersIf unnecessary, just discard the PR.
Thank you,