Upgrade rubocop-rails from 2.33.4 to 2.34.2 and address related offenses (#37243)

This commit is contained in:
Nicholas La Roux
2025-12-15 07:57:16 -05:00
committed by GitHub
parent 5fa7654688
commit 09ab2829da
7 changed files with 8 additions and 8 deletions

View File

@@ -773,7 +773,7 @@ GEM
lint_roller (~> 1.1) lint_roller (~> 1.1)
rubocop (>= 1.75.0, < 2.0) rubocop (>= 1.75.0, < 2.0)
rubocop-ast (>= 1.47.1, < 2.0) rubocop-ast (>= 1.47.1, < 2.0)
rubocop-rails (2.33.4) rubocop-rails (2.34.2)
activesupport (>= 4.2.0) activesupport (>= 4.2.0)
lint_roller (~> 1.1) lint_roller (~> 1.1)
rack (>= 1.1) rack (>= 1.1)

View File

@@ -39,7 +39,7 @@ class ActivityPub::InboxesController < ActivityPub::BaseController
return @body if defined?(@body) return @body if defined?(@body)
@body = request.body.read @body = request.body.read
@body.force_encoding('UTF-8') if @body.present? @body.presence&.force_encoding('UTF-8')
request.body.rewind if request.body.respond_to?(:rewind) request.body.rewind if request.body.respond_to?(:rewind)

View File

@@ -275,7 +275,7 @@ class Request
end end
if ::HTTP::Response.methods.include?(:body_with_limit) && !Rails.env.production? if ::HTTP::Response.methods.include?(:body_with_limit) && !Rails.env.production?
abort 'HTTP::Response#body_with_limit is already defined, the monkey patch will not be applied' raise 'HTTP::Response#body_with_limit is already defined, the monkey patch will not be applied'
else else
class ::HTTP::Response class ::HTTP::Response
include Request::ClientLimit include Request::ClientLimit

View File

@@ -1,7 +1,7 @@
# frozen_string_literal: true # frozen_string_literal: true
unless ENV.key?('RAILS_ENV') unless ENV.key?('RAILS_ENV')
abort <<~ERROR abort <<~ERROR # rubocop:disable Rails/Exit
The RAILS_ENV environment variable is not set. The RAILS_ENV environment variable is not set.
Please set it correctly depending on context: Please set it correctly depending on context:

View File

@@ -13,7 +13,7 @@
value = ENV.fetch(key, '') value = ENV.fetch(key, '')
if value.blank? if value.blank?
abort <<~MESSAGE abort <<~MESSAGE # rubocop:disable Rails/Exit
Mastodon now requires that these variables are set: Mastodon now requires that these variables are set:
@@ -28,7 +28,7 @@
next unless Rails.env.production? && value.end_with?('DO_NOT_USE_IN_PRODUCTION') next unless Rails.env.production? && value.end_with?('DO_NOT_USE_IN_PRODUCTION')
abort <<~MESSAGE abort <<~MESSAGE # rubocop:disable Rails/Exit
It looks like you are trying to run Mastodon in production with a #{key} value from the test environment. It looks like you are trying to run Mastodon in production with a #{key} value from the test environment.

View File

@@ -14,7 +14,7 @@ if ENV['REDIS_NAMESPACE']
In addition, as REDIS_NAMESPACE is being used as a prefix for Elasticsearch, please do not forget to set ES_PREFIX to "#{ENV.fetch('REDIS_NAMESPACE')}". In addition, as REDIS_NAMESPACE is being used as a prefix for Elasticsearch, please do not forget to set ES_PREFIX to "#{ENV.fetch('REDIS_NAMESPACE')}".
MESSAGE MESSAGE
abort message abort message # rubocop:disable Rails/Exit
end end
if ENV['MASTODON_USE_LIBVIPS'] == 'false' if ENV['MASTODON_USE_LIBVIPS'] == 'false'

View File

@@ -6,7 +6,7 @@ if Rails.configuration.x.use_vips
require 'vips' require 'vips'
unless Vips.at_least_libvips?(8, 13) unless Vips.at_least_libvips?(8, 13)
abort <<~ERROR.squish abort <<~ERROR.squish # rubocop:disable Rails/Exit
Incompatible libvips version (#{Vips.version_string}), please install libvips >= 8.13 Incompatible libvips version (#{Vips.version_string}), please install libvips >= 8.13
ERROR ERROR
end end