Remove Performance/UnfreezeString
cop
#22
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR removes
Performance/UnfreezeString
cop.Starting with Ruby 3.3, the aim of this cop to improve performance by replacing
String#dup
withString#+@
no longer holds meaning.Performance/UnfreezeString
should be disabled or heavilly changed in Ruby 3.3+ rubocop/rubocop-performance#384String#dup
forPerformance/UnfreezeString
rubocop/rubocop-performance#418Currently, Rails 8.0 (rc2) supports Ruby 3.2 and above, but support for Ruby 3.2 will likely be dropped in a future version of Rails. When that time comes, any use of
String#+@
instead ofString#dup
at the application layer will be unnecessary.Since this is enforced for performance rather than style, I think it makes sense to disable this cop.
This is a suggestion to disable a cop that will eventually become irrelevant, from the perspective of maintaining RuboCop Performance. I understand that rubocop-rails-omakase does not expect configuration changes, so please feel free to close this if it doesn’t fit.