From 994eb85236311bd32851a3db7eeb3f6a950c0ace 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 | 2 ++ Gemfile | 2 ++ Guardfile | 2 ++ bin/rails | 2 ++ devise_token_auth.gemspec | 2 ++ gemfiles/rails_4_2.gemfile | 2 ++ gemfiles/rails_5_0.gemfile | 2 ++ gemfiles/rails_5_1.gemfile | 2 ++ test/dummy/bin/bundle | 2 ++ test/dummy/bin/rails | 2 ++ test/dummy/bin/rake | 2 ++ test/dummy/bin/spring | 1 + test/dummy/config.ru | 2 ++ test/dummy/db/schema.rb | 2 ++ 15 files changed, 27 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..2fde90088 100644 --- a/Appraisals +++ b/Appraisals @@ -1,3 +1,5 @@ +# frozen_string_literal: true + [ { name: '4-2', version: '4.2.10' } ].each do |rails| diff --git a/Gemfile b/Gemfile index b55a5d1d5..be8729b53 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,5 @@ +# 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..24f70edd5 100644 --- a/Guardfile +++ b/Guardfile @@ -1,3 +1,5 @@ +# 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..3ea4de6fc 100755 --- a/bin/rails +++ b/bin/rails @@ -1,4 +1,6 @@ #!/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..d87dc6714 100644 --- a/devise_token_auth.gemspec +++ b/devise_token_auth.gemspec @@ -1,3 +1,5 @@ +# 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..cd9d3ee90 100644 --- a/gemfiles/rails_4_2.gemfile +++ b/gemfiles/rails_4_2.gemfile @@ -1,3 +1,5 @@ +# 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..e80236012 100644 --- a/gemfiles/rails_5_0.gemfile +++ b/gemfiles/rails_5_0.gemfile @@ -1,3 +1,5 @@ +# 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..66af157ca 100644 --- a/gemfiles/rails_5_1.gemfile +++ b/gemfiles/rails_5_1.gemfile @@ -1,3 +1,5 @@ +# 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..2dbb71769 100755 --- a/test/dummy/bin/bundle +++ b/test/dummy/bin/bundle @@ -1,3 +1,5 @@ #!/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..666ce44df 100755 --- a/test/dummy/bin/rails +++ b/test/dummy/bin/rails @@ -1,4 +1,6 @@ #!/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..fbda80b1d 100755 --- a/test/dummy/bin/rake +++ b/test/dummy/bin/rake @@ -1,4 +1,6 @@ #!/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..6270bcdfd 100644 --- a/test/dummy/config.ru +++ b/test/dummy/config.ru @@ -1,3 +1,5 @@ +# 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..7cb4e1a81 100644 --- a/test/dummy/db/schema.rb +++ b/test/dummy/db/schema.rb @@ -1,3 +1,5 @@ +# 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.