rubocop 0.76.0 → 0.83.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -1
- data/README.md +6 -6
- data/config/default.yml +466 -306
- data/lib/rubocop/ast/builder.rb +45 -42
- data/lib/rubocop/ast/node/array_node.rb +13 -0
- data/lib/rubocop/ast/node/block_node.rb +7 -1
- data/lib/rubocop/ast/node/case_match_node.rb +56 -0
- data/lib/rubocop/ast/node/def_node.rb +11 -0
- data/lib/rubocop/ast/node/forward_args_node.rb +18 -0
- data/lib/rubocop/ast/node/mixin/method_dispatch_node.rb +8 -0
- data/lib/rubocop/ast/node/regexp_node.rb +2 -4
- data/lib/rubocop/ast/node/send_node.rb +4 -0
- data/lib/rubocop/ast/node.rb +13 -20
- data/lib/rubocop/ast/traversal.rb +29 -10
- data/lib/rubocop/cli/command/auto_genenerate_config.rb +105 -0
- data/lib/rubocop/cli/command/base.rb +33 -0
- data/lib/rubocop/cli/command/execute_runner.rb +76 -0
- data/lib/rubocop/cli/command/init_dotfile.rb +45 -0
- data/lib/rubocop/cli/command/show_cops.rb +80 -0
- data/lib/rubocop/cli/command/version.rb +17 -0
- data/lib/rubocop/cli/command.rb +21 -0
- data/lib/rubocop/cli/environment.rb +21 -0
- data/lib/rubocop/cli.rb +20 -233
- data/lib/rubocop/comment_config.rb +6 -1
- data/lib/rubocop/config.rb +41 -11
- data/lib/rubocop/config_loader.rb +54 -44
- data/lib/rubocop/config_loader_resolver.rb +28 -1
- data/lib/rubocop/config_obsoletion.rb +67 -11
- data/lib/rubocop/config_validator.rb +74 -99
- data/lib/rubocop/cop/autocorrect_logic.rb +7 -4
- data/lib/rubocop/cop/badge.rb +5 -5
- data/lib/rubocop/cop/bundler/gem_comment.rb +4 -4
- data/lib/rubocop/cop/bundler/insecure_protocol_source.rb +3 -3
- data/lib/rubocop/cop/cop.rb +21 -0
- data/lib/rubocop/cop/corrector.rb +48 -24
- data/lib/rubocop/cop/correctors/alignment_corrector.rb +2 -2
- data/lib/rubocop/cop/correctors/condition_corrector.rb +1 -2
- data/lib/rubocop/cop/correctors/empty_line_corrector.rb +1 -1
- data/lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb +3 -3
- data/lib/rubocop/cop/correctors/line_break_corrector.rb +2 -2
- data/lib/rubocop/cop/correctors/percent_literal_corrector.rb +1 -1
- data/lib/rubocop/cop/correctors/space_corrector.rb +1 -2
- data/lib/rubocop/cop/correctors/string_literal_corrector.rb +2 -2
- data/lib/rubocop/cop/gemspec/ordered_dependencies.rb +1 -1
- data/lib/rubocop/cop/generator/configuration_injector.rb +1 -1
- data/lib/rubocop/cop/generator.rb +6 -6
- data/lib/rubocop/cop/internal_affairs/method_name_equal.rb +59 -0
- data/lib/rubocop/cop/internal_affairs/offense_location_keyword.rb +1 -1
- data/lib/rubocop/cop/internal_affairs.rb +1 -0
- data/lib/rubocop/cop/layout/{align_arguments.rb → argument_alignment.rb} +1 -1
- data/lib/rubocop/cop/layout/array_alignment.rb +82 -0
- data/lib/rubocop/cop/layout/{indent_assignment.rb → assignment_indentation.rb} +1 -1
- data/lib/rubocop/cop/layout/block_end_newline.rb +5 -3
- data/lib/rubocop/cop/layout/condition_position.rb +12 -2
- data/lib/rubocop/cop/layout/dot_position.rb +1 -1
- data/lib/rubocop/cop/layout/else_alignment.rb +8 -0
- data/lib/rubocop/cop/layout/empty_line_between_defs.rb +2 -1
- data/lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb +68 -0
- data/lib/rubocop/cop/layout/end_of_line.rb +2 -2
- data/lib/rubocop/cop/layout/extra_spacing.rb +1 -1
- data/lib/rubocop/cop/layout/{indent_first_argument.rb → first_argument_indentation.rb} +5 -5
- data/lib/rubocop/cop/layout/{indent_first_array_element.rb → first_array_element_indentation.rb} +20 -14
- data/lib/rubocop/cop/layout/{indent_first_hash_element.rb → first_hash_element_indentation.rb} +4 -4
- data/lib/rubocop/cop/layout/{indent_first_parameter.rb → first_parameter_indentation.rb} +3 -3
- data/lib/rubocop/cop/layout/{align_hash.rb → hash_alignment.rb} +10 -6
- data/lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb +2 -2
- data/lib/rubocop/cop/layout/{indent_heredoc.rb → heredoc_indentation.rb} +7 -7
- data/lib/rubocop/cop/layout/{tab.rb → indentation_style.rb} +48 -6
- data/lib/rubocop/cop/layout/leading_comment_space.rb +34 -3
- data/lib/rubocop/cop/layout/{leading_blank_lines.rb → leading_empty_lines.rb} +1 -1
- data/lib/rubocop/cop/{metrics → layout}/line_length.rb +72 -110
- data/lib/rubocop/cop/layout/multiline_block_layout.rb +15 -6
- data/lib/rubocop/cop/layout/multiline_hash_brace_layout.rb +0 -4
- data/lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb +1 -1
- data/lib/rubocop/cop/layout/multiline_method_call_indentation.rb +1 -1
- data/lib/rubocop/cop/layout/multiline_operation_indentation.rb +13 -4
- data/lib/rubocop/cop/layout/{align_parameters.rb → parameter_alignment.rb} +1 -1
- data/lib/rubocop/cop/layout/space_around_block_parameters.rb +3 -3
- data/lib/rubocop/cop/layout/space_around_keyword.rb +12 -0
- data/lib/rubocop/cop/layout/space_around_method_call_operator.rb +133 -0
- data/lib/rubocop/cop/layout/space_around_operators.rb +69 -9
- data/lib/rubocop/cop/layout/space_before_block_braces.rb +17 -0
- data/lib/rubocop/cop/layout/space_before_first_arg.rb +8 -0
- data/lib/rubocop/cop/layout/space_in_lambda_literal.rb +1 -1
- data/lib/rubocop/cop/layout/space_inside_block_braces.rb +2 -2
- data/lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb +2 -9
- data/lib/rubocop/cop/layout/space_inside_range_literal.rb +2 -2
- data/lib/rubocop/cop/layout/{trailing_blank_lines.rb → trailing_empty_lines.rb} +1 -1
- data/lib/rubocop/cop/layout/trailing_whitespace.rb +2 -2
- data/lib/rubocop/cop/lint/ambiguous_operator.rb +38 -0
- data/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb +14 -0
- data/lib/rubocop/cop/lint/boolean_symbol.rb +12 -0
- data/lib/rubocop/cop/lint/debugger.rb +2 -2
- data/lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb +1 -1
- data/lib/rubocop/cop/lint/{duplicated_key.rb → duplicate_hash_key.rb} +1 -1
- data/lib/rubocop/cop/lint/duplicate_methods.rb +1 -5
- data/lib/rubocop/cop/lint/each_with_object_argument.rb +1 -1
- data/lib/rubocop/cop/lint/empty_when.rb +29 -6
- data/lib/rubocop/cop/lint/ensure_return.rb +18 -1
- data/lib/rubocop/cop/lint/erb_new_arguments.rb +1 -1
- data/lib/rubocop/cop/lint/implicit_string_concatenation.rb +1 -1
- data/lib/rubocop/cop/lint/ineffective_access_modifier.rb +1 -1
- data/lib/rubocop/cop/lint/inherit_exception.rb +1 -1
- data/lib/rubocop/cop/lint/interpolation_check.rb +1 -1
- data/lib/rubocop/cop/lint/literal_as_condition.rb +10 -13
- data/lib/rubocop/cop/lint/literal_in_interpolation.rb +1 -1
- data/lib/rubocop/cop/lint/loop.rb +6 -4
- data/lib/rubocop/cop/lint/{multiple_compare.rb → multiple_comparison.rb} +2 -2
- data/lib/rubocop/cop/lint/nested_method_definition.rb +2 -2
- data/lib/rubocop/cop/lint/non_deterministic_require_order.rb +89 -0
- data/lib/rubocop/cop/lint/number_conversion.rb +1 -1
- data/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb +21 -9
- data/lib/rubocop/cop/lint/percent_string_array.rb +2 -2
- data/lib/rubocop/cop/lint/raise_exception.rb +75 -0
- data/lib/rubocop/cop/lint/redundant_cop_disable_directive.rb +4 -9
- data/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb +13 -8
- data/lib/rubocop/cop/lint/redundant_splat_expansion.rb +1 -1
- data/lib/rubocop/cop/lint/{string_conversion_in_interpolation.rb → redundant_string_coercion.rb} +2 -2
- data/lib/rubocop/cop/lint/redundant_with_index.rb +2 -2
- data/lib/rubocop/cop/lint/redundant_with_object.rb +2 -2
- data/lib/rubocop/cop/lint/safe_navigation_chain.rb +1 -1
- data/lib/rubocop/cop/lint/struct_new_override.rb +58 -0
- data/lib/rubocop/cop/lint/{handle_exceptions.rb → suppressed_exception.rb} +13 -29
- data/lib/rubocop/cop/lint/unified_integer.rb +0 -2
- data/lib/rubocop/cop/lint/unused_method_argument.rb +32 -6
- data/lib/rubocop/cop/lint/uri_regexp.rb +4 -4
- data/lib/rubocop/cop/lint/useless_access_modifier.rb +69 -23
- data/lib/rubocop/cop/lint/useless_assignment.rb +3 -2
- data/lib/rubocop/cop/lint/useless_else_without_rescue.rb +5 -0
- data/lib/rubocop/cop/lint/useless_setter_call.rb +5 -1
- data/lib/rubocop/cop/metrics/method_length.rb +1 -1
- data/lib/rubocop/cop/migration/department_name.rb +47 -6
- data/lib/rubocop/cop/mixin/alignment.rb +1 -1
- data/lib/rubocop/cop/mixin/configurable_enforced_style.rb +4 -0
- data/lib/rubocop/cop/mixin/end_keyword_alignment.rb +6 -1
- data/lib/rubocop/cop/mixin/frozen_string_literal.rb +14 -5
- data/lib/rubocop/cop/mixin/{hash_alignment.rb → hash_alignment_styles.rb} +1 -1
- data/lib/rubocop/cop/mixin/hash_transform_method.rb +178 -0
- data/lib/rubocop/cop/mixin/line_length_help.rb +89 -0
- data/lib/rubocop/cop/mixin/method_complexity.rb +5 -0
- data/lib/rubocop/cop/mixin/nil_methods.rb +4 -4
- data/lib/rubocop/cop/mixin/parser_diagnostic.rb +1 -1
- data/lib/rubocop/cop/mixin/rational_literal.rb +18 -0
- data/lib/rubocop/cop/mixin/statement_modifier.rb +9 -24
- data/lib/rubocop/cop/mixin/target_ruby_version.rb +5 -1
- data/lib/rubocop/cop/mixin/trailing_comma.rb +9 -13
- data/lib/rubocop/cop/naming/{uncommunicative_block_param_name.rb → block_parameter_name.rb} +3 -3
- data/lib/rubocop/cop/naming/class_and_module_camel_case.rb +1 -1
- data/lib/rubocop/cop/naming/constant_name.rb +2 -1
- data/lib/rubocop/cop/naming/heredoc_delimiter_naming.rb +6 -6
- data/lib/rubocop/cop/naming/memoized_instance_variable_name.rb +1 -1
- data/lib/rubocop/cop/naming/method_name.rb +26 -0
- data/lib/rubocop/cop/naming/{uncommunicative_method_param_name.rb → method_parameter_name.rb} +4 -4
- data/lib/rubocop/cop/naming/predicate_name.rb +6 -6
- data/lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb +1 -1
- data/lib/rubocop/cop/offense.rb +11 -0
- data/lib/rubocop/cop/registry.rb +15 -3
- data/lib/rubocop/cop/style/access_modifier_declarations.rb +26 -6
- data/lib/rubocop/cop/style/alias.rb +5 -5
- data/lib/rubocop/cop/style/and_or.rb +5 -6
- data/lib/rubocop/cop/style/array_join.rb +2 -2
- data/lib/rubocop/cop/style/attr.rb +8 -0
- data/lib/rubocop/cop/style/block_delimiters.rb +60 -1
- data/lib/rubocop/cop/style/case_equality.rb +24 -1
- data/lib/rubocop/cop/style/character_literal.rb +2 -2
- data/lib/rubocop/cop/style/collection_methods.rb +2 -0
- data/lib/rubocop/cop/style/conditional_assignment.rb +10 -10
- data/lib/rubocop/cop/style/copyright.rb +1 -1
- data/lib/rubocop/cop/style/dir.rb +1 -1
- data/lib/rubocop/cop/style/disable_cops_within_source_code_directive.rb +49 -0
- data/lib/rubocop/cop/style/documentation.rb +43 -5
- data/lib/rubocop/cop/style/double_cop_disable_directive.rb +1 -1
- data/lib/rubocop/cop/style/each_for_simple_loop.rb +1 -1
- data/lib/rubocop/cop/style/each_with_object.rb +3 -3
- data/lib/rubocop/cop/style/empty_method.rb +1 -5
- data/lib/rubocop/cop/style/end_block.rb +6 -0
- data/lib/rubocop/cop/style/eval_with_location.rb +1 -1
- data/lib/rubocop/cop/style/even_odd.rb +2 -2
- data/lib/rubocop/cop/style/expand_path_arguments.rb +3 -3
- data/lib/rubocop/cop/style/exponential_notation.rb +119 -0
- data/lib/rubocop/cop/style/format_string.rb +2 -2
- data/lib/rubocop/cop/style/frozen_string_literal_comment.rb +89 -11
- data/lib/rubocop/cop/style/guard_clause.rb +28 -4
- data/lib/rubocop/cop/style/hash_each_methods.rb +89 -0
- data/lib/rubocop/cop/style/hash_syntax.rb +3 -5
- data/lib/rubocop/cop/style/hash_transform_keys.rb +83 -0
- data/lib/rubocop/cop/style/hash_transform_values.rb +80 -0
- data/lib/rubocop/cop/style/if_unless_modifier.rb +61 -6
- data/lib/rubocop/cop/style/if_with_semicolon.rb +16 -0
- data/lib/rubocop/cop/style/infinite_loop.rb +1 -1
- data/lib/rubocop/cop/style/inverse_methods.rb +9 -5
- data/lib/rubocop/cop/style/ip_addresses.rb +4 -4
- data/lib/rubocop/cop/style/lambda.rb +3 -2
- data/lib/rubocop/cop/style/lambda_call.rb +1 -21
- data/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb +169 -0
- data/lib/rubocop/cop/style/method_call_with_args_parentheses/require_parentheses.rb +54 -0
- data/lib/rubocop/cop/style/method_call_with_args_parentheses.rb +7 -205
- data/lib/rubocop/cop/style/mixin_grouping.rb +2 -2
- data/lib/rubocop/cop/style/module_function.rb +58 -12
- data/lib/rubocop/cop/style/multiline_if_modifier.rb +1 -1
- data/lib/rubocop/cop/style/multiline_memoization.rb +1 -1
- data/lib/rubocop/cop/style/multiline_method_signature.rb +1 -1
- data/lib/rubocop/cop/style/multiline_when_then.rb +21 -2
- data/lib/rubocop/cop/style/mutable_constant.rb +2 -4
- data/lib/rubocop/cop/style/nested_parenthesized_calls.rb +9 -9
- data/lib/rubocop/cop/style/next.rb +7 -7
- data/lib/rubocop/cop/style/nil_comparison.rb +1 -1
- data/lib/rubocop/cop/style/non_nil_check.rb +4 -4
- data/lib/rubocop/cop/style/not.rb +1 -1
- data/lib/rubocop/cop/style/numeric_literal_prefix.rb +1 -1
- data/lib/rubocop/cop/style/numeric_literals.rb +8 -4
- data/lib/rubocop/cop/style/numeric_predicate.rb +5 -4
- data/lib/rubocop/cop/style/one_line_conditional.rb +4 -3
- data/lib/rubocop/cop/style/option_hash.rb +3 -3
- data/lib/rubocop/cop/style/optional_arguments.rb +1 -1
- data/lib/rubocop/cop/style/or_assignment.rb +4 -3
- data/lib/rubocop/cop/style/percent_literal_delimiters.rb +7 -7
- data/lib/rubocop/cop/style/percent_q_literals.rb +1 -1
- data/lib/rubocop/cop/style/perl_backrefs.rb +2 -2
- data/lib/rubocop/cop/style/proc.rb +1 -1
- data/lib/rubocop/cop/style/raise_args.rb +1 -1
- data/lib/rubocop/cop/style/random_with_offset.rb +3 -3
- data/lib/rubocop/cop/style/redundant_condition.rb +18 -6
- data/lib/rubocop/cop/style/redundant_conditional.rb +1 -1
- data/lib/rubocop/cop/style/redundant_exception.rb +3 -3
- data/lib/rubocop/cop/style/redundant_interpolation.rb +2 -2
- data/lib/rubocop/cop/style/redundant_parentheses.rb +3 -3
- data/lib/rubocop/cop/style/redundant_percent_q.rb +2 -2
- data/lib/rubocop/cop/style/redundant_return.rb +7 -15
- data/lib/rubocop/cop/style/redundant_self.rb +1 -1
- data/lib/rubocop/cop/style/redundant_sort.rb +3 -3
- data/lib/rubocop/cop/style/rescue_modifier.rb +1 -1
- data/lib/rubocop/cop/style/return_nil.rb +1 -1
- data/lib/rubocop/cop/style/safe_navigation.rb +1 -1
- data/lib/rubocop/cop/style/self_assignment.rb +1 -1
- data/lib/rubocop/cop/style/slicing_with_range.rb +39 -0
- data/lib/rubocop/cop/style/special_global_vars.rb +1 -1
- data/lib/rubocop/cop/style/stabby_lambda_parentheses.rb +1 -4
- data/lib/rubocop/cop/style/string_hash_keys.rb +1 -1
- data/lib/rubocop/cop/style/symbol_array.rb +3 -3
- data/lib/rubocop/cop/style/symbol_literal.rb +2 -2
- data/lib/rubocop/cop/style/ternary_parentheses.rb +2 -3
- data/lib/rubocop/cop/style/trailing_comma_in_arguments.rb +35 -22
- data/lib/rubocop/cop/style/trailing_comma_in_array_literal.rb +41 -0
- data/lib/rubocop/cop/style/trailing_comma_in_block_args.rb +88 -0
- data/lib/rubocop/cop/style/trailing_comma_in_hash_literal.rb +44 -0
- data/lib/rubocop/cop/style/trailing_underscore_variable.rb +7 -1
- data/lib/rubocop/cop/style/trivial_accessors.rb +6 -6
- data/lib/rubocop/cop/style/unpack_first.rb +0 -4
- data/lib/rubocop/cop/style/variable_interpolation.rb +1 -1
- data/lib/rubocop/cop/style/while_until_modifier.rb +2 -2
- data/lib/rubocop/cop/style/word_array.rb +1 -1
- data/lib/rubocop/cop/style/yoda_condition.rb +16 -1
- data/lib/rubocop/cop/style/zero_length_predicate.rb +1 -1
- data/lib/rubocop/cop/team.rb +5 -0
- data/lib/rubocop/cop/util.rb +24 -0
- data/lib/rubocop/cop/variable_force/assignment.rb +1 -0
- data/lib/rubocop/cop/variable_force/scope.rb +1 -0
- data/lib/rubocop/cop/variable_force/variable.rb +1 -0
- data/lib/rubocop/cop/variable_force.rb +4 -1
- data/lib/rubocop/formatter/base_formatter.rb +2 -2
- data/lib/rubocop/formatter/clang_style_formatter.rb +0 -2
- data/lib/rubocop/formatter/formatter_set.rb +1 -1
- data/lib/rubocop/formatter/json_formatter.rb +6 -5
- data/lib/rubocop/formatter/junit_formatter.rb +74 -0
- data/lib/rubocop/formatter/pacman_formatter.rb +1 -1
- data/lib/rubocop/formatter/tap_formatter.rb +0 -2
- data/lib/rubocop/name_similarity.rb +12 -9
- data/lib/rubocop/node_pattern.rb +97 -11
- data/lib/rubocop/options.rb +26 -13
- data/lib/rubocop/processed_source.rb +1 -4
- data/lib/rubocop/rake_task.rb +1 -0
- data/lib/rubocop/result_cache.rb +23 -7
- data/lib/rubocop/rspec/cop_helper.rb +1 -1
- data/lib/rubocop/rspec/expect_offense.rb +1 -1
- data/lib/rubocop/rspec/shared_contexts.rb +5 -4
- data/lib/rubocop/runner.rb +25 -4
- data/lib/rubocop/target_finder.rb +6 -4
- data/lib/rubocop/target_ruby.rb +151 -0
- data/lib/rubocop/version.rb +1 -1
- data/lib/rubocop.rb +53 -27
- metadata +73 -48
- data/lib/rubocop/cop/layout/align_array.rb +0 -39
- data/lib/rubocop/cop/lint/end_in_method.rb +0 -40
- data/lib/rubocop/cop/mixin/safe_mode.rb +0 -24
- data/lib/rubocop/cop/style/braces_around_hash_parameters.rb +0 -209
- data/lib/rubocop/formatter/disabled_lines_formatter.rb +0 -57
- data/lib/rubocop/string_util.rb +0 -14
data/config/default.yml
CHANGED
@@ -35,6 +35,7 @@ AllCops:
|
|
35
35
|
- '**/*.watchr'
|
36
36
|
- '**/.irbrc'
|
37
37
|
- '**/.pryrc'
|
38
|
+
- '**/.simplecov'
|
38
39
|
- '**/buildfile'
|
39
40
|
- '**/Appraisals'
|
40
41
|
- '**/Berksfile'
|
@@ -53,12 +54,15 @@ AllCops:
|
|
53
54
|
- '**/Podfile'
|
54
55
|
- '**/Puppetfile'
|
55
56
|
- '**/Rakefile'
|
57
|
+
- '**/rakefile'
|
56
58
|
- '**/Snapfile'
|
59
|
+
- '**/Steepfile'
|
57
60
|
- '**/Thorfile'
|
58
61
|
- '**/Vagabondfile'
|
59
62
|
- '**/Vagrantfile'
|
60
63
|
Exclude:
|
61
64
|
- 'node_modules/**/*'
|
65
|
+
- 'tmp/**/*'
|
62
66
|
- 'vendor/**/*'
|
63
67
|
- '.git/**/*'
|
64
68
|
# Default formatter will be used if no `-f/--format` option is given.
|
@@ -95,6 +99,14 @@ AllCops:
|
|
95
99
|
# to true in the same configuration.
|
96
100
|
EnabledByDefault: false
|
97
101
|
DisabledByDefault: false
|
102
|
+
# New cops introduced between major versions are set to a special pending status
|
103
|
+
# and are not enabled by default with warning message.
|
104
|
+
# Change this behavior by overriding either `NewCops: enable` or `NewCops: disable`.
|
105
|
+
# When `NewCops` is `enable`, pending cops are enabled in bulk. Can be overridden by
|
106
|
+
# the `--enable-pending-cops` command-line option.
|
107
|
+
# When `NewCops` is `disable`, pending cops are disabled in bulk. Can be overridden by
|
108
|
+
# the `--disable-pending-cops` command-line option.
|
109
|
+
NewCops: pending
|
98
110
|
# Enables the result cache if `true`. Can be overridden by the `--cache` command
|
99
111
|
# line option.
|
100
112
|
UseCache: true
|
@@ -123,7 +135,7 @@ AllCops:
|
|
123
135
|
# followed by the Gemfile.lock or gems.locked file. (Although the Ruby version
|
124
136
|
# is specified in the Gemfile or gems.rb file, RuboCop reads the final value
|
125
137
|
# from the lock file.) If the Ruby version is still unresolved, RuboCop will
|
126
|
-
# use the oldest officially supported Ruby version (currently Ruby 2.
|
138
|
+
# use the oldest officially supported Ruby version (currently Ruby 2.4).
|
127
139
|
TargetRubyVersion: ~
|
128
140
|
|
129
141
|
#################### Bundler ###############################
|
@@ -141,11 +153,12 @@ Bundler/GemComment:
|
|
141
153
|
Description: 'Add a comment describing each gem.'
|
142
154
|
Enabled: false
|
143
155
|
VersionAdded: '0.59'
|
156
|
+
VersionChanged: '0.77'
|
144
157
|
Include:
|
145
158
|
- '**/*.gemfile'
|
146
159
|
- '**/Gemfile'
|
147
160
|
- '**/gems.rb'
|
148
|
-
|
161
|
+
IgnoredGems: []
|
149
162
|
|
150
163
|
Bundler/InsecureProtocolSource:
|
151
164
|
Description: >-
|
@@ -195,9 +208,10 @@ Gemspec/RequiredRubyVersion:
|
|
195
208
|
VersionAdded: '0.52'
|
196
209
|
Include:
|
197
210
|
- '**/*.gemspec'
|
198
|
-
|
211
|
+
|
199
212
|
Gemspec/RubyVersionGlobalsUsage:
|
200
213
|
Description: Checks usage of RUBY_VERSION in gemspec.
|
214
|
+
StyleGuide: '#no-ruby-version-in-the-gemspec'
|
201
215
|
Enabled: true
|
202
216
|
VersionAdded: '0.72'
|
203
217
|
Include:
|
@@ -218,13 +232,14 @@ Layout/AccessModifierIndentation:
|
|
218
232
|
# But it can be overridden by setting this parameter
|
219
233
|
IndentationWidth: ~
|
220
234
|
|
221
|
-
Layout/
|
235
|
+
Layout/ArgumentAlignment:
|
222
236
|
Description: >-
|
223
237
|
Align the arguments of a method call if they span more
|
224
238
|
than one line.
|
225
239
|
StyleGuide: '#no-double-indent'
|
226
240
|
Enabled: true
|
227
241
|
VersionAdded: '0.68'
|
242
|
+
VersionChanged: '0.77'
|
228
243
|
# Alignment of arguments in multi-line method calls.
|
229
244
|
#
|
230
245
|
# The `with_first_argument` style aligns the following lines along the same
|
@@ -246,120 +261,46 @@ Layout/AlignArguments:
|
|
246
261
|
# But it can be overridden by setting this parameter
|
247
262
|
IndentationWidth: ~
|
248
263
|
|
249
|
-
Layout/
|
264
|
+
Layout/ArrayAlignment:
|
250
265
|
Description: >-
|
251
266
|
Align the elements of an array literal if they span more than
|
252
267
|
one line.
|
253
|
-
StyleGuide: '#align-multiline-arrays'
|
254
|
-
Enabled: true
|
255
|
-
VersionAdded: '0.49'
|
256
|
-
|
257
|
-
Layout/AlignHash:
|
258
|
-
Description: >-
|
259
|
-
Align the elements of a hash literal if they span more than
|
260
|
-
one line.
|
261
|
-
Enabled: true
|
262
|
-
AllowMultipleStyles: true
|
263
|
-
VersionAdded: '0.49'
|
264
|
-
# Alignment of entries using hash rocket as separator. Valid values are:
|
265
|
-
#
|
266
|
-
# key - left alignment of keys
|
267
|
-
# 'a' => 2
|
268
|
-
# 'bb' => 3
|
269
|
-
# separator - alignment of hash rockets, keys are right aligned
|
270
|
-
# 'a' => 2
|
271
|
-
# 'bb' => 3
|
272
|
-
# table - left alignment of keys, hash rockets, and values
|
273
|
-
# 'a' => 2
|
274
|
-
# 'bb' => 3
|
275
|
-
EnforcedHashRocketStyle: key
|
276
|
-
SupportedHashRocketStyles:
|
277
|
-
- key
|
278
|
-
- separator
|
279
|
-
- table
|
280
|
-
# Alignment of entries using colon as separator. Valid values are:
|
281
|
-
#
|
282
|
-
# key - left alignment of keys
|
283
|
-
# a: 0
|
284
|
-
# bb: 1
|
285
|
-
# separator - alignment of colons, keys are right aligned
|
286
|
-
# a: 0
|
287
|
-
# bb: 1
|
288
|
-
# table - left alignment of keys and values
|
289
|
-
# a: 0
|
290
|
-
# bb: 1
|
291
|
-
EnforcedColonStyle: key
|
292
|
-
SupportedColonStyles:
|
293
|
-
- key
|
294
|
-
- separator
|
295
|
-
- table
|
296
|
-
# Select whether hashes that are the last argument in a method call should be
|
297
|
-
# inspected? Valid values are:
|
298
|
-
#
|
299
|
-
# always_inspect - Inspect both implicit and explicit hashes.
|
300
|
-
# Registers an offense for:
|
301
|
-
# function(a: 1,
|
302
|
-
# b: 2)
|
303
|
-
# Registers an offense for:
|
304
|
-
# function({a: 1,
|
305
|
-
# b: 2})
|
306
|
-
# always_ignore - Ignore both implicit and explicit hashes.
|
307
|
-
# Accepts:
|
308
|
-
# function(a: 1,
|
309
|
-
# b: 2)
|
310
|
-
# Accepts:
|
311
|
-
# function({a: 1,
|
312
|
-
# b: 2})
|
313
|
-
# ignore_implicit - Ignore only implicit hashes.
|
314
|
-
# Accepts:
|
315
|
-
# function(a: 1,
|
316
|
-
# b: 2)
|
317
|
-
# Registers an offense for:
|
318
|
-
# function({a: 1,
|
319
|
-
# b: 2})
|
320
|
-
# ignore_explicit - Ignore only explicit hashes.
|
321
|
-
# Accepts:
|
322
|
-
# function({a: 1,
|
323
|
-
# b: 2})
|
324
|
-
# Registers an offense for:
|
325
|
-
# function(a: 1,
|
326
|
-
# b: 2)
|
327
|
-
EnforcedLastArgumentHashStyle: always_inspect
|
328
|
-
SupportedLastArgumentHashStyles:
|
329
|
-
- always_inspect
|
330
|
-
- always_ignore
|
331
|
-
- ignore_implicit
|
332
|
-
- ignore_explicit
|
333
|
-
|
334
|
-
Layout/AlignParameters:
|
335
|
-
Description: >-
|
336
|
-
Align the parameters of a method definition if they span more
|
337
|
-
than one line.
|
338
268
|
StyleGuide: '#no-double-indent'
|
339
269
|
Enabled: true
|
340
270
|
VersionAdded: '0.49'
|
341
|
-
VersionChanged: '0.
|
342
|
-
# Alignment of
|
271
|
+
VersionChanged: '0.77'
|
272
|
+
# Alignment of elements of a multi-line array.
|
343
273
|
#
|
344
274
|
# The `with_first_parameter` style aligns the following lines along the same
|
345
|
-
# column as the first
|
275
|
+
# column as the first element.
|
346
276
|
#
|
347
|
-
#
|
348
|
-
#
|
277
|
+
# array = [1, 2, 3,
|
278
|
+
# 4, 5, 6]
|
349
279
|
#
|
350
280
|
# The `with_fixed_indentation` style aligns the following lines with one
|
351
|
-
# level of indentation relative to the start of the line with
|
281
|
+
# level of indentation relative to the start of the line with start of array.
|
352
282
|
#
|
353
|
-
#
|
354
|
-
#
|
355
|
-
EnforcedStyle:
|
283
|
+
# array = [1, 2, 3,
|
284
|
+
# 4, 5, 6]
|
285
|
+
EnforcedStyle: with_first_element
|
356
286
|
SupportedStyles:
|
357
|
-
-
|
287
|
+
- with_first_element
|
358
288
|
- with_fixed_indentation
|
359
289
|
# By default, the indentation width from Layout/IndentationWidth is used
|
360
290
|
# But it can be overridden by setting this parameter
|
361
291
|
IndentationWidth: ~
|
362
292
|
|
293
|
+
Layout/AssignmentIndentation:
|
294
|
+
Description: >-
|
295
|
+
Checks the indentation of the first line of the
|
296
|
+
right-hand-side of a multi-line assignment.
|
297
|
+
Enabled: true
|
298
|
+
VersionAdded: '0.49'
|
299
|
+
VersionChanged: '0.77'
|
300
|
+
# By default, the indentation width from `Layout/IndentationWidth` is used
|
301
|
+
# But it can be overridden by setting this parameter
|
302
|
+
IndentationWidth: ~
|
303
|
+
|
363
304
|
Layout/BlockAlignment:
|
364
305
|
Description: 'Align block ends correctly.'
|
365
306
|
Enabled: true
|
@@ -436,6 +377,7 @@ Layout/ConditionPosition:
|
|
436
377
|
StyleGuide: '#same-line-condition'
|
437
378
|
Enabled: true
|
438
379
|
VersionAdded: '0.53'
|
380
|
+
VersionChanged: '0.83'
|
439
381
|
|
440
382
|
Layout/DefEndAlignment:
|
441
383
|
Description: 'Align ends corresponding to defs correctly.'
|
@@ -521,6 +463,12 @@ Layout/EmptyLinesAroundArguments:
|
|
521
463
|
Enabled: true
|
522
464
|
VersionAdded: '0.52'
|
523
465
|
|
466
|
+
Layout/EmptyLinesAroundAttributeAccessor:
|
467
|
+
Description: "Keep blank lines around attribute accessors."
|
468
|
+
StyleGuide: '#empty-lines-around-attribute-accessor'
|
469
|
+
Enabled: pending
|
470
|
+
VersionAdded: '0.83'
|
471
|
+
|
524
472
|
Layout/EmptyLinesAroundBeginBody:
|
525
473
|
Description: "Keeps track of empty lines around begin-end bodies."
|
526
474
|
StyleGuide: '#empty-lines-around-bodies'
|
@@ -624,56 +572,11 @@ Layout/ExtraSpacing:
|
|
624
572
|
# When true, forces the alignment of `=` in assignments on consecutive lines.
|
625
573
|
ForceEqualSignAlignment: false
|
626
574
|
|
627
|
-
Layout/
|
628
|
-
Description: >-
|
629
|
-
Checks for a line break before the first element in a
|
630
|
-
multi-line array.
|
631
|
-
Enabled: false
|
632
|
-
VersionAdded: '0.49'
|
633
|
-
|
634
|
-
Layout/FirstHashElementLineBreak:
|
635
|
-
Description: >-
|
636
|
-
Checks for a line break before the first element in a
|
637
|
-
multi-line hash.
|
638
|
-
Enabled: false
|
639
|
-
VersionAdded: '0.49'
|
640
|
-
|
641
|
-
Layout/FirstMethodArgumentLineBreak:
|
642
|
-
Description: >-
|
643
|
-
Checks for a line break before the first argument in a
|
644
|
-
multi-line method call.
|
645
|
-
Enabled: false
|
646
|
-
VersionAdded: '0.49'
|
647
|
-
|
648
|
-
Layout/FirstMethodParameterLineBreak:
|
649
|
-
Description: >-
|
650
|
-
Checks for a line break before the first parameter in a
|
651
|
-
multi-line method parameter definition.
|
652
|
-
Enabled: false
|
653
|
-
VersionAdded: '0.49'
|
654
|
-
|
655
|
-
Layout/HeredocArgumentClosingParenthesis:
|
656
|
-
Description: >-
|
657
|
-
Checks for the placement of the closing parenthesis in a
|
658
|
-
method call that passes a HEREDOC string as an argument.
|
659
|
-
Enabled: false
|
660
|
-
StyleGuide: '#heredoc-argument-closing-parentheses'
|
661
|
-
VersionAdded: '0.68'
|
662
|
-
|
663
|
-
Layout/IndentAssignment:
|
664
|
-
Description: >-
|
665
|
-
Checks the indentation of the first line of the
|
666
|
-
right-hand-side of a multi-line assignment.
|
667
|
-
Enabled: true
|
668
|
-
VersionAdded: '0.49'
|
669
|
-
# By default, the indentation width from `Layout/IndentationWidth` is used
|
670
|
-
# But it can be overridden by setting this parameter
|
671
|
-
IndentationWidth: ~
|
672
|
-
|
673
|
-
Layout/IndentFirstArgument:
|
575
|
+
Layout/FirstArgumentIndentation:
|
674
576
|
Description: 'Checks the indentation of the first argument in a method call.'
|
675
577
|
Enabled: true
|
676
578
|
VersionAdded: '0.68'
|
579
|
+
VersionChanged: '0.77'
|
677
580
|
EnforcedStyle: special_for_inner_method_call_in_parentheses
|
678
581
|
SupportedStyles:
|
679
582
|
# The first parameter should always be indented one step more than the
|
@@ -694,12 +597,13 @@ Layout/IndentFirstArgument:
|
|
694
597
|
# But it can be overridden by setting this parameter
|
695
598
|
IndentationWidth: ~
|
696
599
|
|
697
|
-
Layout/
|
600
|
+
Layout/FirstArrayElementIndentation:
|
698
601
|
Description: >-
|
699
602
|
Checks the indentation of the first element in an array
|
700
603
|
literal.
|
701
604
|
Enabled: true
|
702
605
|
VersionAdded: '0.68'
|
606
|
+
VersionChanged: '0.77'
|
703
607
|
# The value `special_inside_parentheses` means that array literals with
|
704
608
|
# brackets that have their opening bracket on the same line as a surrounding
|
705
609
|
# opening round parenthesis, shall have their first element indented relative
|
@@ -720,10 +624,18 @@ Layout/IndentFirstArrayElement:
|
|
720
624
|
# But it can be overridden by setting this parameter
|
721
625
|
IndentationWidth: ~
|
722
626
|
|
723
|
-
Layout/
|
627
|
+
Layout/FirstArrayElementLineBreak:
|
628
|
+
Description: >-
|
629
|
+
Checks for a line break before the first element in a
|
630
|
+
multi-line array.
|
631
|
+
Enabled: false
|
632
|
+
VersionAdded: '0.49'
|
633
|
+
|
634
|
+
Layout/FirstHashElementIndentation:
|
724
635
|
Description: 'Checks the indentation of the first key in a hash literal.'
|
725
636
|
Enabled: true
|
726
637
|
VersionAdded: '0.68'
|
638
|
+
VersionChanged: '0.77'
|
727
639
|
# The value `special_inside_parentheses` means that hash literals with braces
|
728
640
|
# that have their opening brace on the same line as a surrounding opening
|
729
641
|
# round parenthesis, shall have their first key indented relative to the
|
@@ -744,13 +656,34 @@ Layout/IndentFirstHashElement:
|
|
744
656
|
# But it can be overridden by setting this parameter
|
745
657
|
IndentationWidth: ~
|
746
658
|
|
747
|
-
Layout/
|
659
|
+
Layout/FirstHashElementLineBreak:
|
660
|
+
Description: >-
|
661
|
+
Checks for a line break before the first element in a
|
662
|
+
multi-line hash.
|
663
|
+
Enabled: false
|
664
|
+
VersionAdded: '0.49'
|
665
|
+
|
666
|
+
Layout/FirstMethodArgumentLineBreak:
|
667
|
+
Description: >-
|
668
|
+
Checks for a line break before the first argument in a
|
669
|
+
multi-line method call.
|
670
|
+
Enabled: false
|
671
|
+
VersionAdded: '0.49'
|
672
|
+
|
673
|
+
Layout/FirstMethodParameterLineBreak:
|
674
|
+
Description: >-
|
675
|
+
Checks for a line break before the first parameter in a
|
676
|
+
multi-line method parameter definition.
|
677
|
+
Enabled: false
|
678
|
+
VersionAdded: '0.49'
|
679
|
+
|
680
|
+
Layout/FirstParameterIndentation:
|
748
681
|
Description: >-
|
749
682
|
Checks the indentation of the first parameter in a
|
750
683
|
method definition.
|
751
684
|
Enabled: true
|
752
685
|
VersionAdded: '0.49'
|
753
|
-
VersionChanged: '0.
|
686
|
+
VersionChanged: '0.77'
|
754
687
|
EnforcedStyle: consistent
|
755
688
|
SupportedStyles:
|
756
689
|
- consistent
|
@@ -759,12 +692,98 @@ Layout/IndentFirstParameter:
|
|
759
692
|
# But it can be overridden by setting this parameter
|
760
693
|
IndentationWidth: ~
|
761
694
|
|
762
|
-
Layout/
|
695
|
+
Layout/HashAlignment:
|
696
|
+
Description: >-
|
697
|
+
Align the elements of a hash literal if they span more than
|
698
|
+
one line.
|
699
|
+
Enabled: true
|
700
|
+
AllowMultipleStyles: true
|
701
|
+
VersionAdded: '0.49'
|
702
|
+
VersionChanged: '0.77'
|
703
|
+
# Alignment of entries using hash rocket as separator. Valid values are:
|
704
|
+
#
|
705
|
+
# key - left alignment of keys
|
706
|
+
# 'a' => 2
|
707
|
+
# 'bb' => 3
|
708
|
+
# separator - alignment of hash rockets, keys are right aligned
|
709
|
+
# 'a' => 2
|
710
|
+
# 'bb' => 3
|
711
|
+
# table - left alignment of keys, hash rockets, and values
|
712
|
+
# 'a' => 2
|
713
|
+
# 'bb' => 3
|
714
|
+
EnforcedHashRocketStyle: key
|
715
|
+
SupportedHashRocketStyles:
|
716
|
+
- key
|
717
|
+
- separator
|
718
|
+
- table
|
719
|
+
# Alignment of entries using colon as separator. Valid values are:
|
720
|
+
#
|
721
|
+
# key - left alignment of keys
|
722
|
+
# a: 0
|
723
|
+
# bb: 1
|
724
|
+
# separator - alignment of colons, keys are right aligned
|
725
|
+
# a: 0
|
726
|
+
# bb: 1
|
727
|
+
# table - left alignment of keys and values
|
728
|
+
# a: 0
|
729
|
+
# bb: 1
|
730
|
+
EnforcedColonStyle: key
|
731
|
+
SupportedColonStyles:
|
732
|
+
- key
|
733
|
+
- separator
|
734
|
+
- table
|
735
|
+
# Select whether hashes that are the last argument in a method call should be
|
736
|
+
# inspected? Valid values are:
|
737
|
+
#
|
738
|
+
# always_inspect - Inspect both implicit and explicit hashes.
|
739
|
+
# Registers an offense for:
|
740
|
+
# function(a: 1,
|
741
|
+
# b: 2)
|
742
|
+
# Registers an offense for:
|
743
|
+
# function({a: 1,
|
744
|
+
# b: 2})
|
745
|
+
# always_ignore - Ignore both implicit and explicit hashes.
|
746
|
+
# Accepts:
|
747
|
+
# function(a: 1,
|
748
|
+
# b: 2)
|
749
|
+
# Accepts:
|
750
|
+
# function({a: 1,
|
751
|
+
# b: 2})
|
752
|
+
# ignore_implicit - Ignore only implicit hashes.
|
753
|
+
# Accepts:
|
754
|
+
# function(a: 1,
|
755
|
+
# b: 2)
|
756
|
+
# Registers an offense for:
|
757
|
+
# function({a: 1,
|
758
|
+
# b: 2})
|
759
|
+
# ignore_explicit - Ignore only explicit hashes.
|
760
|
+
# Accepts:
|
761
|
+
# function({a: 1,
|
762
|
+
# b: 2})
|
763
|
+
# Registers an offense for:
|
764
|
+
# function(a: 1,
|
765
|
+
# b: 2)
|
766
|
+
EnforcedLastArgumentHashStyle: always_inspect
|
767
|
+
SupportedLastArgumentHashStyles:
|
768
|
+
- always_inspect
|
769
|
+
- always_ignore
|
770
|
+
- ignore_implicit
|
771
|
+
- ignore_explicit
|
772
|
+
|
773
|
+
Layout/HeredocArgumentClosingParenthesis:
|
774
|
+
Description: >-
|
775
|
+
Checks for the placement of the closing parenthesis in a
|
776
|
+
method call that passes a HEREDOC string as an argument.
|
777
|
+
Enabled: false
|
778
|
+
StyleGuide: '#heredoc-argument-closing-parentheses'
|
779
|
+
VersionAdded: '0.68'
|
780
|
+
|
781
|
+
Layout/HeredocIndentation:
|
763
782
|
Description: 'This cop checks the indentation of the here document bodies.'
|
764
783
|
StyleGuide: '#squiggly-heredocs'
|
765
784
|
Enabled: true
|
766
785
|
VersionAdded: '0.49'
|
767
|
-
VersionChanged: '0.
|
786
|
+
VersionChanged: '0.77'
|
768
787
|
EnforcedStyle: squiggly
|
769
788
|
SupportedStyles:
|
770
789
|
- squiggly
|
@@ -791,6 +810,22 @@ Layout/IndentationConsistency:
|
|
791
810
|
# A reference to `EnforcedStyle: indented_internal_methods`.
|
792
811
|
- https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions
|
793
812
|
|
813
|
+
Layout/IndentationStyle:
|
814
|
+
Description: 'Consistent indentation either with tabs only or spaces only.'
|
815
|
+
StyleGuide: '#spaces-indentation'
|
816
|
+
Enabled: true
|
817
|
+
VersionAdded: '0.49'
|
818
|
+
VersionChanged: '0.82'
|
819
|
+
# By default, the indentation width from Layout/IndentationWidth is used
|
820
|
+
# But it can be overridden by setting this parameter
|
821
|
+
# It is used during auto-correction to determine how many spaces should
|
822
|
+
# replace each tab.
|
823
|
+
IndentationWidth: ~
|
824
|
+
EnforcedStyle: spaces
|
825
|
+
SupportedStyles:
|
826
|
+
- spaces
|
827
|
+
- tabs
|
828
|
+
|
794
829
|
Layout/IndentationWidth:
|
795
830
|
Description: 'Use 2 spaces for indentation.'
|
796
831
|
StyleGuide: '#spaces-indentation'
|
@@ -806,11 +841,6 @@ Layout/InitialIndentation:
|
|
806
841
|
Enabled: true
|
807
842
|
VersionAdded: '0.49'
|
808
843
|
|
809
|
-
Layout/LeadingBlankLines:
|
810
|
-
Description: Check for unnecessary blank lines at the beginning of a file.
|
811
|
-
Enabled: true
|
812
|
-
VersionAdded: '0.57'
|
813
|
-
|
814
844
|
Layout/LeadingCommentSpace:
|
815
845
|
Description: 'Comments should start with a space.'
|
816
846
|
StyleGuide: '#hash-space'
|
@@ -818,6 +848,36 @@ Layout/LeadingCommentSpace:
|
|
818
848
|
VersionAdded: '0.49'
|
819
849
|
VersionChanged: '0.73'
|
820
850
|
AllowDoxygenCommentStyle: false
|
851
|
+
AllowGemfileRubyComment: false
|
852
|
+
|
853
|
+
Layout/LeadingEmptyLines:
|
854
|
+
Description: Check for unnecessary blank lines at the beginning of a file.
|
855
|
+
Enabled: true
|
856
|
+
VersionAdded: '0.57'
|
857
|
+
VersionChanged: '0.77'
|
858
|
+
|
859
|
+
Layout/LineLength:
|
860
|
+
Description: 'Limit lines to 80 characters.'
|
861
|
+
StyleGuide: '#80-character-limits'
|
862
|
+
Enabled: true
|
863
|
+
VersionAdded: '0.25'
|
864
|
+
VersionChanged: '0.78'
|
865
|
+
AutoCorrect: false
|
866
|
+
Max: 80
|
867
|
+
# To make it possible to copy or click on URIs in the code, we allow lines
|
868
|
+
# containing a URI to be longer than Max.
|
869
|
+
AllowHeredoc: true
|
870
|
+
AllowURI: true
|
871
|
+
URISchemes:
|
872
|
+
- http
|
873
|
+
- https
|
874
|
+
# The IgnoreCopDirectives option causes the LineLength rule to ignore cop
|
875
|
+
# directives like '# rubocop: enable ...' when calculating a line's length.
|
876
|
+
IgnoreCopDirectives: true
|
877
|
+
# The IgnoredPatterns option is a list of !ruby/regexp and/or string
|
878
|
+
# elements. Strings will be converted to Regexp objects. A line that matches
|
879
|
+
# any regular expression listed in this option will be ignored by LineLength.
|
880
|
+
IgnoredPatterns: []
|
821
881
|
|
822
882
|
Layout/MultilineArrayBraceLayout:
|
823
883
|
Description: >-
|
@@ -960,6 +1020,35 @@ Layout/MultilineOperationIndentation:
|
|
960
1020
|
# But it can be overridden by setting this parameter
|
961
1021
|
IndentationWidth: ~
|
962
1022
|
|
1023
|
+
Layout/ParameterAlignment:
|
1024
|
+
Description: >-
|
1025
|
+
Align the parameters of a method definition if they span more
|
1026
|
+
than one line.
|
1027
|
+
StyleGuide: '#no-double-indent'
|
1028
|
+
Enabled: true
|
1029
|
+
VersionAdded: '0.49'
|
1030
|
+
VersionChanged: '0.77'
|
1031
|
+
# Alignment of parameters in multi-line method calls.
|
1032
|
+
#
|
1033
|
+
# The `with_first_parameter` style aligns the following lines along the same
|
1034
|
+
# column as the first parameter.
|
1035
|
+
#
|
1036
|
+
# def method_foo(a,
|
1037
|
+
# b)
|
1038
|
+
#
|
1039
|
+
# The `with_fixed_indentation` style aligns the following lines with one
|
1040
|
+
# level of indentation relative to the start of the line with the method call.
|
1041
|
+
#
|
1042
|
+
# def method_foo(a,
|
1043
|
+
# b)
|
1044
|
+
EnforcedStyle: with_first_parameter
|
1045
|
+
SupportedStyles:
|
1046
|
+
- with_first_parameter
|
1047
|
+
- with_fixed_indentation
|
1048
|
+
# By default, the indentation width from Layout/IndentationWidth is used
|
1049
|
+
# But it can be overridden by setting this parameter
|
1050
|
+
IndentationWidth: ~
|
1051
|
+
|
963
1052
|
Layout/RescueEnsureAlignment:
|
964
1053
|
Description: 'Align rescues and ensures correctly.'
|
965
1054
|
Enabled: true
|
@@ -1024,6 +1113,11 @@ Layout/SpaceAroundKeyword:
|
|
1024
1113
|
Enabled: true
|
1025
1114
|
VersionAdded: '0.49'
|
1026
1115
|
|
1116
|
+
Layout/SpaceAroundMethodCallOperator:
|
1117
|
+
Description: 'Checks method call operators to not have spaces around them.'
|
1118
|
+
Enabled: pending
|
1119
|
+
VersionAdded: '0.82'
|
1120
|
+
|
1027
1121
|
Layout/SpaceAroundOperators:
|
1028
1122
|
Description: 'Use a single space around operators.'
|
1029
1123
|
StyleGuide: '#spaces-operators'
|
@@ -1033,6 +1127,10 @@ Layout/SpaceAroundOperators:
|
|
1033
1127
|
# with an operator on the previous or next line, not counting empty lines
|
1034
1128
|
# or comment lines.
|
1035
1129
|
AllowForAlignment: true
|
1130
|
+
EnforcedStyleForExponentOperator: no_space
|
1131
|
+
SupportedStylesForExponentOperator:
|
1132
|
+
- space
|
1133
|
+
- no_space
|
1036
1134
|
|
1037
1135
|
Layout/SpaceBeforeBlockBraces:
|
1038
1136
|
Description: >-
|
@@ -1190,23 +1288,12 @@ Layout/SpaceInsideStringInterpolation:
|
|
1190
1288
|
- space
|
1191
1289
|
- no_space
|
1192
1290
|
|
1193
|
-
Layout/
|
1194
|
-
Description: 'No hard tabs.'
|
1195
|
-
StyleGuide: '#spaces-indentation'
|
1196
|
-
Enabled: true
|
1197
|
-
VersionAdded: '0.49'
|
1198
|
-
VersionChanged: '0.51'
|
1199
|
-
# By default, the indentation width from Layout/IndentationWidth is used
|
1200
|
-
# But it can be overridden by setting this parameter
|
1201
|
-
# It is used during auto-correction to determine how many spaces should
|
1202
|
-
# replace each tab.
|
1203
|
-
IndentationWidth: ~
|
1204
|
-
|
1205
|
-
Layout/TrailingBlankLines:
|
1291
|
+
Layout/TrailingEmptyLines:
|
1206
1292
|
Description: 'Checks trailing blank lines and final newline.'
|
1207
1293
|
StyleGuide: '#newline-eof'
|
1208
1294
|
Enabled: true
|
1209
1295
|
VersionAdded: '0.49'
|
1296
|
+
VersionChanged: '0.77'
|
1210
1297
|
EnforcedStyle: final_newline
|
1211
1298
|
SupportedStyles:
|
1212
1299
|
- final_newline
|
@@ -1217,8 +1304,8 @@ Layout/TrailingWhitespace:
|
|
1217
1304
|
StyleGuide: '#no-trailing-whitespace'
|
1218
1305
|
Enabled: true
|
1219
1306
|
VersionAdded: '0.49'
|
1220
|
-
VersionChanged: '0.
|
1221
|
-
AllowInHeredoc:
|
1307
|
+
VersionChanged: '0.83'
|
1308
|
+
AllowInHeredoc: true
|
1222
1309
|
|
1223
1310
|
#################### Lint ##################################
|
1224
1311
|
### Warnings
|
@@ -1238,6 +1325,7 @@ Lint/AmbiguousOperator:
|
|
1238
1325
|
StyleGuide: '#method-invocation-parens'
|
1239
1326
|
Enabled: true
|
1240
1327
|
VersionAdded: '0.17'
|
1328
|
+
VersionChanged: '0.83'
|
1241
1329
|
|
1242
1330
|
Lint/AmbiguousRegexpLiteral:
|
1243
1331
|
Description: >-
|
@@ -1245,6 +1333,7 @@ Lint/AmbiguousRegexpLiteral:
|
|
1245
1333
|
a method invocation without parentheses.
|
1246
1334
|
Enabled: true
|
1247
1335
|
VersionAdded: '0.17'
|
1336
|
+
VersionChanged: '0.83'
|
1248
1337
|
|
1249
1338
|
Lint/AssignmentInCondition:
|
1250
1339
|
Description: "Don't use assignment in conditions."
|
@@ -1261,7 +1350,9 @@ Lint/BigDecimalNew:
|
|
1261
1350
|
Lint/BooleanSymbol:
|
1262
1351
|
Description: 'Check for `:true` and `:false` symbols.'
|
1263
1352
|
Enabled: true
|
1353
|
+
Safe: false
|
1264
1354
|
VersionAdded: '0.50'
|
1355
|
+
VersionChanged: '0.83'
|
1265
1356
|
|
1266
1357
|
Lint/CircularArgumentReference:
|
1267
1358
|
Description: "Default values in optional keyword arguments and optional ordinal arguments should not refer back to the name of the argument."
|
@@ -1290,16 +1381,17 @@ Lint/DuplicateCaseCondition:
|
|
1290
1381
|
Enabled: true
|
1291
1382
|
VersionAdded: '0.45'
|
1292
1383
|
|
1384
|
+
Lint/DuplicateHashKey:
|
1385
|
+
Description: 'Check for duplicate keys in hash literals.'
|
1386
|
+
Enabled: true
|
1387
|
+
VersionAdded: '0.34'
|
1388
|
+
VersionChanged: '0.77'
|
1389
|
+
|
1293
1390
|
Lint/DuplicateMethods:
|
1294
1391
|
Description: 'Check for duplicate method definitions.'
|
1295
1392
|
Enabled: true
|
1296
1393
|
VersionAdded: '0.29'
|
1297
1394
|
|
1298
|
-
Lint/DuplicatedKey:
|
1299
|
-
Description: 'Check for duplicate keys in hash literals.'
|
1300
|
-
Enabled: true
|
1301
|
-
VersionAdded: '0.34'
|
1302
|
-
|
1303
1395
|
Lint/EachWithObjectArgument:
|
1304
1396
|
Description: 'Check for immutable argument given to each_with_object.'
|
1305
1397
|
Enabled: true
|
@@ -1331,18 +1423,16 @@ Lint/EmptyInterpolation:
|
|
1331
1423
|
Lint/EmptyWhen:
|
1332
1424
|
Description: 'Checks for `when` branches with empty bodies.'
|
1333
1425
|
Enabled: true
|
1426
|
+
AllowComments: true
|
1334
1427
|
VersionAdded: '0.45'
|
1335
|
-
|
1336
|
-
Lint/EndInMethod:
|
1337
|
-
Description: 'END blocks should not be placed inside method definitions.'
|
1338
|
-
Enabled: true
|
1339
|
-
VersionAdded: '0.9'
|
1428
|
+
VersionChanged: '0.83'
|
1340
1429
|
|
1341
1430
|
Lint/EnsureReturn:
|
1342
1431
|
Description: 'Do not use return in an ensure block.'
|
1343
1432
|
StyleGuide: '#no-return-ensure'
|
1344
1433
|
Enabled: true
|
1345
1434
|
VersionAdded: '0.9'
|
1435
|
+
VersionChanged: '0.83'
|
1346
1436
|
|
1347
1437
|
Lint/ErbNewArguments:
|
1348
1438
|
Description: 'Use `:trim_mode` and `:eoutvar` keyword arguments to `ERB.new`.'
|
@@ -1367,14 +1457,6 @@ Lint/FormatParameterMismatch:
|
|
1367
1457
|
Enabled: true
|
1368
1458
|
VersionAdded: '0.33'
|
1369
1459
|
|
1370
|
-
Lint/HandleExceptions:
|
1371
|
-
Description: "Don't suppress exception."
|
1372
|
-
StyleGuide: '#dont-hide-exceptions'
|
1373
|
-
Enabled: true
|
1374
|
-
AllowComments: false
|
1375
|
-
VersionAdded: '0.9'
|
1376
|
-
VersionChanged: '0.70'
|
1377
|
-
|
1378
1460
|
Lint/HeredocMethodCallPosition:
|
1379
1461
|
Description: >-
|
1380
1462
|
Checks for the ordering of a method call where
|
@@ -1444,10 +1526,11 @@ Lint/MissingCopEnableDirective:
|
|
1444
1526
|
# .inf for any size
|
1445
1527
|
MaximumRangeSize: .inf
|
1446
1528
|
|
1447
|
-
Lint/
|
1448
|
-
Description: "Use `&&` operator to compare multiple
|
1529
|
+
Lint/MultipleComparison:
|
1530
|
+
Description: "Use `&&` operator to compare multiple values."
|
1449
1531
|
Enabled: true
|
1450
1532
|
VersionAdded: '0.47'
|
1533
|
+
VersionChanged: '0.77'
|
1451
1534
|
|
1452
1535
|
Lint/NestedMethodDefinition:
|
1453
1536
|
Description: 'Do not use nested method definitions.'
|
@@ -1467,6 +1550,12 @@ Lint/NextWithoutAccumulator:
|
|
1467
1550
|
Enabled: true
|
1468
1551
|
VersionAdded: '0.36'
|
1469
1552
|
|
1553
|
+
Lint/NonDeterministicRequireOrder:
|
1554
|
+
Description: 'Always sort arrays returned by Dir.glob when requiring files.'
|
1555
|
+
Enabled: true
|
1556
|
+
VersionAdded: '0.78'
|
1557
|
+
Safe: false
|
1558
|
+
|
1470
1559
|
Lint/NonLocalExitFromIterator:
|
1471
1560
|
Description: 'Do not use return in iterator to cause non-local exit.'
|
1472
1561
|
Enabled: true
|
@@ -1491,6 +1580,7 @@ Lint/ParenthesesAsGroupedExpression:
|
|
1491
1580
|
StyleGuide: '#parens-no-spaces'
|
1492
1581
|
Enabled: true
|
1493
1582
|
VersionAdded: '0.12'
|
1583
|
+
VersionChanged: '0.83'
|
1494
1584
|
|
1495
1585
|
Lint/PercentStringArray:
|
1496
1586
|
Description: >-
|
@@ -1505,6 +1595,14 @@ Lint/PercentSymbolArray:
|
|
1505
1595
|
Enabled: true
|
1506
1596
|
VersionAdded: '0.41'
|
1507
1597
|
|
1598
|
+
Lint/RaiseException:
|
1599
|
+
Description: Checks for `raise` or `fail` statements which are raising `Exception` class.
|
1600
|
+
StyleGuide: '#raise-exception'
|
1601
|
+
Enabled: pending
|
1602
|
+
VersionAdded: '0.81'
|
1603
|
+
AllowedImplicitNamespaces:
|
1604
|
+
- 'Gem'
|
1605
|
+
|
1508
1606
|
Lint/RandOne:
|
1509
1607
|
Description: >-
|
1510
1608
|
Checks for `rand(1)` calls. Such calls always return `0`
|
@@ -1533,7 +1631,14 @@ Lint/RedundantRequireStatement:
|
|
1533
1631
|
Lint/RedundantSplatExpansion:
|
1534
1632
|
Description: 'Checks for splat unnecessarily being called on literals.'
|
1535
1633
|
Enabled: true
|
1536
|
-
|
1634
|
+
VersionAdded: '0.76'
|
1635
|
+
|
1636
|
+
Lint/RedundantStringCoercion:
|
1637
|
+
Description: 'Checks for Object#to_s usage in string interpolation.'
|
1638
|
+
StyleGuide: '#no-to-s'
|
1639
|
+
Enabled: true
|
1640
|
+
VersionAdded: '0.19'
|
1641
|
+
VersionChanged: '0.77'
|
1537
1642
|
|
1538
1643
|
Lint/RedundantWithIndex:
|
1539
1644
|
Description: 'Checks for redundant `with_index`.'
|
@@ -1580,8 +1685,8 @@ Lint/SafeNavigationChain:
|
|
1580
1685
|
Description: 'Do not chain ordinary method call after safe navigation operator.'
|
1581
1686
|
Enabled: true
|
1582
1687
|
VersionAdded: '0.47'
|
1583
|
-
VersionChanged: '0.
|
1584
|
-
|
1688
|
+
VersionChanged: '0.77'
|
1689
|
+
AllowedMethods:
|
1585
1690
|
- present?
|
1586
1691
|
- blank?
|
1587
1692
|
- presence
|
@@ -1595,14 +1700,14 @@ Lint/SafeNavigationConsistency:
|
|
1595
1700
|
for all method calls on that same object.
|
1596
1701
|
Enabled: true
|
1597
1702
|
VersionAdded: '0.55'
|
1598
|
-
|
1703
|
+
VersionChanged: '0.77'
|
1704
|
+
AllowedMethods:
|
1599
1705
|
- present?
|
1600
1706
|
- blank?
|
1601
1707
|
- presence
|
1602
1708
|
- try
|
1603
1709
|
- try!
|
1604
1710
|
|
1605
|
-
|
1606
1711
|
Lint/SafeNavigationWithEmpty:
|
1607
1712
|
Description: 'Avoid `foo&.empty?` in conditionals.'
|
1608
1713
|
Enabled: true
|
@@ -1640,12 +1745,18 @@ Lint/ShadowingOuterLocalVariable:
|
|
1640
1745
|
Enabled: true
|
1641
1746
|
VersionAdded: '0.9'
|
1642
1747
|
|
1643
|
-
Lint/
|
1644
|
-
Description: '
|
1645
|
-
|
1748
|
+
Lint/StructNewOverride:
|
1749
|
+
Description: 'Disallow overriding the `Struct` built-in methods via `Struct.new`.'
|
1750
|
+
Enabled: pending
|
1751
|
+
VersionAdded: '0.81'
|
1752
|
+
|
1753
|
+
Lint/SuppressedException:
|
1754
|
+
Description: "Don't suppress exceptions."
|
1755
|
+
StyleGuide: '#dont-hide-exceptions'
|
1646
1756
|
Enabled: true
|
1647
|
-
|
1648
|
-
|
1757
|
+
AllowComments: true
|
1758
|
+
VersionAdded: '0.9'
|
1759
|
+
VersionChanged: '0.81'
|
1649
1760
|
|
1650
1761
|
Lint/Syntax:
|
1651
1762
|
Description: 'Checks syntax error.'
|
@@ -1656,6 +1767,7 @@ Lint/Syntax:
|
|
1656
1767
|
Lint/ToJSON:
|
1657
1768
|
Description: 'Ensure #to_json includes an optional argument.'
|
1658
1769
|
Enabled: true
|
1770
|
+
VersionAdded: '0.66'
|
1659
1771
|
|
1660
1772
|
Lint/UnderscorePrefixedVariableName:
|
1661
1773
|
Description: 'Do not use prefix `_` for a variable that is used.'
|
@@ -1687,9 +1799,10 @@ Lint/UnusedMethodArgument:
|
|
1687
1799
|
StyleGuide: '#underscore-unused-vars'
|
1688
1800
|
Enabled: true
|
1689
1801
|
VersionAdded: '0.21'
|
1690
|
-
VersionChanged: '0.
|
1802
|
+
VersionChanged: '0.81'
|
1691
1803
|
AllowUnusedKeywordArguments: false
|
1692
1804
|
IgnoreEmptyMethods: true
|
1805
|
+
IgnoreNotImplementedMethods: true
|
1693
1806
|
|
1694
1807
|
Lint/UriEscapeUnescape:
|
1695
1808
|
Description: >-
|
@@ -1711,7 +1824,7 @@ Lint/UselessAccessModifier:
|
|
1711
1824
|
Description: 'Checks for useless access modifiers.'
|
1712
1825
|
Enabled: true
|
1713
1826
|
VersionAdded: '0.20'
|
1714
|
-
VersionChanged: '0.
|
1827
|
+
VersionChanged: '0.83'
|
1715
1828
|
ContextCreatingMethods: []
|
1716
1829
|
MethodCreatingMethods: []
|
1717
1830
|
|
@@ -1735,6 +1848,8 @@ Lint/UselessSetterCall:
|
|
1735
1848
|
Description: 'Checks for useless setter call to a local variable.'
|
1736
1849
|
Enabled: true
|
1737
1850
|
VersionAdded: '0.13'
|
1851
|
+
VersionChanged: '0.80'
|
1852
|
+
Safe: false
|
1738
1853
|
|
1739
1854
|
Lint/Void:
|
1740
1855
|
Description: 'Possible use of operator/literal/variable in void context.'
|
@@ -1753,9 +1868,10 @@ Metrics/AbcSize:
|
|
1753
1868
|
- https://en.wikipedia.org/wiki/ABC_Software_Metric
|
1754
1869
|
Enabled: true
|
1755
1870
|
VersionAdded: '0.27'
|
1756
|
-
VersionChanged: '0.
|
1871
|
+
VersionChanged: '0.81'
|
1757
1872
|
# The ABC size is a calculated magnitude, so this number can be an Integer or
|
1758
1873
|
# a Float.
|
1874
|
+
IgnoredMethods: []
|
1759
1875
|
Max: 15
|
1760
1876
|
|
1761
1877
|
Metrics/BlockLength:
|
@@ -1795,31 +1911,10 @@ Metrics/CyclomaticComplexity:
|
|
1795
1911
|
of test cases needed to validate a method.
|
1796
1912
|
Enabled: true
|
1797
1913
|
VersionAdded: '0.25'
|
1914
|
+
VersionChanged: '0.81'
|
1915
|
+
IgnoredMethods: []
|
1798
1916
|
Max: 6
|
1799
1917
|
|
1800
|
-
Metrics/LineLength:
|
1801
|
-
Description: 'Limit lines to 80 characters.'
|
1802
|
-
StyleGuide: '#80-character-limits'
|
1803
|
-
Enabled: true
|
1804
|
-
VersionAdded: '0.25'
|
1805
|
-
VersionChanged: '0.68'
|
1806
|
-
AutoCorrect: false
|
1807
|
-
Max: 80
|
1808
|
-
# To make it possible to copy or click on URIs in the code, we allow lines
|
1809
|
-
# containing a URI to be longer than Max.
|
1810
|
-
AllowHeredoc: true
|
1811
|
-
AllowURI: true
|
1812
|
-
URISchemes:
|
1813
|
-
- http
|
1814
|
-
- https
|
1815
|
-
# The IgnoreCopDirectives option causes the LineLength rule to ignore cop
|
1816
|
-
# directives like '# rubocop: enable ...' when calculating a line's length.
|
1817
|
-
IgnoreCopDirectives: true
|
1818
|
-
# The IgnoredPatterns option is a list of !ruby/regexp and/or string
|
1819
|
-
# elements. Strings will be converted to Regexp objects. A line that matches
|
1820
|
-
# any regular expression listed in this option will be ignored by LineLength.
|
1821
|
-
IgnoredPatterns: []
|
1822
|
-
|
1823
1918
|
Metrics/MethodLength:
|
1824
1919
|
Description: 'Avoid methods longer than 10 lines of code.'
|
1825
1920
|
StyleGuide: '#short-methods'
|
@@ -1851,6 +1946,8 @@ Metrics/PerceivedComplexity:
|
|
1851
1946
|
human reader.
|
1852
1947
|
Enabled: true
|
1853
1948
|
VersionAdded: '0.25'
|
1949
|
+
VersionChanged: '0.81'
|
1950
|
+
IgnoredMethods: []
|
1854
1951
|
Max: 7
|
1855
1952
|
|
1856
1953
|
################## Migration #############################
|
@@ -1859,7 +1956,8 @@ Migration/DepartmentName:
|
|
1859
1956
|
Description: >-
|
1860
1957
|
Check that cop names in rubocop:disable (etc) comments are
|
1861
1958
|
given with department name.
|
1862
|
-
Enabled:
|
1959
|
+
Enabled: true
|
1960
|
+
VersionAdded: '0.75'
|
1863
1961
|
|
1864
1962
|
#################### Naming ##############################
|
1865
1963
|
|
@@ -1881,6 +1979,21 @@ Naming/BinaryOperatorParameterName:
|
|
1881
1979
|
Enabled: true
|
1882
1980
|
VersionAdded: '0.50'
|
1883
1981
|
|
1982
|
+
Naming/BlockParameterName:
|
1983
|
+
Description: >-
|
1984
|
+
Checks for block parameter names that contain capital letters,
|
1985
|
+
end in numbers, or do not meet a minimal length.
|
1986
|
+
Enabled: true
|
1987
|
+
VersionAdded: '0.53'
|
1988
|
+
VersionChanged: '0.77'
|
1989
|
+
# Parameter names may be equal to or greater than this value
|
1990
|
+
MinNameLength: 1
|
1991
|
+
AllowNamesEndingInNumbers: true
|
1992
|
+
# Allowed names that will not register an offense
|
1993
|
+
AllowedNames: []
|
1994
|
+
# Forbidden names that will register an offense
|
1995
|
+
ForbiddenNames: []
|
1996
|
+
|
1884
1997
|
Naming/ClassAndModuleCamelCase:
|
1885
1998
|
Description: 'Use CamelCase for classes and modules.'
|
1886
1999
|
StyleGuide: '#camelcase-classes'
|
@@ -1972,7 +2085,7 @@ Naming/HeredocDelimiterNaming:
|
|
1972
2085
|
StyleGuide: '#heredoc-delimiters'
|
1973
2086
|
Enabled: true
|
1974
2087
|
VersionAdded: '0.50'
|
1975
|
-
|
2088
|
+
ForbiddenDelimiters:
|
1976
2089
|
- !ruby/regexp '/(^|\s)(EO[A-Z]{1}|END)(\s|$)/'
|
1977
2090
|
|
1978
2091
|
Naming/MemoizedInstanceVariableName:
|
@@ -2004,25 +2117,51 @@ Naming/MethodName:
|
|
2004
2117
|
#
|
2005
2118
|
IgnoredPatterns: []
|
2006
2119
|
|
2120
|
+
Naming/MethodParameterName:
|
2121
|
+
Description: >-
|
2122
|
+
Checks for method parameter names that contain capital letters,
|
2123
|
+
end in numbers, or do not meet a minimal length.
|
2124
|
+
Enabled: true
|
2125
|
+
VersionAdded: '0.53'
|
2126
|
+
VersionChanged: '0.77'
|
2127
|
+
# Parameter names may be equal to or greater than this value
|
2128
|
+
MinNameLength: 3
|
2129
|
+
AllowNamesEndingInNumbers: true
|
2130
|
+
# Allowed names that will not register an offense
|
2131
|
+
AllowedNames:
|
2132
|
+
- io
|
2133
|
+
- id
|
2134
|
+
- to
|
2135
|
+
- by
|
2136
|
+
- 'on'
|
2137
|
+
- in
|
2138
|
+
- at
|
2139
|
+
- ip
|
2140
|
+
- db
|
2141
|
+
- os
|
2142
|
+
- pp
|
2143
|
+
# Forbidden names that will register an offense
|
2144
|
+
ForbiddenNames: []
|
2145
|
+
|
2007
2146
|
Naming/PredicateName:
|
2008
2147
|
Description: 'Check the names of predicate methods.'
|
2009
2148
|
StyleGuide: '#bool-methods-qmark'
|
2010
2149
|
Enabled: true
|
2011
2150
|
VersionAdded: '0.50'
|
2012
|
-
VersionChanged: '0.
|
2151
|
+
VersionChanged: '0.77'
|
2013
2152
|
# Predicate name prefixes.
|
2014
2153
|
NamePrefix:
|
2015
2154
|
- is_
|
2016
2155
|
- has_
|
2017
2156
|
- have_
|
2018
2157
|
# Predicate name prefixes that should be removed.
|
2019
|
-
|
2158
|
+
ForbiddenPrefixes:
|
2020
2159
|
- is_
|
2021
2160
|
- has_
|
2022
2161
|
- have_
|
2023
|
-
# Predicate names which, despite having a
|
2162
|
+
# Predicate names which, despite having a forbidden prefix, or no `?`,
|
2024
2163
|
# should still be accepted
|
2025
|
-
|
2164
|
+
AllowedMethods:
|
2026
2165
|
- is_a?
|
2027
2166
|
# Method definition macros for dynamically generated methods.
|
2028
2167
|
MethodDefinitionMacros:
|
@@ -2040,46 +2179,6 @@ Naming/RescuedExceptionsVariableName:
|
|
2040
2179
|
VersionChanged: '0.68'
|
2041
2180
|
PreferredName: e
|
2042
2181
|
|
2043
|
-
Naming/UncommunicativeBlockParamName:
|
2044
|
-
Description: >-
|
2045
|
-
Checks for block parameter names that contain capital letters,
|
2046
|
-
end in numbers, or do not meet a minimal length.
|
2047
|
-
Enabled: true
|
2048
|
-
VersionAdded: '0.53'
|
2049
|
-
# Parameter names may be equal to or greater than this value
|
2050
|
-
MinNameLength: 1
|
2051
|
-
AllowNamesEndingInNumbers: true
|
2052
|
-
# Whitelisted names that will not register an offense
|
2053
|
-
AllowedNames: []
|
2054
|
-
# Blacklisted names that will register an offense
|
2055
|
-
ForbiddenNames: []
|
2056
|
-
|
2057
|
-
Naming/UncommunicativeMethodParamName:
|
2058
|
-
Description: >-
|
2059
|
-
Checks for method parameter names that contain capital letters,
|
2060
|
-
end in numbers, or do not meet a minimal length.
|
2061
|
-
Enabled: true
|
2062
|
-
VersionAdded: '0.53'
|
2063
|
-
VersionChanged: '0.59'
|
2064
|
-
# Parameter names may be equal to or greater than this value
|
2065
|
-
MinNameLength: 3
|
2066
|
-
AllowNamesEndingInNumbers: true
|
2067
|
-
# Whitelisted names that will not register an offense
|
2068
|
-
AllowedNames:
|
2069
|
-
- io
|
2070
|
-
- id
|
2071
|
-
- to
|
2072
|
-
- by
|
2073
|
-
- 'on'
|
2074
|
-
- in
|
2075
|
-
- at
|
2076
|
-
- ip
|
2077
|
-
- db
|
2078
|
-
- os
|
2079
|
-
# Blacklisted names that will register an offense
|
2080
|
-
ForbiddenNames: []
|
2081
|
-
|
2082
|
-
|
2083
2182
|
Naming/VariableName:
|
2084
2183
|
Description: 'Use the configured style when naming variables.'
|
2085
2184
|
StyleGuide: '#snake-case-symbols-methods-vars'
|
@@ -2149,10 +2248,12 @@ Style/AccessModifierDeclarations:
|
|
2149
2248
|
Description: 'Checks style of how access modifiers are used.'
|
2150
2249
|
Enabled: true
|
2151
2250
|
VersionAdded: '0.57'
|
2251
|
+
VersionChanged: '0.81'
|
2152
2252
|
EnforcedStyle: group
|
2153
2253
|
SupportedStyles:
|
2154
2254
|
- inline
|
2155
2255
|
- group
|
2256
|
+
AllowModifiersOnSymbols: true
|
2156
2257
|
|
2157
2258
|
Style/Alias:
|
2158
2259
|
Description: 'Use alias instead of alias_method.'
|
@@ -2331,30 +2432,27 @@ Style/BlockDelimiters:
|
|
2331
2432
|
# # also good
|
2332
2433
|
# collection.each do |element| puts element end
|
2333
2434
|
AllowBracesOnProceduralOneLiners: false
|
2334
|
-
|
2335
|
-
|
2336
|
-
|
2337
|
-
|
2338
|
-
|
2339
|
-
|
2340
|
-
EnforcedStyle: no_braces
|
2341
|
-
SupportedStyles:
|
2342
|
-
# The `braces` style enforces braces around all method parameters that are
|
2343
|
-
# hashes.
|
2344
|
-
- braces
|
2345
|
-
# The `no_braces` style checks that the last parameter doesn't have braces
|
2346
|
-
# around it.
|
2347
|
-
- no_braces
|
2348
|
-
# The `context_dependent` style checks that the last parameter doesn't have
|
2349
|
-
# braces around it, but requires braces if the second to last parameter is
|
2350
|
-
# also a hash literal.
|
2351
|
-
- context_dependent
|
2435
|
+
# The BracesRequiredMethods overrides all other configurations except
|
2436
|
+
# IgnoredMethods. It can be used to enforce that all blocks for specific
|
2437
|
+
# methods use braces. For example, you can use this to enforce Sorbet
|
2438
|
+
# signatures use braces even when the rest of your codebase enforces
|
2439
|
+
# the `line_count_based` style.
|
2440
|
+
BracesRequiredMethods: []
|
2352
2441
|
|
2353
2442
|
Style/CaseEquality:
|
2354
2443
|
Description: 'Avoid explicit use of the case equality operator(===).'
|
2355
2444
|
StyleGuide: '#no-case-equality'
|
2356
2445
|
Enabled: true
|
2357
2446
|
VersionAdded: '0.9'
|
2447
|
+
# If AllowOnConstant is enabled, the cop will ignore violations when the receiver of
|
2448
|
+
# the case equality operator is a constant.
|
2449
|
+
#
|
2450
|
+
# # bad
|
2451
|
+
# /string/ === "string"
|
2452
|
+
#
|
2453
|
+
# # good
|
2454
|
+
# String === "string"
|
2455
|
+
AllowOnConstant: false
|
2358
2456
|
|
2359
2457
|
Style/CharacterLiteral:
|
2360
2458
|
Description: 'Checks for uses of character literals.'
|
@@ -2395,6 +2493,7 @@ Style/ClassAndModuleChildren:
|
|
2395
2493
|
|
2396
2494
|
Style/ClassCheck:
|
2397
2495
|
Description: 'Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.'
|
2496
|
+
StyleGuide: '#is-a-vs-kind-of'
|
2398
2497
|
Enabled: true
|
2399
2498
|
VersionAdded: '0.24'
|
2400
2499
|
EnforcedStyle: is_a?
|
@@ -2418,7 +2517,7 @@ Style/ClassVars:
|
|
2418
2517
|
# Align with the style guide.
|
2419
2518
|
Style/CollectionMethods:
|
2420
2519
|
Description: 'Preferred collection methods.'
|
2421
|
-
StyleGuide: '#map-find-select-reduce-size'
|
2520
|
+
StyleGuide: '#map-find-select-reduce-include-size'
|
2422
2521
|
Enabled: false
|
2423
2522
|
VersionAdded: '0.9'
|
2424
2523
|
VersionChanged: '0.27'
|
@@ -2435,6 +2534,7 @@ Style/CollectionMethods:
|
|
2435
2534
|
inject: 'reduce'
|
2436
2535
|
detect: 'find'
|
2437
2536
|
find_all: 'select'
|
2537
|
+
member?: 'include?'
|
2438
2538
|
|
2439
2539
|
Style/ColonMethodCall:
|
2440
2540
|
Description: 'Do not use :: for method call.'
|
@@ -2561,6 +2661,12 @@ Style/Dir:
|
|
2561
2661
|
Enabled: true
|
2562
2662
|
VersionAdded: '0.50'
|
2563
2663
|
|
2664
|
+
Style/DisableCopsWithinSourceCodeDirective:
|
2665
|
+
Description: >-
|
2666
|
+
Forbids disabling/enabling cops within source code.
|
2667
|
+
Enabled: false
|
2668
|
+
VersionAdded: '0.82'
|
2669
|
+
|
2564
2670
|
Style/Documentation:
|
2565
2671
|
Description: 'Document classes and non-namespace modules.'
|
2566
2672
|
Enabled: true
|
@@ -2660,6 +2766,7 @@ Style/EndBlock:
|
|
2660
2766
|
StyleGuide: '#no-END-blocks'
|
2661
2767
|
Enabled: true
|
2662
2768
|
VersionAdded: '0.9'
|
2769
|
+
VersionChanged: '0.81'
|
2663
2770
|
|
2664
2771
|
Style/EvalWithLocation:
|
2665
2772
|
Description: 'Pass `__FILE__` and `__LINE__` to `eval` method, as they are used by backtraces.'
|
@@ -2678,6 +2785,17 @@ Style/ExpandPathArguments:
|
|
2678
2785
|
Enabled: true
|
2679
2786
|
VersionAdded: '0.53'
|
2680
2787
|
|
2788
|
+
Style/ExponentialNotation:
|
2789
|
+
Description: 'When using exponential notation, favor a mantissa between 1 (inclusive) and 10 (exclusive).'
|
2790
|
+
StyleGuide: '#exponential-notation'
|
2791
|
+
Enabled: pending
|
2792
|
+
VersionAdded: '0.82'
|
2793
|
+
EnforcedStyle: scientific
|
2794
|
+
SupportedStyles:
|
2795
|
+
- scientific
|
2796
|
+
- engineering
|
2797
|
+
- integral
|
2798
|
+
|
2681
2799
|
Style/FloatDivision:
|
2682
2800
|
Description: 'For performing float division, coerce one side only.'
|
2683
2801
|
StyleGuide: '#float-division'
|
@@ -2734,7 +2852,7 @@ Style/FrozenStringLiteralComment:
|
|
2734
2852
|
to help transition to frozen string literals by default.
|
2735
2853
|
Enabled: true
|
2736
2854
|
VersionAdded: '0.36'
|
2737
|
-
VersionChanged: '0.
|
2855
|
+
VersionChanged: '0.79'
|
2738
2856
|
EnforcedStyle: always
|
2739
2857
|
SupportedStyles:
|
2740
2858
|
# `always` will always add the frozen string literal comment to a file
|
@@ -2742,9 +2860,14 @@ Style/FrozenStringLiteralComment:
|
|
2742
2860
|
# string literal. If you run code against multiple versions of Ruby, it is
|
2743
2861
|
# possible that this will create errors in Ruby 2.3.0+.
|
2744
2862
|
- always
|
2863
|
+
# `always_true` will add the frozen string literal comment to a file,
|
2864
|
+
# similarly to the `always` style, but will also change any disabled
|
2865
|
+
# comments (e.g. `# frozen_string_literal: false`) to be enabled.
|
2866
|
+
- always_true
|
2745
2867
|
# `never` will enforce that the frozen string literal comment does not
|
2746
2868
|
# exist in a file.
|
2747
2869
|
- never
|
2870
|
+
Safe: false
|
2748
2871
|
|
2749
2872
|
Style/GlobalVars:
|
2750
2873
|
Description: 'Do not introduce global variables.'
|
@@ -2765,6 +2888,13 @@ Style/GuardClause:
|
|
2765
2888
|
# needs to have to trigger this cop
|
2766
2889
|
MinBodyLength: 1
|
2767
2890
|
|
2891
|
+
Style/HashEachMethods:
|
2892
|
+
Description: 'Use Hash#each_key and Hash#each_value.'
|
2893
|
+
StyleGuide: '#hash-each'
|
2894
|
+
Enabled: pending
|
2895
|
+
VersionAdded: '0.80'
|
2896
|
+
Safe: false
|
2897
|
+
|
2768
2898
|
Style/HashSyntax:
|
2769
2899
|
Description: >-
|
2770
2900
|
Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
|
@@ -2788,6 +2918,18 @@ Style/HashSyntax:
|
|
2788
2918
|
# Do not suggest { a?: 1 } over { :a? => 1 } in ruby19 style
|
2789
2919
|
PreferHashRocketsForNonAlnumEndingSymbols: false
|
2790
2920
|
|
2921
|
+
Style/HashTransformKeys:
|
2922
|
+
Description: 'Prefer `transform_keys` over `each_with_object` and `map`.'
|
2923
|
+
Enabled: 'pending'
|
2924
|
+
VersionAdded: '0.80'
|
2925
|
+
Safe: false
|
2926
|
+
|
2927
|
+
Style/HashTransformValues:
|
2928
|
+
Description: 'Prefer `transform_values` over `each_with_object` and `map`.'
|
2929
|
+
Enabled: 'pending'
|
2930
|
+
VersionAdded: '0.80'
|
2931
|
+
Safe: false
|
2932
|
+
|
2791
2933
|
Style/IdenticalConditionalBranches:
|
2792
2934
|
Description: >-
|
2793
2935
|
Checks that conditional statements do not have an identical
|
@@ -2822,6 +2964,7 @@ Style/IfWithSemicolon:
|
|
2822
2964
|
StyleGuide: '#no-semicolon-ifs'
|
2823
2965
|
Enabled: true
|
2824
2966
|
VersionAdded: '0.9'
|
2967
|
+
VersionChanged: '0.83'
|
2825
2968
|
|
2826
2969
|
Style/ImplicitRuntimeError:
|
2827
2970
|
Description: >-
|
@@ -2874,8 +3017,9 @@ Style/IpAddresses:
|
|
2874
3017
|
Description: "Don't include literal IP addresses in code."
|
2875
3018
|
Enabled: false
|
2876
3019
|
VersionAdded: '0.58'
|
2877
|
-
|
2878
|
-
|
3020
|
+
VersionChanged: '0.77'
|
3021
|
+
# Allow addresses to be permitted
|
3022
|
+
AllowedAddresses:
|
2879
3023
|
- "::"
|
2880
3024
|
# :: is a valid IPv6 address, but could potentially be legitimately in code
|
2881
3025
|
|
@@ -2895,7 +3039,7 @@ Style/LambdaCall:
|
|
2895
3039
|
Description: 'Use lambda.call(...) instead of lambda.(...).'
|
2896
3040
|
StyleGuide: '#proc-call'
|
2897
3041
|
Enabled: true
|
2898
|
-
VersionAdded: '0.13
|
3042
|
+
VersionAdded: '0.13'
|
2899
3043
|
VersionChanged: '0.14'
|
2900
3044
|
EnforcedStyle: call
|
2901
3045
|
SupportedStyles:
|
@@ -3025,6 +3169,7 @@ Style/ModuleFunction:
|
|
3025
3169
|
SupportedStyles:
|
3026
3170
|
- module_function
|
3027
3171
|
- extend_self
|
3172
|
+
- forbidden
|
3028
3173
|
Autocorrect: false
|
3029
3174
|
SafeAutoCorrect: false
|
3030
3175
|
|
@@ -3148,8 +3293,8 @@ Style/NestedParenthesizedCalls:
|
|
3148
3293
|
argument list of another parenthesized method call.
|
3149
3294
|
Enabled: true
|
3150
3295
|
VersionAdded: '0.36'
|
3151
|
-
VersionChanged: '0.
|
3152
|
-
|
3296
|
+
VersionChanged: '0.77'
|
3297
|
+
AllowedMethods:
|
3153
3298
|
- be
|
3154
3299
|
- be_a
|
3155
3300
|
- be_an
|
@@ -3297,7 +3442,9 @@ Style/OptionalArguments:
|
|
3297
3442
|
of the argument list.
|
3298
3443
|
StyleGuide: '#optional-arguments'
|
3299
3444
|
Enabled: true
|
3445
|
+
Safe: false
|
3300
3446
|
VersionAdded: '0.33'
|
3447
|
+
VersionChanged: '0.83'
|
3301
3448
|
|
3302
3449
|
Style/OrAssignment:
|
3303
3450
|
Description: 'Recommend usage of double pipe equals (||=) where applicable.'
|
@@ -3526,11 +3673,11 @@ Style/SafeNavigation:
|
|
3526
3673
|
safe navigation (`&.`).
|
3527
3674
|
Enabled: true
|
3528
3675
|
VersionAdded: '0.43'
|
3529
|
-
VersionChanged: '0.
|
3676
|
+
VersionChanged: '0.77'
|
3530
3677
|
# Safe navigation may cause a statement to start returning `nil` in addition
|
3531
3678
|
# to whatever it used to return.
|
3532
3679
|
ConvertCodeThatCanStartToReturnNil: false
|
3533
|
-
|
3680
|
+
AllowedMethods:
|
3534
3681
|
- present?
|
3535
3682
|
- blank?
|
3536
3683
|
- presence
|
@@ -3602,6 +3749,12 @@ Style/SingleLineMethods:
|
|
3602
3749
|
VersionChanged: '0.19'
|
3603
3750
|
AllowIfMethodIsEmpty: true
|
3604
3751
|
|
3752
|
+
Style/SlicingWithRange:
|
3753
|
+
Description: 'Checks array slicing is done with endless ranges when suitable.'
|
3754
|
+
Enabled: pending
|
3755
|
+
VersionAdded: '0.83'
|
3756
|
+
Safe: false
|
3757
|
+
|
3605
3758
|
Style/SpecialGlobalVars:
|
3606
3759
|
Description: 'Avoid Perl-style global variables.'
|
3607
3760
|
StyleGuide: '#no-cryptic-perlisms'
|
@@ -3764,22 +3917,29 @@ Style/TrailingCommaInArrayLiteral:
|
|
3764
3917
|
StyleGuide: '#no-trailing-array-commas'
|
3765
3918
|
Enabled: true
|
3766
3919
|
VersionAdded: '0.53'
|
3920
|
+
# If `comma`, the cop requires a comma after the last item in an array,
|
3767
3921
|
# but only when each item is on its own line.
|
3768
3922
|
# If `consistent_comma`, the cop requires a comma after the last item of all
|
3769
|
-
# non-empty array literals.
|
3923
|
+
# non-empty, multiline array literals.
|
3770
3924
|
EnforcedStyleForMultiline: no_comma
|
3771
3925
|
SupportedStylesForMultiline:
|
3772
3926
|
- comma
|
3773
3927
|
- consistent_comma
|
3774
3928
|
- no_comma
|
3775
3929
|
|
3930
|
+
Style/TrailingCommaInBlockArgs:
|
3931
|
+
Description: 'Checks for useless trailing commas in block arguments.'
|
3932
|
+
Enabled: false
|
3933
|
+
Safe: false
|
3934
|
+
VersionAdded: '0.81'
|
3935
|
+
|
3776
3936
|
Style/TrailingCommaInHashLiteral:
|
3777
3937
|
Description: 'Checks for trailing comma in hash literals.'
|
3778
3938
|
Enabled: true
|
3779
3939
|
# If `comma`, the cop requires a comma after the last item in a hash,
|
3780
3940
|
# but only when each item is on its own line.
|
3781
3941
|
# If `consistent_comma`, the cop requires a comma after the last item of all
|
3782
|
-
# non-empty hash literals.
|
3942
|
+
# non-empty, multiline hash literals.
|
3783
3943
|
EnforcedStyleForMultiline: no_comma
|
3784
3944
|
SupportedStylesForMultiline:
|
3785
3945
|
- comma
|
@@ -3808,7 +3968,7 @@ Style/TrivialAccessors:
|
|
3808
3968
|
StyleGuide: '#attr_family'
|
3809
3969
|
Enabled: true
|
3810
3970
|
VersionAdded: '0.9'
|
3811
|
-
VersionChanged: '0.
|
3971
|
+
VersionChanged: '0.77'
|
3812
3972
|
# When set to `false` the cop will suggest the use of accessor methods
|
3813
3973
|
# in situations like:
|
3814
3974
|
#
|
@@ -3829,7 +3989,7 @@ Style/TrivialAccessors:
|
|
3829
3989
|
# Commonly used in DSLs
|
3830
3990
|
AllowDSLWriters: false
|
3831
3991
|
IgnoreClassMethods: false
|
3832
|
-
|
3992
|
+
AllowedMethods:
|
3833
3993
|
- to_ary
|
3834
3994
|
- to_a
|
3835
3995
|
- to_c
|