-
-
Notifications
You must be signed in to change notification settings - Fork 81
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
Performance/DeleteSuffix is not safe #245
Comments
koic
added a commit
to koic/rubocop-performance
that referenced
this issue
May 9, 2021
…leteSuffix` as unsafe Fixes rubocop#245. This PR marks `Performance/DeletePrefix` and `Performance/DeleteSuffix` as unsafe.
8 tasks
@jmkoni Thank you for your feedback! JFYI, |
koic
added a commit
to koic/rubocop-performance
that referenced
this issue
May 9, 2021
…leteSuffix` as unsafe Fixes rubocop#245. This PR marks `Performance/DeletePrefix` and `Performance/DeleteSuffix` as unsafe.
koic
added a commit
to koic/rubocop-performance
that referenced
this issue
May 9, 2021
…leteSuffix` as unsafe Fixes rubocop#245. This PR marks `Performance/DeletePrefix` and `Performance/DeleteSuffix` as unsafe.
koic
added a commit
that referenced
this issue
May 16, 2021
…x_as_unsafe [Fix #245] Mark `Performance/DeletePrefix` and `Performance/DeleteSuffix` as unsafe
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We had a user of StandardRB open up standardrb/standard#292.
Expected behavior
Currently, if you are using
sub
to remove a suffix on aPathname
object, it replaces it withdelete_suffix
, which is not a valid method on aPathname
object. I would expect the following not to change:This should either not change or the cop should be marked as not safe.
Actual behavior
It changes the above code to:
which results in the following error:
Steps to reproduce the problem
Put the above code in a ruby file, fix the file with
Performance/DeleteSuffix
enabled. Then try to run the file.RuboCop version
The text was updated successfully, but these errors were encountered: