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

DeletePrefix and DeleteSuffix should detect sub/sub! String methods #115

Closed
fatkodima opened this issue May 24, 2020 · 0 comments · Fixed by #116
Closed

DeletePrefix and DeleteSuffix should detect sub/sub! String methods #115

fatkodima opened this issue May 24, 2020 · 0 comments · Fixed by #116

Comments

@fatkodima
Copy link
Contributor

DeletePrefix and DeleteSuffix cops currently only detect gsub/gsub! String methods.
Should also detect and correct sub/sub! methods (https://ruby-doc.org/core-2.5.0/String.html#method-i-sub).

Like:

"FooController".sub(/Controller$/) => "FooController".delete_suffix("Controller")
fatkodima added a commit to fatkodima/rubocop-performance that referenced this issue May 24, 2020
fatkodima added a commit to fatkodima/rubocop-performance that referenced this issue May 24, 2020
@koic koic closed this as completed in #116 May 26, 2020
koic added a commit that referenced this issue May 26, 2020
[Fix #115] DeletePrefix and DeleteSuffix cops detects sub/sub! String methods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants