Skip to content

Commit 94e599b

Browse files
authored
Enable frozen string literals across the project (#3483)
https://docs.rubocop.org/rubocop/cops_style.html#stylefrozenstringliteralcomment This feature is designed to help transition from mutable string literals to frozen string literals. The "frozen_string_literal: true" magic comment was added to the top of all files to enable frozen string literals. Frozen string literals may be default in future Ruby. Using frozen string literals is good practice and easier to reason about.
1 parent a95b177 commit 94e599b

423 files changed

Lines changed: 828 additions & 6 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.rubocop.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,6 @@ Style/Encoding:
168168
Style/EndlessMethod:
169169
Enabled: true
170170

171-
Style/FrozenStringLiteralComment:
172-
Enabled: false
173-
174171
Style/HashConversion:
175172
Enabled: true
176173

Appraisals

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
appraise 'rails-6.0' do
24
gem 'rails', '~> 6.0.0'
35
gem 'sassc-rails', '~> 2.1'

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
source 'https://rubygems.org'
24

35
gem 'appraisal', '>= 2.0'

Rakefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# Add your own tasks in files placed in lib/tasks ending in .rake,
24
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
35

app/controllers/rails_admin/application_controller.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'rails_admin/abstract_model'
24

35
module RailsAdmin

app/controllers/rails_admin/main_controller.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module RailsAdmin
24
class MainController < RailsAdmin::ApplicationController
35
include ActionView::Helpers::TextHelper

app/helpers/rails_admin/application_helper.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module RailsAdmin
24
module ApplicationHelper
35
def authorized?(action_name, abstract_model = nil, object = nil)

app/helpers/rails_admin/form_builder.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'nested_form/builder_mixin'
24

35
module RailsAdmin

app/helpers/rails_admin/main_helper.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module RailsAdmin
24
module MainHelper
35
def rails_admin_form_for(*args, &block)

config/initializers/active_record_extensions.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
ActiveSupport.on_load(:active_record) do
24
module ActiveRecord
35
class Base

0 commit comments

Comments
 (0)