From d20cb342aeb9cc7b876ebbcefe17ffc67cb507fd Mon Sep 17 00:00:00 2001 From: Evan Marell Date: Mon, 30 Apr 2018 10:28:45 -0700 Subject: [PATCH] Fix Style/FrozenStringLiteralComment. #1157 added the frozen string literal comment to _most_ files; this cop fixes the remaining files and enforces the presence of the frozen string literal comment in future files. --- .rubocop.yml | 16 ---------------- Appraisals | 1 + Gemfile | 1 + Guardfile | 1 + bin/rails | 1 + devise_token_auth.gemspec | 1 + gemfiles/rails_4_2.gemfile | 1 + gemfiles/rails_5_0.gemfile | 1 + gemfiles/rails_5_1.gemfile | 1 + test/dummy/bin/bundle | 1 + test/dummy/bin/rails | 1 + test/dummy/bin/rake | 1 + test/dummy/bin/spring | 1 + test/dummy/config.ru | 1 + test/dummy/db/schema.rb | 1 + 15 files changed, 14 insertions(+), 16 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index aa0941b73..4b881bf27 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -36,22 +36,6 @@ Style/BlockDelimiters: - refute_silent - refute_throws -# Offense count: 130 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: when_needed, always, never -# -# Description from Rubocop Manual: -# This cop is designed to help upgrade to Ruby 3.0. It will add the comment -# `# frozen_string_literal: true` to the top of files to enable frozen string -# literals. Frozen string literals may be default in Ruby 3.0. The comment -# will be added below a shebang and encoding comment. The frozen string -# literal comment is only valid in Ruby 2.3+. -# -# https://rubocop.readthedocs.io/en/latest/cops_style/#stylefrozenstringliteralcomment -Style/FrozenStringLiteralComment: - Enabled: false - # Offense count: 34 # Cop supports --auto-correct. # Configuration parameters: AutoCorrect, EnforcedStyle. diff --git a/Appraisals b/Appraisals index c1fc4a8a2..02aac3d88 100644 --- a/Appraisals +++ b/Appraisals @@ -1,3 +1,4 @@ +# frozen_string_literal: true [ { name: '4-2', version: '4.2.10' } ].each do |rails| diff --git a/Gemfile b/Gemfile index b55a5d1d5..ee9566d68 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,4 @@ +# frozen_string_literal: true source 'https://rubygems.org' # Declare your gem's dependencies in devise_token_auth.gemspec. diff --git a/Guardfile b/Guardfile index 1c909c3aa..386789c90 100644 --- a/Guardfile +++ b/Guardfile @@ -1,3 +1,4 @@ +# frozen_string_literal: true # A sample Guardfile # More info at https://github.com/guard/guard#readme diff --git a/bin/rails b/bin/rails index de0283e9a..6156c8fc8 100755 --- a/bin/rails +++ b/bin/rails @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true # This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application. ENGINE_ROOT = File.expand_path('..', __dir__) diff --git a/devise_token_auth.gemspec b/devise_token_auth.gemspec index f81649951..4631dccce 100644 --- a/devise_token_auth.gemspec +++ b/devise_token_auth.gemspec @@ -1,3 +1,4 @@ +# frozen_string_literal: true $:.push File.expand_path('lib', __dir__) # Maintain your gem's version: diff --git a/gemfiles/rails_4_2.gemfile b/gemfiles/rails_4_2.gemfile index 3cfa680b5..30bd81a3b 100644 --- a/gemfiles/rails_4_2.gemfile +++ b/gemfiles/rails_4_2.gemfile @@ -1,3 +1,4 @@ +# frozen_string_literal: true # This file was generated by Appraisal source 'https://rubygems.org' diff --git a/gemfiles/rails_5_0.gemfile b/gemfiles/rails_5_0.gemfile index 0151565f7..52b388156 100644 --- a/gemfiles/rails_5_0.gemfile +++ b/gemfiles/rails_5_0.gemfile @@ -1,3 +1,4 @@ +# frozen_string_literal: true # This file was generated by Appraisal source 'https://rubygems.org' diff --git a/gemfiles/rails_5_1.gemfile b/gemfiles/rails_5_1.gemfile index 6cad02f05..f2faa890a 100644 --- a/gemfiles/rails_5_1.gemfile +++ b/gemfiles/rails_5_1.gemfile @@ -1,3 +1,4 @@ +# frozen_string_literal: true # This file was generated by Appraisal source 'https://rubygems.org' diff --git a/test/dummy/bin/bundle b/test/dummy/bin/bundle index f19acf5b5..74a18868b 100755 --- a/test/dummy/bin/bundle +++ b/test/dummy/bin/bundle @@ -1,3 +1,4 @@ #!/usr/bin/env ruby +# frozen_string_literal: true ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) load Gem.bin_path('bundler', 'bundle') diff --git a/test/dummy/bin/rails b/test/dummy/bin/rails index 1b99aac9c..633fe2915 100755 --- a/test/dummy/bin/rails +++ b/test/dummy/bin/rails @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true begin load File.expand_path('spring', __dir__) rescue LoadError diff --git a/test/dummy/bin/rake b/test/dummy/bin/rake index 5a81e454b..9e93bbb13 100755 --- a/test/dummy/bin/rake +++ b/test/dummy/bin/rake @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true begin load File.expand_path('spring', __dir__) rescue LoadError diff --git a/test/dummy/bin/spring b/test/dummy/bin/spring index ec62a6582..a019c01c0 100755 --- a/test/dummy/bin/spring +++ b/test/dummy/bin/spring @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true # This file loads spring without using Bundler, in order to be fast # It gets overwritten when you run the `spring binstub` command diff --git a/test/dummy/config.ru b/test/dummy/config.ru index 2c4f92632..86e82254f 100644 --- a/test/dummy/config.ru +++ b/test/dummy/config.ru @@ -1,3 +1,4 @@ +# frozen_string_literal: true # This file is used by Rack-based servers to start the application. require ::File.expand_path('../config/environment', __FILE__) diff --git a/test/dummy/db/schema.rb b/test/dummy/db/schema.rb index 6012fe79f..6b0f4b44c 100644 --- a/test/dummy/db/schema.rb +++ b/test/dummy/db/schema.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition.