diff --git a/.rubocop.yml b/.rubocop.yml index ebeed6ea49..bba4282855 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -26,9 +26,11 @@ inherit_mode: merge: - Exclude -require: +plugins: - rubocop-rails - rubocop-rspec - - rubocop-rspec_rails - rubocop-performance + +require: + - rubocop-rspec_rails - rubocop-capybara diff --git a/.rubocop/rails.yml b/.rubocop/rails.yml index ae31c1f266..bbd172e656 100644 --- a/.rubocop/rails.yml +++ b/.rubocop/rails.yml @@ -2,6 +2,9 @@ Rails/BulkChangeTable: Enabled: false # Conflicts with strong_migrations features +Rails/Delegate: + Enabled: false + Rails/FilePath: EnforcedStyle: arguments diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index f2d3418b64..5cf43a3d5b 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.70.0. +# using RuboCop version 1.72.2. # 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 diff --git a/Gemfile.lock b/Gemfile.lock index 8d56fe5867..a70dd8de00 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -383,10 +383,11 @@ GEM railties (>= 6.1) rexml link_header (0.0.8) + lint_roller (1.1.0) llhttp-ffi (0.5.0) ffi-compiler (~> 1.0) rake (~> 13.0) - logger (1.6.5) + logger (1.6.6) lograge (0.14.0) actionpack (>= 4) activesupport (>= 4) @@ -722,9 +723,10 @@ GEM rspec-mocks (~> 3.0) sidekiq (>= 5, < 8) rspec-support (3.13.2) - rubocop (1.71.2) + rubocop (1.72.2) json (~> 2.3) - language_server-protocol (>= 3.17.0) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) @@ -736,16 +738,19 @@ GEM parser (>= 3.3.1.0) rubocop-capybara (2.21.0) rubocop (~> 1.41) - rubocop-performance (1.23.1) - rubocop (>= 1.48.1, < 2.0) - rubocop-ast (>= 1.31.1, < 2.0) - rubocop-rails (2.29.1) + rubocop-performance (1.24.0) + lint_roller (~> 1.1) + rubocop (>= 1.72.1, < 2.0) + rubocop-ast (>= 1.38.0, < 2.0) + rubocop-rails (2.30.1) activesupport (>= 4.2.0) + lint_roller (~> 1.1) rack (>= 1.1) - rubocop (>= 1.52.0, < 2.0) - rubocop-ast (>= 1.31.1, < 2.0) - rubocop-rspec (3.4.0) - rubocop (~> 1.61) + rubocop (>= 1.72.1, < 2.0) + rubocop-ast (>= 1.38.0, < 2.0) + rubocop-rspec (3.5.0) + lint_roller (~> 1.1) + rubocop (~> 1.72, >= 1.72.1) rubocop-rspec_rails (2.30.0) rubocop (~> 1.61) rubocop-rspec (~> 3, >= 3.0.1) diff --git a/app/lib/request.rb b/app/lib/request.rb index 4e0ba77833..8fda86f0e8 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 = [] # rubocop:disable Lint/UselessAssignment -- TODO: https://github.com/rubocop/rubocop/issues/13395 begin addresses = [IPAddr.new(host)] rescue IPAddr::InvalidAddressError diff --git a/app/services/backup_service.rb b/app/services/backup_service.rb index 133a764873..cc86af0005 100644 --- a/app/services/backup_service.rb +++ b/app/services/backup_service.rb @@ -6,6 +6,8 @@ class BackupService < BaseService include Payloadable include ContextHelper + CHUNK_SIZE = 1.megabyte + attr_reader :account, :backup def call(backup) @@ -181,8 +183,6 @@ class BackupService < BaseService ).as_json end - CHUNK_SIZE = 1.megabyte - def download_to_zip(zipfile, attachment, filename) adapter = Paperclip.io_adapters.for(attachment) diff --git a/lib/mastodon/cli/media.rb b/lib/mastodon/cli/media.rb index 68420fb15d..84ec13eaab 100644 --- a/lib/mastodon/cli/media.rb +++ b/lib/mastodon/cli/media.rb @@ -289,6 +289,16 @@ module Mastodon::CLI fail_with_message 'Invalid URL' end + PRELOADED_MODELS = %w( + Account + Backup + CustomEmoji + Import + MediaAttachment + PreviewCard + SiteUpload + ).freeze + private def object_storage_summary @@ -310,16 +320,6 @@ module Mastodon::CLI SQL end - PRELOADED_MODELS = %w( - Account - Backup - CustomEmoji - Import - MediaAttachment - PreviewCard - SiteUpload - ).freeze - def preload_records_from_mixed_objects(objects) preload_map = Hash.new { |hash, key| hash[key] = [] }