diff --git a/.rubocop.yml b/.rubocop.yml index 689b3ca36..2bbf1228c 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -241,3 +241,7 @@ Style/StringLiterals: - bin/rubocop - config/initializers/new_framework_defaults_7_2.rb - config/puma.rb + +# The new Ruby version 3.4 enforces frozen string literals by default +Style/FrozenStringLiteralComment: + Enabled: false diff --git a/bin/setup b/bin/setup index 690ca6a5b..d7fc86941 100755 --- a/bin/setup +++ b/bin/setup @@ -2,7 +2,7 @@ require "fileutils" APP_ROOT = File.expand_path("..", __dir__) -APP_NAME = "laa-court-data-ui" +APP_NAME = "laa-court-data-ui".freeze def system!(*args) system(*args, exception: true) diff --git a/config/application.rb b/config/application.rb index c06871f0f..e9c286333 100644 --- a/config/application.rb +++ b/config/application.rb @@ -41,11 +41,11 @@ class Application < Rails::Application config.exceptions_app = routes config.active_job.queue_adapter = :sidekiq - config.x.support_email_address = 'access-court-data-team@digital.justice.gov.uk' - config.x.display_raw_responses = %w[enabled true].include?(ENV.fetch('DISPLAY_RAW_RESPONSES', nil)) + config.x.support_email_address = "access-court-data-team@digital.justice.gov.uk" + config.x.display_raw_responses = %w[enabled true].include?(ENV.fetch("DISPLAY_RAW_RESPONSES", nil)) config.action_mailer.deliver_later_queue_name = :mailers - config.x.court_data_api_config.uri = ENV.fetch('COURT_DATA_API_URL', nil) - config.x.court_data_api_config.user = ENV.fetch('COURT_DATA_API_USERNAME', nil) - config.x.court_data_api_config.secret = ENV.fetch('COURT_DATA_API_SECRET', nil) + config.x.court_data_api_config.uri = ENV.fetch("COURT_DATA_API_URL", nil) + config.x.court_data_api_config.user = ENV.fetch("COURT_DATA_API_USERNAME", nil) + config.x.court_data_api_config.secret = ENV.fetch("COURT_DATA_API_SECRET", nil) end end diff --git a/config/environments/development.rb b/config/environments/development.rb index 527e056b2..c24f44dd8 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -82,7 +82,7 @@ config.logstasher.view_enabled = false config.logstasher.job_enabled = true config.logstasher.suppress_app_log = false - config.logstasher.source = 'laa-court-data-ui-development' + config.logstasher.source = "laa-court-data-ui-development" config.logstasher.backtrace = true - config.logstasher.logger_path = 'log/logstasher_development.log' + config.logstasher.logger_path = "log/logstasher_development.log" end diff --git a/config/environments/production.rb b/config/environments/production.rb index 7199b3960..8e3d2939c 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -22,7 +22,7 @@ # Disable serving static files from the `/public` folder by default since # Apache or NGINX already handles this. - config.public_file_server.enabled = ENV.fetch('RAILS_SERVE_STATIC_FILES', nil).present? + config.public_file_server.enabled = ENV.fetch("RAILS_SERVE_STATIC_FILES", nil).present? # Enable serving of images, stylesheets, and JavaScripts from an asset server. # config.asset_host = "http://assets.example.com" @@ -60,7 +60,7 @@ # Ignore bad email addresses and do not raise email delivery errors. # Set this to true and configure the email server for immediate delivery to raise delivery errors. config.action_mailer.raise_delivery_errors = false - config.action_mailer.default_url_options = { host: ENV.fetch('DOMAIN_URL', nil) } + config.action_mailer.default_url_options = { host: ENV.fetch("DOMAIN_URL", nil) } # Enable locale fallbacks for I18n (makes lookups for any locale fall back to # the I18n.default_locale when a translation cannot be found). @@ -73,7 +73,7 @@ config.active_record.dump_schema_after_migration = false # Only use :id for inspections in production. - config.active_record.attributes_for_inspect = [ :id ] + config.active_record.attributes_for_inspect = [:id] # Enable DNS rebinding protection and other `Host` header attacks. # config.hosts = [ diff --git a/config/environments/test.rb b/config/environments/test.rb index da299811f..da82d361c 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -20,7 +20,7 @@ # Configure public file server for tests with Cache-Control for performance. config.public_file_server.enabled = true config.public_file_server.headers = { - 'Cache-Control' => "public, max-age=#{1.hour.to_i}" + "Cache-Control" => "public, max-age=#{1.hour.to_i}" } # Don't care if the mailer can't send. @@ -73,9 +73,9 @@ config.logstasher.view_enabled = false config.logstasher.job_enabled = true config.logstasher.suppress_app_log = false - config.logstasher.source = 'laa-court-data-ui-test' + config.logstasher.source = "laa-court-data-ui-test" config.logstasher.backtrace = true - config.logstasher.logger_path = 'log/logstasher_test.log' + config.logstasher.logger_path = "log/logstasher_test.log" end # Annotate rendered view with file names. diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb index f025d8d5a..7f9cf478d 100644 --- a/config/initializers/filter_parameter_logging.rb +++ b/config/initializers/filter_parameter_logging.rb @@ -3,6 +3,6 @@ # Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file. # Use this to limit dissemination of sensitive information. # See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors. -Rails.application.config.filter_parameters += [ - :passw, :password, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn +Rails.application.config.filter_parameters += %i[ + passw password email secret token _key crypt salt certificate otp ssn ] diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index 1414a2d62..b8261dc74 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -13,5 +13,5 @@ # These inflection rules are supported but not enabled by default: ActiveSupport::Inflector.inflections(:en) do |inflect| # inflect.acronym 'RESTful' - inflect.acronym 'MAAT' + inflect.acronym "MAAT" end