From d65b2c1924d8ff63c6e8c1b79d678e78e9126df9 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Fri, 17 Feb 2023 22:30:03 -0500 Subject: [PATCH] Apply Rubocop Style/RedundantConstantBase (#23463) --- .rubocop_todo.yml | 8 -------- config.ru | 2 +- lib/tasks/statistics.rake | 2 +- spec/rails_helper.rb | 2 +- 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 5319d6ace..523570607 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -3194,14 +3194,6 @@ Style/RedundantBegin: - 'lib/sanitize_ext/sanitize_config.rb' - 'lib/tasks/db.rake' -# Offense count: 3 -# This cop supports safe autocorrection (--autocorrect). -Style/RedundantConstantBase: - Exclude: - - 'config.ru' - - 'lib/tasks/statistics.rake' - - 'spec/rails_helper.rb' - # Offense count: 16 # This cop supports safe autocorrection (--autocorrect). Style/RedundantRegexpCharacterClass: diff --git a/config.ru b/config.ru index d7295e476..5e071f530 100644 --- a/config.ru +++ b/config.ru @@ -1,5 +1,5 @@ # frozen_string_literal: true # This file is used by Rack-based servers to start the application. -require ::File.expand_path('config/environment', __dir__) +require File.expand_path('config/environment', __dir__) run Rails.application diff --git a/lib/tasks/statistics.rake b/lib/tasks/statistics.rake index 82f2b5416..440c309ce 100644 --- a/lib/tasks/statistics.rake +++ b/lib/tasks/statistics.rake @@ -13,7 +13,7 @@ namespace :mastodon do %w(Validators app/validators), %w(Workers app/workers), ].each do |name, dir| - ::STATS_DIRECTORIES << [name, Rails.root.join(dir)] + STATS_DIRECTORIES << [name, Rails.root.join(dir)] end end end diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index c197bc007..20e48b9a3 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -33,7 +33,7 @@ Devise::Test::ControllerHelpers.module_eval do end RSpec.configure do |config| - config.fixture_path = "#{::Rails.root}/spec/fixtures" + config.fixture_path = "#{Rails.root}/spec/fixtures" config.use_transactional_fixtures = true config.order = 'random' config.infer_spec_type_from_file_location!