Skip to content

Commit

Permalink
Fix Style/FrozenStringLiteralComment.
Browse files Browse the repository at this point in the history
#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.
  • Loading branch information
Evan-M committed Apr 30, 2018
1 parent 29ae803 commit 994eb85
Show file tree
Hide file tree
Showing 15 changed files with 27 additions and 16 deletions.
16 changes: 0 additions & 16 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

[
{ name: '4-2', version: '4.2.10' }
].each do |rails|
Expand Down
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

source 'https://rubygems.org'

# Declare your gem's dependencies in devise_token_auth.gemspec.
Expand Down
2 changes: 2 additions & 0 deletions Guardfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# A sample Guardfile
# More info at https://github.com/guard/guard#readme

Expand Down
2 changes: 2 additions & 0 deletions bin/rails
Original file line number Diff line number Diff line change
@@ -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__)
Expand Down
2 changes: 2 additions & 0 deletions devise_token_auth.gemspec
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

$:.push File.expand_path('lib', __dir__)

# Maintain your gem's version:
Expand Down
2 changes: 2 additions & 0 deletions gemfiles/rails_4_2.gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# This file was generated by Appraisal

source 'https://rubygems.org'
Expand Down
2 changes: 2 additions & 0 deletions gemfiles/rails_5_0.gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# This file was generated by Appraisal

source 'https://rubygems.org'
Expand Down
2 changes: 2 additions & 0 deletions gemfiles/rails_5_1.gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# This file was generated by Appraisal

source 'https://rubygems.org'
Expand Down
2 changes: 2 additions & 0 deletions test/dummy/bin/bundle
Original file line number Diff line number Diff line change
@@ -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')
2 changes: 2 additions & 0 deletions test/dummy/bin/rails
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

begin
load File.expand_path('spring', __dir__)
rescue LoadError
Expand Down
2 changes: 2 additions & 0 deletions test/dummy/bin/rake
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

begin
load File.expand_path('spring', __dir__)
rescue LoadError
Expand Down
1 change: 1 addition & 0 deletions test/dummy/bin/spring
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 2 additions & 0 deletions test/dummy/config.ru
Original file line number Diff line number Diff line change
@@ -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__)
Expand Down
2 changes: 2 additions & 0 deletions test/dummy/db/schema.rb
Original file line number Diff line number Diff line change
@@ -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.
Expand Down

0 comments on commit 994eb85

Please sign in to comment.