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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add frozen_string_literal Rubocop Rule #10342

Merged
merged 2 commits into from
Apr 2, 2024

Conversation

mitchellhenke
Copy link
Contributor

馃洜 Summary of changes

Spurred by conversation on #10340 here, this PR enables the frozen_string_literal rule with a few exceptions.

@mitchellhenke mitchellhenke requested a review from a team March 29, 2024 17:49
Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! It's a good thing we don't have a "last person to touch a file is its owner" rule! 馃槈

@matthinz
Copy link
Member

This is a big commit--can you point out where the rubocop rule is enabled? I'm not seeing any references to it

@matthinz
Copy link
Member

Ah NM I found it

@mitchellhenke mitchellhenke force-pushed the mitchellhenke/freeze-strings branch 3 times, most recently from 1cba376 to 3e4ebfe Compare March 29, 2024 18:35
changelog: Internal, Performance, Add frozen_string_literal Rubocop Rule
@mitchellhenke mitchellhenke marked this pull request as ready for review April 2, 2024 16:54
@mitchellhenke mitchellhenke merged commit 7ce91b5 into main Apr 2, 2024
2 checks passed
@mitchellhenke mitchellhenke deleted the mitchellhenke/freeze-strings branch April 2, 2024 17:05
@aduth aduth mentioned this pull request Apr 3, 2024
3 tasks
Style/FrozenStringLiteralComment:
Enabled: true
Exclude:
- 'spec/**/*.rb'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would there be any similar benefit to extending this to spec files?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@aduth aduth mentioned this pull request Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants