From 342055cb15bc96c9eee1489b0dc60d1ebfa5ab73 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Mon, 9 Dec 2024 09:52:49 -0500 Subject: [PATCH] Update `rubocop` to version 1.69.1 (#32967) --- .rubocop/style.yml | 12 ++++++++++++ .rubocop_todo.yml | 3 +-- Gemfile.lock | 16 ++++++++-------- app/lib/request.rb | 2 +- app/validators/domain_validator.rb | 2 +- lib/mastodon/cli/progress_helper.rb | 2 +- lib/tasks/mastodon.rake | 2 +- 7 files changed, 25 insertions(+), 14 deletions(-) diff --git a/.rubocop/style.yml b/.rubocop/style.yml index 03e35a70ac..ee3ce39937 100644 --- a/.rubocop/style.yml +++ b/.rubocop/style.yml @@ -1,4 +1,7 @@ --- +Style/ArrayIntersect: + Enabled: false + Style/ClassAndModuleChildren: Enabled: false @@ -19,6 +22,12 @@ Style/HashSyntax: EnforcedShorthandSyntax: either EnforcedStyle: ruby19_no_mixed_keys +Style/KeywordArgumentsMerging: + Enabled: false + +Style/MultipleComparison: + Enabled: false + Style/NumericLiterals: AllowedPatterns: - \d{4}_\d{2}_\d{2}_\d{6} @@ -37,6 +46,9 @@ Style/RedundantFetchBlock: Style/RescueStandardError: EnforcedStyle: implicit +Style/SafeNavigationChainLength: + Enabled: false + Style/SymbolArray: Enabled: false diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index a6e51d6aee..552054898e 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.66.1. +# using RuboCop version 1.69.1. # 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 @@ -35,7 +35,6 @@ Rails/OutputSafety: # Configuration parameters: AllowedVars. Style/FetchEnvVar: Exclude: - - 'app/lib/translation_service.rb' - 'config/environments/production.rb' - 'config/initializers/2_limited_federation_mode.rb' - 'config/initializers/3_omniauth.rb' diff --git a/Gemfile.lock b/Gemfile.lock index ccc8270ccd..b0910b4d53 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -327,7 +327,7 @@ GEM azure-blob (~> 0.5.2) hashie (~> 5.0) jmespath (1.6.2) - json (2.8.1) + json (2.9.0) json-canonicalization (1.0.0) json-jwt (1.15.3.1) activesupport (>= 4.2) @@ -664,7 +664,7 @@ GEM redis (>= 4) redlock (1.3.2) redis (>= 3.0.0, < 6.0) - regexp_parser (2.9.2) + regexp_parser (2.9.3) reline (0.5.12) io-console (~> 0.5) request_store (1.6.0) @@ -708,21 +708,21 @@ GEM rspec-mocks (~> 3.0) sidekiq (>= 5, < 8) rspec-support (3.13.1) - rubocop (1.66.1) + rubocop (1.69.1) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 2.4, < 3.0) - rubocop-ast (>= 1.32.2, < 2.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.36.2, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.32.3) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.36.2) parser (>= 3.3.1.0) rubocop-capybara (2.21.0) rubocop (~> 1.41) - rubocop-performance (1.22.1) + rubocop-performance (1.23.0) rubocop (>= 1.48.1, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) rubocop-rails (2.27.0) diff --git a/app/lib/request.rb b/app/lib/request.rb index a12e6e3747..3d2a0c0e31 100644 --- a/app/lib/request.rb +++ b/app/lib/request.rb @@ -261,7 +261,7 @@ class Request outer_e = nil port = args.first - addresses = [] + 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/validators/domain_validator.rb b/app/validators/domain_validator.rb index 718fd190f1..f975dc8ff2 100644 --- a/app/validators/domain_validator.rb +++ b/app/validators/domain_validator.rb @@ -4,7 +4,7 @@ class DomainValidator < ActiveModel::EachValidator MAX_DOMAIN_LENGTH = 256 MIN_LABEL_LENGTH = 1 MAX_LABEL_LENGTH = 63 - ALLOWED_CHARACTERS_RE = /^[a-z0-9\-]+$/i + ALLOWED_CHARACTERS_RE = /^[a-z0-9-]+$/i def validate_each(record, attribute, value) return if value.blank? diff --git a/lib/mastodon/cli/progress_helper.rb b/lib/mastodon/cli/progress_helper.rb index da9527ffd7..a0cfec69cf 100644 --- a/lib/mastodon/cli/progress_helper.rb +++ b/lib/mastodon/cli/progress_helper.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -dev_null = Logger.new('/dev/null') +dev_null = Logger.new(File::NULL) Rails.logger = dev_null ActiveRecord::Base.logger = dev_null diff --git a/lib/tasks/mastodon.rake b/lib/tasks/mastodon.rake index e1e2dd8194..692fe0a507 100644 --- a/lib/tasks/mastodon.rake +++ b/lib/tasks/mastodon.rake @@ -592,7 +592,7 @@ namespace :mastodon do end def disable_log_stdout! - dev_null = Logger.new('/dev/null') + dev_null = Logger.new(File::NULL) Rails.logger = dev_null ActiveRecord::Base.logger = dev_null