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

Address frozen_string_literal no longer applying to interpolated strings in Ruby 3.0 or higher #10006

Merged
merged 3 commits into from Aug 23, 2021

Commits on Aug 23, 2021

  1. Extract frozen string literal logic into a helper

    Use this helper method instead repeating the logic everywhere
    to ease future changes.
    splattael committed Aug 23, 2021
    Copy the full SHA
    5a12fad View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    d8cae21 View commit details
    Browse the repository at this point in the history
  3. Interpolated string literals are no longer frozen

    Since Ruby 3.0 or higher interpolated strings are not frozen
    automatically anymore.
    
    Therefore, two changes must happen to how we treat interpolated literals
    
    * Style/MutableConstant should enforce freezing them
    * Style/RedundantFreeze should not consider it redundant to freeze them
    
    Strongly inspired by rubocop#8743
    splattael committed Aug 23, 2021
    Copy the full SHA
    c537fc2 View commit details
    Browse the repository at this point in the history