Update rubocop to version 1.77.0 (#35128)

This commit is contained in:
Matt Jankowski 2025-06-23 03:40:11 -04:00 committed by GitHub
parent ac039d5f13
commit 8837fd8c54
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 8 additions and 8 deletions

View File

@ -1,6 +1,6 @@
# This configuration was generated by # This configuration was generated by
# `rubocop --auto-gen-config --auto-gen-only-exclude --no-offense-counts --no-auto-gen-timestamp` # `rubocop --auto-gen-config --auto-gen-only-exclude --no-offense-counts --no-auto-gen-timestamp`
# using RuboCop version 1.76.2. # using RuboCop version 1.77.0.
# The point is for the user to remove these configuration records # The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base. # one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new # Note that changes in the inspected code, or installation of new
@ -28,7 +28,7 @@ Metrics/PerceivedComplexity:
Max: 27 Max: 27
# This cop supports safe autocorrection (--autocorrect). # This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowedVars. # Configuration parameters: AllowedVars, DefaultToNil.
Style/FetchEnvVar: Style/FetchEnvVar:
Exclude: Exclude:
- 'config/initializers/paperclip.rb' - 'config/initializers/paperclip.rb'

View File

@ -761,7 +761,7 @@ GEM
rspec-mocks (~> 3.0) rspec-mocks (~> 3.0)
sidekiq (>= 5, < 9) sidekiq (>= 5, < 9)
rspec-support (3.13.4) rspec-support (3.13.4)
rubocop (1.76.2) rubocop (1.77.0)
json (~> 2.3) json (~> 2.3)
language_server-protocol (~> 3.17.0.2) language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0) lint_roller (~> 1.1.0)

View File

@ -32,7 +32,7 @@ class Api::V1::FiltersController < Api::BaseController
ApplicationRecord.transaction do ApplicationRecord.transaction do
@filter.update!(keyword_params) @filter.update!(keyword_params)
@filter.custom_filter.assign_attributes(filter_params) @filter.custom_filter.assign_attributes(filter_params)
raise Mastodon::ValidationError, I18n.t('filters.errors.deprecated_api_multiple_keywords') if @filter.custom_filter.changed? && @filter.custom_filter.keywords.count > 1 raise Mastodon::ValidationError, I18n.t('filters.errors.deprecated_api_multiple_keywords') if @filter.custom_filter.changed? && @filter.custom_filter.keywords.many?
@filter.custom_filter.save! @filter.custom_filter.save!
end end

View File

@ -4,6 +4,6 @@ class BackupPolicy < ApplicationPolicy
MIN_AGE = 6.days MIN_AGE = 6.days
def create? def create?
user_signed_in? && current_user.backups.where(created_at: MIN_AGE.ago..).count.zero? user_signed_in? && current_user.backups.where(created_at: MIN_AGE.ago..).none?
end end
end end

View File

@ -112,17 +112,17 @@ namespace :tests do
exit(1) exit(1)
end end
unless Identity.where(provider: 'foo', uid: 0).count == 1 unless Identity.where(provider: 'foo', uid: 0).one?
puts 'Identities not deduplicated as expected' puts 'Identities not deduplicated as expected'
exit(1) exit(1)
end end
unless WebauthnCredential.where(user_id: 1, nickname: 'foo').count == 1 unless WebauthnCredential.where(user_id: 1, nickname: 'foo').one?
puts 'Webauthn credentials not deduplicated as expected' puts 'Webauthn credentials not deduplicated as expected'
exit(1) exit(1)
end end
unless AccountAlias.where(account_id: 1, uri: 'https://example.com/users/foobar').count == 1 unless AccountAlias.where(account_id: 1, uri: 'https://example.com/users/foobar').one?
puts 'Account aliases not deduplicated as expected' puts 'Account aliases not deduplicated as expected'
exit(1) exit(1)
end end