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 magic comment to use mutable strings #1105

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

brian-kephart
Copy link
Collaborator

Ruby 3.4 issues deprecation warnings when mutating strings in a file that does not have a frozen_string_literal: false comment. When testing my app locally with Ruby 3.4, there are deprecation warnings because plugin_routes.rb uses mutated strings.

This PR adds a magic comment to that file to silence the deprecation warnings and to ensure that the current behavior will continue even after a future version of Ruby freezes strings by default.

Copy link
Collaborator

@texpert texpert left a comment

Choose a reason for hiding this comment

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

LGTM, @brian-kephart!

One relevant note - we have the Style/FrozenStringLiteralComment completely disabled in the .rubocop.yml file. WDYT of removing this clause and fixing all the occurrences?! There could be dragons, though :)

@brian-kephart
Copy link
Collaborator Author

@texpert I would support that. It concerns me that I did not seen any deprecation warnings in the CI output for this repo, though. I caught the issue on another app that uses Camaleon.

@brian-kephart brian-kephart merged commit e8e0bf9 into owen2345:master Jan 6, 2025
23 checks passed
@brian-kephart brian-kephart deleted the frozen_strings branch January 6, 2025 19:46
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.

2 participants