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

Add frozen_string_literal comments and enable RuboCop rule #66

Merged
merged 4 commits into from
May 24, 2024

Conversation

mattbrictson
Copy link
Owner

Apparently Ruby 4 will freeze string literals by default. In preparation for that breaking change, Ruby 3.4 will issue a warning when string literals are mutated.

To prepare nextgen and nextgen-generated apps for the Ruby 4 future, I've added the frozen_string_literal comment to all files to opt into this behavior. For apps that opt into RuboCop, I've enabled the Style/FrozenStringLiteralComment rule by default as well.

@mattbrictson mattbrictson added the ✨ Feature Adds a new feature label May 24, 2024
Comment on lines +25 to +26
Style/FrozenStringLiteralComment:
Enabled: false
Copy link
Owner Author

Choose a reason for hiding this comment

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

🗒️ Style/FrozenStringLiteralComment leads to undesirable results in ERB files, so I've disabled it in the context of erb_lint.

@mattbrictson mattbrictson merged commit 808364f into main May 24, 2024
7 checks passed
@mattbrictson mattbrictson deleted the frozen-literal branch May 24, 2024 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature Adds a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant