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 the frozen_string_literal header #90

Merged
merged 1 commit into from
Oct 29, 2024

Conversation

bquorning
Copy link
Contributor

@bquorning bquorning commented Oct 28, 2024

I think after Ruby 3.4 is released1, more people will start expecting libraries to be functional with e.g. the --enable-frozen-string-literal option enabled.

This PR adds the frozen_string_literal header to all files, fixes failing tests, and removes now unnecessary freezing of strings.

Footnotes

  1. https://github.com/ruby/ruby/commit/12be40ae6be78ac41e8e3f3c313cc6f63e7fa6c4

I think after Ruby 3.4 is released, more people will start expecting
libraries to be functional with eg the `--enable-frozen-string-literal`
option enabled.

This commit adds the frozen_string_literal header to all files, fixes
failing tests, and removes now unnecessary freezing of strings.
@bquorning bquorning force-pushed the test-with-frozen-strings-flag branch from 725f910 to 7e5e57e Compare October 28, 2024 14:56
@whitequark
Copy link
Owner

Doesn't this regress the functionality on pre-3.4 by removing the freezes?

@bquorning
Copy link
Contributor Author

With the added frozen_string_literal: true file headers, the strings are still frozen (in Ruby 2.3+).

@whitequark whitequark merged commit b069c9e into whitequark:main Oct 29, 2024
11 checks passed
@whitequark
Copy link
Owner

Thanks!

@bquorning bquorning deleted the test-with-frozen-strings-flag branch October 29, 2024 20:37
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