Update rubocop to version 1.76.0 (#34926)

This commit is contained in:
Matt Jankowski 2025-06-05 08:09:05 -04:00 committed by GitHub
parent 1fdcaaebbb
commit 1297ad759e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 14 additions and 11 deletions

View file

@ -1,3 +1,6 @@
---
Naming/BlockForwarding:
EnforcedStyle: explicit
Naming/PredicateMethod:
Enabled: false

View file

@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config --auto-gen-only-exclude --no-offense-counts --no-auto-gen-timestamp`
# using RuboCop version 1.75.8.
# using RuboCop version 1.76.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new

View file

@ -751,7 +751,7 @@ GEM
rspec-mocks (~> 3.0)
sidekiq (>= 5, < 9)
rspec-support (3.13.3)
rubocop (1.75.8)
rubocop (1.76.0)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
@ -759,10 +759,10 @@ GEM
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.44.0, < 2.0)
rubocop-ast (>= 1.45.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.44.1)
rubocop-ast (1.45.0)
parser (>= 3.3.7.2)
prism (~> 1.4)
rubocop-capybara (2.22.1)

View file

@ -138,7 +138,7 @@ class Auth::RegistrationsController < Devise::RegistrationsController
set_locale { render :rules }
end
def is_flashing_format? # rubocop:disable Naming/PredicateName
def is_flashing_format? # rubocop:disable Naming/PredicatePrefix
if params[:action] == 'create'
false # Disable flash messages for sign-up
else

View file

@ -22,7 +22,7 @@ module Attachmentable
).freeze
included do
def self.has_attached_file(name, options = {}) # rubocop:disable Naming/PredicateName
def self.has_attached_file(name, options = {}) # rubocop:disable Naming/PredicatePrefix
super
send(:"before_#{name}_validate", prepend: true) do

View file

@ -17,7 +17,7 @@ module UserSettings::Glue
self.class.definition_for(key)&.type
end
def has_attribute?(key) # rubocop:disable Naming/PredicateName
def has_attribute?(key) # rubocop:disable Naming/PredicatePrefix
self.class.definition_for?(key)
end
end

View file

@ -21,7 +21,7 @@ Rails.application.configure do
config.x.streaming_api_base_url = ENV.fetch('STREAMING_API_BASE_URL') do
if Rails.env.production?
"ws#{https ? 's' : ''}://#{web_host}"
"ws#{'s' if https}://#{web_host}"
else
"ws://#{host.split(':').first}:4000"
end

View file

@ -32,7 +32,7 @@ Rails.application.config.content_security_policy do |p|
if Rails.env.development?
vite_public_host = ENV.fetch('VITE_DEV_SERVER_PUBLIC', "localhost:#{ViteRuby.config.port}")
front_end_build_urls = %w(ws http).map { |protocol| "#{protocol}#{ViteRuby.config.https ? 's' : ''}://#{vite_public_host}" }
front_end_build_urls = %w(ws http).map { |protocol| "#{protocol}#{'s' if ViteRuby.config.https}://#{vite_public_host}" }
p.connect_src :self, :data, :blob, *media_hosts, Rails.configuration.x.streaming_api_base_url, *front_end_build_urls
p.script_src :self, :unsafe_inline, :unsafe_eval, assets_host

View file

@ -23,7 +23,7 @@ module Mastodon
def announce_countdown
WARNING_SECONDS.downto(1) do |i|
say "Continuing in #{i} second#{i == 1 ? '' : 's'}...", true
say "Continuing in #{i} second#{'s' unless i == 1}...", true
sleep 1
end
end

View file

@ -75,7 +75,7 @@ module Mastodon
end
def user_agent
@user_agent ||= "Mastodon/#{Version} (#{HTTP::Request::USER_AGENT}; +http#{Rails.configuration.x.use_https ? 's' : ''}://#{Rails.configuration.x.web_domain}/)"
@user_agent ||= "Mastodon/#{Version} (#{HTTP::Request::USER_AGENT}; +http#{'s' if Rails.configuration.x.use_https}://#{Rails.configuration.x.web_domain}/)"
end
def version_configuration