From 20a71a54799eb0db8e7db9f99d75698ff2ff2143 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 20 Aug 2025 13:04:36 -0400 Subject: [PATCH] Disable `Metrics/*` cops (#35000) --- .rubocop/metrics.yml | 17 ++++++++++++----- .rubocop_todo.yml | 17 ----------------- app/serializers/initial_state_serializer.rb | 2 +- 3 files changed, 13 insertions(+), 23 deletions(-) diff --git a/.rubocop/metrics.yml b/.rubocop/metrics.yml index 89532af42ab..bb15e6ff313 100644 --- a/.rubocop/metrics.yml +++ b/.rubocop/metrics.yml @@ -1,17 +1,21 @@ --- Metrics/AbcSize: - Exclude: - - lib/mastodon/cli/*.rb + Enabled: false Metrics/BlockLength: Enabled: false +Metrics/BlockNesting: + Enabled: false + Metrics/ClassLength: Enabled: false +Metrics/CollectionLiteralLength: + Enabled: false + Metrics/CyclomaticComplexity: - Exclude: - - lib/mastodon/cli/*.rb + Enabled: false Metrics/MethodLength: Enabled: false @@ -20,4 +24,7 @@ Metrics/ModuleLength: Enabled: false Metrics/ParameterLists: - CountKeywordArgs: false + Enabled: false + +Metrics/PerceivedComplexity: + Enabled: false diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 625fbf17ab4..68ed0ac6c8a 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -6,23 +6,6 @@ # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes. -Metrics/AbcSize: - Max: 82 - -# Configuration parameters: CountBlocks, CountModifierForms, Max. -Metrics/BlockNesting: - Exclude: - - 'lib/tasks/mastodon.rake' - -# Configuration parameters: AllowedMethods, AllowedPatterns. -Metrics/CyclomaticComplexity: - Max: 25 - -# Configuration parameters: AllowedMethods, AllowedPatterns. -Metrics/PerceivedComplexity: - Max: 27 - # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: AllowedVars, DefaultToNil. Style/FetchEnvVar: diff --git a/app/serializers/initial_state_serializer.rb b/app/serializers/initial_state_serializer.rb index 7926cc54be9..495b543e3d4 100644 --- a/app/serializers/initial_state_serializer.rb +++ b/app/serializers/initial_state_serializer.rb @@ -12,7 +12,7 @@ class InitialStateSerializer < ActiveModel::Serializer has_one :push_subscription, serializer: REST::WebPushSubscriptionSerializer has_one :role, serializer: REST::RoleSerializer - def meta # rubocop:disable Metrics/AbcSize + def meta store = default_meta_store if object.current_account