Skip to content
Snippets Groups Projects
Commit 0ecbe85a authored by Darius Schneider's avatar Darius Schneider
Browse files

better exclusions for gems for Rubocop Metrics department

parent d6ea7bdd
No related branches found
No related tags found
No related merge requests found
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment