diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 4fe2adf83c6..1678272c7b3 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -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.73.2. +# using RuboCop version 1.75.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 @@ -45,7 +45,7 @@ Style/FetchEnvVar: - 'lib/tasks/repo.rake' # This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle, MaxUnannotatedPlaceholdersAllowed, AllowedMethods, AllowedPatterns. +# Configuration parameters: EnforcedStyle, MaxUnannotatedPlaceholdersAllowed, Mode, AllowedMethods, AllowedPatterns. # SupportedStyles: annotated, template, unannotated # AllowedMethods: redirect Style/FormatStringToken: @@ -73,7 +73,6 @@ Style/MapToHash: # AllowedMethods: respond_to_missing? Style/OptionalBooleanParameter: Exclude: - - 'app/helpers/json_ld_helper.rb' - 'app/lib/admin/system_check/message.rb' - 'app/lib/request.rb' - 'app/lib/webfinger.rb' diff --git a/Gemfile.lock b/Gemfile.lock index 0daa305f701..323e0d1364b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -580,7 +580,7 @@ GEM ox (2.14.22) bigdecimal (>= 3.0) parallel (1.26.3) - parser (3.3.7.2) + parser (3.3.7.3) ast (~> 2.4.1) racc parslet (2.0.0) @@ -600,6 +600,7 @@ GEM net-smtp premailer (~> 1.7, >= 1.7.9) prettyprint (0.2.0) + prism (1.4.0) prometheus_exporter (2.2.0) webrick propshaft (1.1.0) @@ -733,7 +734,7 @@ GEM rspec-mocks (~> 3.0) sidekiq (>= 5, < 9) rspec-support (3.13.2) - rubocop (1.74.0) + rubocop (1.75.0) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -741,11 +742,12 @@ GEM parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.9.3, < 3.0) - rubocop-ast (>= 1.38.0, < 2.0) + rubocop-ast (>= 1.43.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.38.1) - parser (>= 3.3.1.0) + rubocop-ast (1.43.0) + parser (>= 3.3.7.2) + prism (~> 1.4) rubocop-capybara (2.22.1) lint_roller (~> 1.1) rubocop (~> 1.72, >= 1.72.1) diff --git a/app/lib/request.rb b/app/lib/request.rb index 8fda86f0e8d..ad39f928dbe 100644 --- a/app/lib/request.rb +++ b/app/lib/request.rb @@ -260,7 +260,7 @@ class Request outer_e = nil port = args.first - addresses = [] # rubocop:disable Lint/UselessAssignment -- TODO: https://github.com/rubocop/rubocop/issues/13395 + addresses = [] begin addresses = [IPAddr.new(host)] rescue IPAddr::InvalidAddressError diff --git a/app/models/trends/links.rb b/app/models/trends/links.rb index 35ccf7744c3..c24e069b517 100644 --- a/app/models/trends/links.rb +++ b/app/models/trends/links.rb @@ -33,7 +33,8 @@ class Trends::Links < Trends::Base def register(status, at_time = Time.now.utc) original_status = status.proper - return unless (original_status.public_visibility? && status.public_visibility?) && + return unless original_status.public_visibility? && + status.public_visibility? && !(original_status.account.silenced? || status.account.silenced?) && !(original_status.spoiler_text? || original_status.sensitive?) diff --git a/app/services/concerns/payloadable.rb b/app/services/concerns/payloadable.rb index bd9d9d74b51..3eea3aa5678 100644 --- a/app/services/concerns/payloadable.rb +++ b/app/services/concerns/payloadable.rb @@ -17,7 +17,7 @@ module Payloadable payload = ActiveModelSerializers::SerializableResource.new(record, options.merge(serializer: serializer, adapter: ActivityPub::Adapter)).as_json object = record.respond_to?(:virtual_object) ? record.virtual_object : record - if (object.respond_to?(:sign?) && object.sign?) && signer && (always_sign || signing_enabled?) + if object.respond_to?(:sign?) && object.sign? && signer && (always_sign || signing_enabled?) ActivityPub::LinkedDataSignature.new(payload).sign!(signer, sign_with: sign_with) else payload diff --git a/app/workers/poll_expiration_notify_worker.rb b/app/workers/poll_expiration_notify_worker.rb index b7a60fab847..fe7647024e5 100644 --- a/app/workers/poll_expiration_notify_worker.rb +++ b/app/workers/poll_expiration_notify_worker.rb @@ -8,7 +8,7 @@ class PollExpirationNotifyWorker def perform(poll_id) @poll = Poll.find(poll_id) - return if does_not_expire? + return if missing_expiration? requeue! && return if not_due_yet? notify_remote_voters_and_owner! if @poll.local? @@ -24,7 +24,7 @@ class PollExpirationNotifyWorker private - def does_not_expire? + def missing_expiration? @poll.expires_at.nil? end