From 0ecbe85a30129e9106797960fcbd0a676cf90445 Mon Sep 17 00:00:00 2001 From: Darius Schneider <schneider@itc.rwth-aachen.de> Date: Wed, 6 Nov 2024 09:42:09 +0100 Subject: [PATCH] better exclusions for gems for Rubocop Metrics department --- rails/rubocop-for-gem.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rails/rubocop-for-gem.yml b/rails/rubocop-for-gem.yml index 6ce1142..062527b 100644 --- a/rails/rubocop-for-gem.yml +++ b/rails/rubocop-for-gem.yml @@ -51,13 +51,13 @@ Metrics/AbcSize: Metrics/BlockLength: AllowedMethods: ['class_eval', 'module_eval', 'refine'] # default: 'refine' CountAsOne: &array_hash_heredoc_method_call ['array', 'hash', 'heredoc', 'method_call'] # default: [] - Exclude: &test_config_db ['*.gemspec', '*/config/**/*', 'test/**/*', 'config/**/*', 'db/**/*'] + Exclude: &test_config_db_gemspec_subconfig ['test/**/*', 'config/**/*', 'db/**/*', '*.gemspec', '**/*/config/*'] # default is too restrictive, having some restriction incentivizes to split up overly large classes Metrics/ClassLength: CountAsOne: *array_hash_heredoc_method_call # default: [] Max: 200 # default: 100 - Exclude: *test_config_db + Exclude: *test_config_db_gemspec_subconfig # default is too restrictive, allow higher complexity Metrics/CyclomaticComplexity: @@ -67,13 +67,13 @@ Metrics/CyclomaticComplexity: Metrics/MethodLength: CountAsOne: *array_hash_heredoc_method_call # default: [] Max: 30 # default: 10 - Exclude: *test_config_db + Exclude: *test_config_db_gemspec_subconfig # default is too restrictive, allow longer modules Metrics/ModuleLength: CountAsOne: *array_hash_heredoc_method_call # default: [] Max: 200 # default: 100 - Exclude: *test_config_db + Exclude: *test_config_db_gemspec_subconfig # long parameter lists add too much complexity, keyword args are named and thus more obvious what is expected, ignore them Metrics/ParameterLists: @@ -141,11 +141,11 @@ Style/ClassAndModuleChildren: # documentation of classes in migrations and tests is not needed Style/Documentation: - Exclude: *test_config_db + Exclude: *test_config_db_gemspec_subconfig # allow in auto-generated files Style/GlobalStdStream: - Exclude: *test_config_db + Exclude: *test_config_db_gemspec_subconfig # allow empty parentheses to differentiate method calls vs attributes Style/MethodCallWithoutArgsParentheses: -- GitLab