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

pull/37256/head
Nicholas La Roux 3 months ago committed by GitHub
parent 5fa7654688
commit 09ab2829da
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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

@ -39,7 +39,7 @@ class ActivityPub::InboxesController < ActivityPub::BaseController
return @body if defined?(@body)
@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)

@ -275,7 +275,7 @@ class Request
end
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
class ::HTTP::Response
include Request::ClientLimit

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

@ -13,7 +13,7 @@
value = ENV.fetch(key, '')
if value.blank?
abort <<~MESSAGE
abort <<~MESSAGE # rubocop:disable Rails/Exit
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')
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.

@ -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')}".
MESSAGE
abort message
abort message # rubocop:disable Rails/Exit
end
if ENV['MASTODON_USE_LIBVIPS'] == 'false'

@ -6,7 +6,7 @@ if Rails.configuration.x.use_vips
require 'vips'
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
ERROR
end

Loading…
Cancel
Save