Add frozen_string_literal Rubocop Rule#10342
Merged
mitchellhenke merged 2 commits intomainfrom Apr 2, 2024
Merged
Conversation
zachmargolis
approved these changes
Mar 29, 2024
Contributor
zachmargolis
left a comment
There was a problem hiding this comment.
LGTM! It's a good thing we don't have a "last person to touch a file is its owner" rule! 😉
Contributor
|
This is a big commit--can you point out where the rubocop rule is enabled? I'm not seeing any references to it |
b9f2269 to
2cd0652
Compare
Contributor
|
Ah NM I found it |
matthinz
approved these changes
Mar 29, 2024
1cba376 to
3e4ebfe
Compare
added 2 commits
April 2, 2024 11:29
changelog: Internal, Performance, Add frozen_string_literal Rubocop Rule
f8a7926 to
07d721c
Compare
aduth
reviewed
Apr 3, 2024
| Style/FrozenStringLiteralComment: | ||
| Enabled: true | ||
| Exclude: | ||
| - 'spec/**/*.rb' |
Contributor
There was a problem hiding this comment.
Would there be any similar benefit to extending this to spec files?
Contributor
Author
There was a problem hiding this comment.
I'm speculating, but I'd guess no. It can be helpful to freeze strings for performance purposes, but the impact is usually smaller, so I'm not sure how big of an impact it would have on tests.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
🛠 Summary of changes
Spurred by conversation on #10340 here, this PR enables the frozen_string_literal rule with a few exceptions.