From 6859d739cfd0684622819a703fe2856443759d8d Mon Sep 17 00:00:00 2001 From: Kirk Wang Date: Wed, 13 Dec 2023 15:23:35 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20Autocorrect=20frozen=20string=20?= =?UTF-8?q?literals?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ```sh rubocop --only Style/FrozenStringLiteralComment -A ``` --- Rakefile | 2 ++ app/controllers/hyrax/dashboard/collections_controller.rb | 2 ++ bin/bundle | 2 ++ bin/extract_mods_to_spreadsheet | 2 ++ bin/git-cleanup | 1 + bin/graph | 1 + bin/import_from_csv | 1 + bin/import_from_purl | 1 + bin/import_mods_files | 1 + bin/rails | 1 + bin/rake | 1 + bin/setup | 1 + bin/spring | 1 + bin/update | 1 + bin/web | 1 + bin/worker | 1 + config/application.rb | 1 + config/boot.rb | 1 + config/environment.rb | 1 + config/environments/development.rb | 1 + config/environments/production.rb | 1 + config/environments/test.rb | 1 + config/initializers/0db_created.rb | 1 + config/initializers/active_fedora_override.rb | 1 + config/initializers/apartment.rb | 1 + config/initializers/apartment_activejob.rb | 1 + config/initializers/application_controller_renderer.rb | 1 + config/initializers/assets.rb | 1 + config/initializers/backtrace_silencers.rb | 1 + config/initializers/clamav.rb | 1 + config/initializers/cookies_serializer.rb | 1 + config/initializers/devise.rb | 1 + config/initializers/file_set_derivatives_overrides.rb | 1 + config/initializers/filter_parameter_logging.rb | 1 + config/initializers/hydra_config.rb | 1 + config/initializers/hyrax.rb | 1 + config/initializers/iiif_print.rb | 1 + config/initializers/inflections.rb | 1 + config/initializers/mailboxer.rb | 1 + config/initializers/mime_types.rb | 1 + config/initializers/mini_magick.rb | 1 + config/initializers/new_framework_defaults.rb | 1 + config/initializers/redis_config.rb | 1 + config/initializers/riiif.rb | 1 + config/initializers/rolify.rb | 1 + config/initializers/secure_headers.rb | 1 + config/initializers/session_store.rb | 1 + config/initializers/sidekiq.rb | 1 + config/initializers/simple_form.rb | 1 + config/initializers/simple_form_bootstrap.rb | 2 ++ config/initializers/stats_admin.rb | 2 ++ config/initializers/version.rb | 4 +++- config/initializers/wrap_parameters.rb | 2 ++ config/puma.rb | 1 + config/spring.rb | 1 + lib/tasks/rubocop.rake | 1 + 56 files changed, 65 insertions(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index f55260d5d..8f8cb932c 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Add your own tasks in files placed in lib/tasks ending in .rake, # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. diff --git a/app/controllers/hyrax/dashboard/collections_controller.rb b/app/controllers/hyrax/dashboard/collections_controller.rb index 67e9de1ec..613a34a8a 100644 --- a/app/controllers/hyrax/dashboard/collections_controller.rb +++ b/app/controllers/hyrax/dashboard/collections_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # OVERRIDE Hyrax v3.4.2 # - Fix file upload in logo and banner # - Use work titles for collection thumbnail select & to add an option to reset to the default thumbnail diff --git a/bin/bundle b/bin/bundle index 66e9889e8..282e7d515 100755 --- a/bin/bundle +++ b/bin/bundle @@ -1,3 +1,5 @@ +# frozen_string_literal: true + #!/usr/bin/env ruby ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) load Gem.bin_path('bundler', 'bundle') diff --git a/bin/extract_mods_to_spreadsheet b/bin/extract_mods_to_spreadsheet index 822c783b6..7998f57e8 100755 --- a/bin/extract_mods_to_spreadsheet +++ b/bin/extract_mods_to_spreadsheet @@ -1,3 +1,5 @@ +# frozen_string_literal: true + #!/usr/bin/env ruby # this script is intented to produce a sample spreadsheet from diff --git a/bin/git-cleanup b/bin/git-cleanup index 0b1fc6a35..42fda0768 100755 --- a/bin/git-cleanup +++ b/bin/git-cleanup @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true `git fetch -ap` branches = `git branch --merged main`.split("\n").collect { |b| b.delete('*').strip } diff --git a/bin/graph b/bin/graph index 6ff6fa1e3..939279f7e 100644 --- a/bin/graph +++ b/bin/graph @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true # This script creates png images to visualize a Hyrax workflow # Usage: bin/graph diff --git a/bin/import_from_csv b/bin/import_from_csv index f3fd50dbc..fb4faf3a0 100755 --- a/bin/import_from_csv +++ b/bin/import_from_csv @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true def validate_hostname!(hostname) return if hostname diff --git a/bin/import_from_purl b/bin/import_from_purl index 9b6b214d0..4e0c00463 100755 --- a/bin/import_from_purl +++ b/bin/import_from_purl @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true def validate_hostname!(hostname) return if hostname diff --git a/bin/import_mods_files b/bin/import_mods_files index 7398057c8..dd8cacdfa 100755 --- a/bin/import_mods_files +++ b/bin/import_mods_files @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true def validate_hostname!(hostname) return if hostname diff --git a/bin/rails b/bin/rails index 073966023..dd027b406 100755 --- a/bin/rails +++ b/bin/rails @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true APP_PATH = File.expand_path('../config/application', __dir__) require_relative '../config/boot' require 'rails/commands' diff --git a/bin/rake b/bin/rake index 17240489f..609af7470 100755 --- a/bin/rake +++ b/bin/rake @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true require_relative '../config/boot' require 'rake' Rake.application.run diff --git a/bin/setup b/bin/setup index e620b4dad..ffca742a1 100755 --- a/bin/setup +++ b/bin/setup @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true require 'pathname' require 'fileutils' include FileUtils diff --git a/bin/spring b/bin/spring index 7fe232c3a..99c5cacd8 100755 --- a/bin/spring +++ b/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/bin/update b/bin/update index a8e4462f2..3f81e5496 100755 --- a/bin/update +++ b/bin/update @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true require 'pathname' require 'fileutils' include FileUtils diff --git a/bin/web b/bin/web index 2fd50cdf5..46e648166 100755 --- a/bin/web +++ b/bin/web @@ -1,4 +1,5 @@ #!/usr/local/bin/ruby +# frozen_string_literal: true `echo "$GOOGLE_OAUTH_PRIVATE_KEY_VALUE" | base64 -d > prod-cred.p12` if ENV['GOOGLE_OAUTH_PRIVATE_KEY_VALUE'].present? exec "bundle exec puma -v -b tcp://0.0.0.0:3000" diff --git a/bin/worker b/bin/worker index 1ab592264..b3cb34ce5 100755 --- a/bin/worker +++ b/bin/worker @@ -1,4 +1,5 @@ #!/usr/local/bin/ruby +# frozen_string_literal: true `echo "$GOOGLE_OAUTH_PRIVATE_KEY_VALUE" | base64 -d > prod-cred.p12` if ENV['GOOGLE_OAUTH_PRIVATE_KEY_VALUE'].present? if ENV['DATABASE_URL'].present? diff --git a/config/application.rb b/config/application.rb index d6356bc09..b8a43824d 100644 --- a/config/application.rb +++ b/config/application.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require_relative 'boot' require_relative '../app/middleware/no_cache_middleware' diff --git a/config/boot.rb b/config/boot.rb index 30f5120df..9be337a42 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) require 'bundler/setup' # Set up gems listed in the Gemfile. diff --git a/config/environment.rb b/config/environment.rb index 426333bb4..12ea62f88 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Load the Rails application. require_relative 'application' diff --git a/config/environments/development.rb b/config/environments/development.rb index 448ece68d..2f2bf2195 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. diff --git a/config/environments/production.rb b/config/environments/production.rb index b6cdf3770..e57bb998e 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. diff --git a/config/environments/test.rb b/config/environments/test.rb index 30587ef6d..416a71c86 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. diff --git a/config/initializers/0db_created.rb b/config/initializers/0db_created.rb index ffd0e463c..8f4e56f85 100644 --- a/config/initializers/0db_created.rb +++ b/config/initializers/0db_created.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true def db_created? ::ActiveRecord::Base.connection_pool.with_connection(&:active?) rescue diff --git a/config/initializers/active_fedora_override.rb b/config/initializers/active_fedora_override.rb index 58ec7fe04..e595997ae 100644 --- a/config/initializers/active_fedora_override.rb +++ b/config/initializers/active_fedora_override.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Based on https://github.com/samvera/hyrax/issues/4581#issuecomment-843085122 # Monkey-patch to short circuit ActiveModel::Dirty which attempts to load the whole master files ordered list when calling nodes_will_change! diff --git a/config/initializers/apartment.rb b/config/initializers/apartment.rb index 6acc1fd12..e294580f0 100644 --- a/config/initializers/apartment.rb +++ b/config/initializers/apartment.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true if ENV['DB_ADAPTER'] != 'nulldb' && db_created? # You can have Apartment route to the appropriate Tenant by adding some Rack middleware. # Apartment can support many different "Elevators" that can take care of this routing to your data. diff --git a/config/initializers/apartment_activejob.rb b/config/initializers/apartment_activejob.rb index 6f2b410cf..9073c7400 100644 --- a/config/initializers/apartment_activejob.rb +++ b/config/initializers/apartment_activejob.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'active_job' require 'active_job_tenant' diff --git a/config/initializers/application_controller_renderer.rb b/config/initializers/application_controller_renderer.rb index 51639b67a..315ac48a9 100644 --- a/config/initializers/application_controller_renderer.rb +++ b/config/initializers/application_controller_renderer.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Be sure to restart your server when you modify this file. # ApplicationController.renderer.defaults.merge!( diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index 01ef3e663..9287bcd33 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Be sure to restart your server when you modify this file. # Version of your assets, change this if you want to expire all your assets. diff --git a/config/initializers/backtrace_silencers.rb b/config/initializers/backtrace_silencers.rb index 59385cdf3..d0f0d3b5d 100644 --- a/config/initializers/backtrace_silencers.rb +++ b/config/initializers/backtrace_silencers.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Be sure to restart your server when you modify this file. # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. diff --git a/config/initializers/clamav.rb b/config/initializers/clamav.rb index 7cd26d6a2..7dcb60d7e 100644 --- a/config/initializers/clamav.rb +++ b/config/initializers/clamav.rb @@ -1 +1,2 @@ +# frozen_string_literal: true ClamAV.instance.loaddb if defined? ClamAV diff --git a/config/initializers/cookies_serializer.rb b/config/initializers/cookies_serializer.rb index 5a6a32d37..2a7295959 100644 --- a/config/initializers/cookies_serializer.rb +++ b/config/initializers/cookies_serializer.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Be sure to restart your server when you modify this file. # Specify a serializer for the signed and encrypted cookie jars. diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 1d86f3c3c..cc50f1782 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Use this hook to configure devise mailer, warden hooks and so forth. # Many of these configuration options can be set straight in your model. Devise.setup do |config| diff --git a/config/initializers/file_set_derivatives_overrides.rb b/config/initializers/file_set_derivatives_overrides.rb index ace70d032..7ae9c0ade 100644 --- a/config/initializers/file_set_derivatives_overrides.rb +++ b/config/initializers/file_set_derivatives_overrides.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # This file contains overrides to Hyrax::FileSetDerivativesService to increase the size of thumbnails # Hyrax v3.5.0 diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb index 4a994e1e7..b7fe1231f 100644 --- a/config/initializers/filter_parameter_logging.rb +++ b/config/initializers/filter_parameter_logging.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Be sure to restart your server when you modify this file. # Configure sensitive parameters which will be filtered from the log file. diff --git a/config/initializers/hydra_config.rb b/config/initializers/hydra_config.rb index 35f9eccd6..42f406838 100644 --- a/config/initializers/hydra_config.rb +++ b/config/initializers/hydra_config.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # windows doesn't properly require hydra-head (from the gemfile), so we need to require it explicitly here: require 'hydra/head' unless defined? Hydra diff --git a/config/initializers/hyrax.rb b/config/initializers/hyrax.rb index 6cd21a831..6147b7b1f 100644 --- a/config/initializers/hyrax.rb +++ b/config/initializers/hyrax.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Set nested indexer to graph by default. Remove after Hyrax 4.0 upgrade ENV['HYRAX_USE_SOLR_GRAPH_NESTING'].present? || ENV['HYRAX_USE_SOLR_GRAPH_NESTING'] = "true" diff --git a/config/initializers/iiif_print.rb b/config/initializers/iiif_print.rb index c97d5bd58..b1b90418e 100644 --- a/config/initializers/iiif_print.rb +++ b/config/initializers/iiif_print.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true IiifPrint.config do |config| # NOTE: WorkTypes and models are used synonymously here. # Add models to be excluded from search so the user diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index ac033bf9d..aa7435fbc 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Be sure to restart your server when you modify this file. # Add new inflection rules using the following format. Inflections diff --git a/config/initializers/mailboxer.rb b/config/initializers/mailboxer.rb index f244e1996..b27f6d083 100644 --- a/config/initializers/mailboxer.rb +++ b/config/initializers/mailboxer.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true Mailboxer.setup do |config| # Configures if you application uses or not email sending for Notifications and Messages config.uses_emails = true diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb index 022642dff..ec9f6f595 100644 --- a/config/initializers/mime_types.rb +++ b/config/initializers/mime_types.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Be sure to restart your server when you modify this file. # Add new mime types for use in respond_to blocks: diff --git a/config/initializers/mini_magick.rb b/config/initializers/mini_magick.rb index 4d73ff079..7fc113a30 100644 --- a/config/initializers/mini_magick.rb +++ b/config/initializers/mini_magick.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require 'mini_magick' MiniMagick.configure do |config| diff --git a/config/initializers/new_framework_defaults.rb b/config/initializers/new_framework_defaults.rb index 5c4156533..2543be7c8 100644 --- a/config/initializers/new_framework_defaults.rb +++ b/config/initializers/new_framework_defaults.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Be sure to restart your server when you modify this file. # # This file contains migration options to ease your Rails 5.0 upgrade. diff --git a/config/initializers/redis_config.rb b/config/initializers/redis_config.rb index 19f95c33d..c1b32817e 100644 --- a/config/initializers/redis_config.rb +++ b/config/initializers/redis_config.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true config = YAML.load(ERB.new(IO.read(Rails.root + 'config' + 'redis.yml')).result)[Rails.env].with_indifferent_access sentinels = config[:sentinel] && config[:sentinel][:host].present? ? { sentinels: [config[:sentinel]] } : {} redis_config = config.except(:sentinel).merge(thread_safe: true).merge(sentinels) diff --git a/config/initializers/riiif.rb b/config/initializers/riiif.rb index 9b7328ee2..9ff19b8ab 100644 --- a/config/initializers/riiif.rb +++ b/config/initializers/riiif.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true Riiif::Image.file_resolver = Riiif::HTTPFileResolver.new Riiif::Image.info_service = lambda do |id, _file| # id will look like a path to a pcdm:file diff --git a/config/initializers/rolify.rb b/config/initializers/rolify.rb index b56270b50..91ab2eaf7 100644 --- a/config/initializers/rolify.rb +++ b/config/initializers/rolify.rb @@ -1,2 +1,3 @@ +# frozen_string_literal: true Rolify.configure do |config| end diff --git a/config/initializers/secure_headers.rb b/config/initializers/secure_headers.rb index bda68ab4d..b0bb7b3e2 100644 --- a/config/initializers/secure_headers.rb +++ b/config/initializers/secure_headers.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true SecureHeaders::Configuration.default do |config| config.cookies = { secure: ActiveRecord::Type::Boolean.new.cast(ENV.fetch('HYKU_SSL_CONFIGURED', false)) || SecureHeaders::OPT_OUT, diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index d7b7ec0c7..1075162f0 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Be sure to restart your server when you modify this file. Rails.application.config.session_store :cookie_store, key: '_hyku_session' diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb index dc3a30bae..71c430cf5 100644 --- a/config/initializers/sidekiq.rb +++ b/config/initializers/sidekiq.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true if ENV.fetch('HYRAX_ACTIVE_JOB_QUEUE', 'sidekiq') == 'sidekiq' config = YAML.load(ERB.new(IO.read(Rails.root + 'config' + 'redis.yml')).result)[Rails.env].with_indifferent_access diff --git a/config/initializers/simple_form.rb b/config/initializers/simple_form.rb index 8f26be3c3..8b07d836e 100644 --- a/config/initializers/simple_form.rb +++ b/config/initializers/simple_form.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # NOTE: This is a modified version of simple_form's default config file. # The only changes were to move the input to after the hint and error. diff --git a/config/initializers/simple_form_bootstrap.rb b/config/initializers/simple_form_bootstrap.rb index c5ee0408d..3098be131 100644 --- a/config/initializers/simple_form_bootstrap.rb +++ b/config/initializers/simple_form_bootstrap.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # NOTE: This is a modified version of simple_form's default config file. # The only changes were to move the inputs to after the hints and errors. diff --git a/config/initializers/stats_admin.rb b/config/initializers/stats_admin.rb index 3b6767fb1..b7871feb0 100644 --- a/config/initializers/stats_admin.rb +++ b/config/initializers/stats_admin.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # -*- coding: utf-8 -*- module Hyrax class StatsAdmin diff --git a/config/initializers/version.rb b/config/initializers/version.rb index 65a71d0df..899b92b14 100644 --- a/config/initializers/version.rb +++ b/config/initializers/version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Hyku - VERSION = '5.1.0'.freeze + VERSION = '5.1.0' end diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb index bbfc3961b..2f3c0db47 100644 --- a/config/initializers/wrap_parameters.rb +++ b/config/initializers/wrap_parameters.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Be sure to restart your server when you modify this file. # This file contains settings for ActionController::ParamsWrapper which diff --git a/config/puma.rb b/config/puma.rb index c7f311f81..14a0f440a 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # Puma can serve each request in a thread from an internal thread pool. # The `threads` method setting takes two numbers a minimum and maximum. # Any libraries that use thread pools should be configured to match diff --git a/config/spring.rb b/config/spring.rb index 9fa7863f9..240be63ab 100644 --- a/config/spring.rb +++ b/config/spring.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true %w[ .ruby-version .rbenv-vars diff --git a/lib/tasks/rubocop.rake b/lib/tasks/rubocop.rake index 64e964e6d..86de3ac8d 100644 --- a/lib/tasks/rubocop.rake +++ b/lib/tasks/rubocop.rake @@ -1,3 +1,4 @@ +# frozen_string_literal: true begin require 'rubocop/rake_task'