rubocop 0.82.0 → 1.18.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -1
- data/README.md +69 -37
- data/assets/output.html.erb +1 -1
- data/config/default.yml +1025 -139
- data/config/obsoletion.yml +200 -0
- data/exe/rubocop +2 -4
- data/lib/rubocop.rb +137 -68
- data/lib/rubocop/ast_aliases.rb +8 -0
- data/lib/rubocop/cached_data.rb +4 -4
- data/lib/rubocop/cli.rb +11 -11
- data/lib/rubocop/cli/command.rb +1 -0
- data/lib/rubocop/cli/command/auto_genenerate_config.rb +46 -19
- data/lib/rubocop/cli/command/base.rb +2 -0
- data/lib/rubocop/cli/command/execute_runner.rb +36 -12
- data/lib/rubocop/cli/command/init_dotfile.rb +3 -4
- data/lib/rubocop/cli/command/show_cops.rb +6 -12
- data/lib/rubocop/cli/command/suggest_extensions.rb +81 -0
- data/lib/rubocop/cli/command/version.rb +3 -2
- data/lib/rubocop/cli/environment.rb +1 -0
- data/lib/rubocop/comment_config.rb +54 -103
- data/lib/rubocop/config.rb +45 -29
- data/lib/rubocop/config_loader.rb +101 -106
- data/lib/rubocop/config_loader_resolver.rb +100 -29
- data/lib/rubocop/config_obsoletion.rb +67 -242
- data/lib/rubocop/config_obsoletion/changed_enforced_styles.rb +33 -0
- data/lib/rubocop/config_obsoletion/changed_parameter.rb +21 -0
- data/lib/rubocop/config_obsoletion/cop_rule.rb +33 -0
- data/lib/rubocop/config_obsoletion/extracted_cop.rb +44 -0
- data/lib/rubocop/config_obsoletion/parameter_rule.rb +44 -0
- data/lib/rubocop/config_obsoletion/removed_cop.rb +41 -0
- data/lib/rubocop/config_obsoletion/renamed_cop.rb +34 -0
- data/lib/rubocop/config_obsoletion/rule.rb +41 -0
- data/lib/rubocop/config_obsoletion/split_cop.rb +27 -0
- data/lib/rubocop/config_regeneration.rb +33 -0
- data/lib/rubocop/config_store.rb +31 -7
- data/lib/rubocop/config_validator.rb +53 -28
- data/lib/rubocop/cop/autocorrect_logic.rb +37 -38
- data/lib/rubocop/cop/badge.rb +11 -27
- data/lib/rubocop/cop/base.rb +450 -0
- data/lib/rubocop/cop/bundler/duplicated_gem.rb +31 -7
- data/lib/rubocop/cop/bundler/gem_comment.rb +117 -10
- data/lib/rubocop/cop/bundler/gem_version.rb +133 -0
- data/lib/rubocop/cop/bundler/insecure_protocol_source.rb +13 -20
- data/lib/rubocop/cop/bundler/ordered_gems.rb +2 -4
- data/lib/rubocop/cop/commissioner.rb +98 -74
- data/lib/rubocop/cop/cop.rb +84 -234
- data/lib/rubocop/cop/corrector.rb +41 -119
- data/lib/rubocop/cop/correctors/alignment_corrector.rb +11 -21
- data/lib/rubocop/cop/correctors/condition_corrector.rb +3 -5
- data/lib/rubocop/cop/correctors/each_to_for_corrector.rb +2 -4
- data/lib/rubocop/cop/correctors/empty_line_corrector.rb +9 -10
- data/lib/rubocop/cop/correctors/for_to_each_corrector.rb +1 -2
- data/lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb +1 -1
- data/lib/rubocop/cop/correctors/line_break_corrector.rb +8 -11
- data/lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb +35 -6
- data/lib/rubocop/cop/correctors/ordered_gem_corrector.rb +1 -3
- data/lib/rubocop/cop/correctors/parentheses_corrector.rb +5 -8
- data/lib/rubocop/cop/correctors/percent_literal_corrector.rb +10 -21
- data/lib/rubocop/cop/correctors/punctuation_corrector.rb +8 -10
- data/lib/rubocop/cop/correctors/space_corrector.rb +1 -3
- data/lib/rubocop/cop/correctors/string_literal_corrector.rb +6 -8
- data/lib/rubocop/cop/correctors/unused_arg_corrector.rb +15 -18
- data/lib/rubocop/cop/documentation.rb +22 -0
- data/lib/rubocop/cop/exclude_limit.rb +26 -0
- data/lib/rubocop/cop/force.rb +2 -1
- data/lib/rubocop/cop/gemspec/date_assignment.rb +57 -0
- data/lib/rubocop/cop/gemspec/duplicated_assignment.rb +6 -5
- data/lib/rubocop/cop/gemspec/ordered_dependencies.rb +3 -7
- data/lib/rubocop/cop/gemspec/required_ruby_version.rb +48 -20
- data/lib/rubocop/cop/gemspec/ruby_version_globals_usage.rb +4 -2
- data/lib/rubocop/cop/generator.rb +12 -22
- data/lib/rubocop/cop/generator/configuration_injector.rb +4 -5
- data/lib/rubocop/cop/generator/require_file_injector.rb +2 -5
- data/lib/rubocop/cop/ignored_node.rb +1 -3
- data/lib/rubocop/cop/internal_affairs.rb +7 -1
- data/lib/rubocop/cop/internal_affairs/empty_line_between_expect_offense_and_correction.rb +68 -0
- data/lib/rubocop/cop/internal_affairs/example_description.rb +92 -0
- data/lib/rubocop/cop/internal_affairs/method_name_equal.rb +8 -17
- data/lib/rubocop/cop/internal_affairs/node_destructuring.rb +4 -4
- data/lib/rubocop/cop/internal_affairs/node_matcher_directive.rb +151 -0
- data/lib/rubocop/cop/internal_affairs/node_type_predicate.rb +11 -14
- data/lib/rubocop/cop/internal_affairs/offense_location_keyword.rb +12 -10
- data/lib/rubocop/cop/internal_affairs/redundant_described_class_as_subject.rb +62 -0
- data/lib/rubocop/cop/internal_affairs/redundant_let_rubocop_config_new.rb +65 -0
- data/lib/rubocop/cop/internal_affairs/redundant_location_argument.rb +12 -7
- data/lib/rubocop/cop/internal_affairs/redundant_message_argument.rb +11 -8
- data/lib/rubocop/cop/internal_affairs/style_detected_api_use.rb +148 -0
- data/lib/rubocop/cop/internal_affairs/useless_message_assertion.rb +6 -6
- data/lib/rubocop/cop/layout/access_modifier_indentation.rb +12 -10
- data/lib/rubocop/cop/layout/argument_alignment.rb +36 -19
- data/lib/rubocop/cop/layout/array_alignment.rb +10 -8
- data/lib/rubocop/cop/layout/assignment_indentation.rb +8 -7
- data/lib/rubocop/cop/layout/begin_end_alignment.rb +74 -0
- data/lib/rubocop/cop/layout/block_alignment.rb +36 -44
- data/lib/rubocop/cop/layout/block_end_newline.rb +4 -8
- data/lib/rubocop/cop/layout/case_indentation.rb +72 -30
- data/lib/rubocop/cop/layout/class_structure.rb +62 -74
- data/lib/rubocop/cop/layout/closing_heredoc_indentation.rb +4 -6
- data/lib/rubocop/cop/layout/closing_parenthesis_indentation.rb +24 -30
- data/lib/rubocop/cop/layout/comment_indentation.rb +22 -26
- data/lib/rubocop/cop/layout/condition_position.rb +16 -8
- data/lib/rubocop/cop/layout/def_end_alignment.rb +9 -10
- data/lib/rubocop/cop/layout/dot_position.rb +26 -21
- data/lib/rubocop/cop/layout/else_alignment.rb +25 -11
- data/lib/rubocop/cop/layout/empty_comment.rb +29 -29
- data/lib/rubocop/cop/layout/empty_line_after_guard_clause.rb +51 -36
- data/lib/rubocop/cop/layout/empty_line_after_magic_comment.rb +13 -13
- data/lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb +136 -0
- data/lib/rubocop/cop/layout/empty_line_between_defs.rb +140 -40
- data/lib/rubocop/cop/layout/empty_lines.rb +7 -12
- data/lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb +29 -38
- data/lib/rubocop/cop/layout/empty_lines_around_arguments.rb +13 -9
- data/lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb +118 -0
- data/lib/rubocop/cop/layout/empty_lines_around_begin_body.rb +2 -5
- data/lib/rubocop/cop/layout/empty_lines_around_block_body.rb +2 -5
- data/lib/rubocop/cop/layout/empty_lines_around_class_body.rb +2 -5
- data/lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb +4 -14
- data/lib/rubocop/cop/layout/empty_lines_around_method_body.rb +2 -5
- data/lib/rubocop/cop/layout/empty_lines_around_module_body.rb +2 -5
- data/lib/rubocop/cop/layout/end_alignment.rb +24 -23
- data/lib/rubocop/cop/layout/end_of_line.rb +8 -8
- data/lib/rubocop/cop/layout/extra_spacing.rb +23 -42
- data/lib/rubocop/cop/layout/first_argument_indentation.rb +40 -13
- data/lib/rubocop/cop/layout/first_array_element_indentation.rb +13 -13
- data/lib/rubocop/cop/layout/first_array_element_line_break.rb +4 -8
- data/lib/rubocop/cop/layout/first_hash_element_indentation.rb +36 -20
- data/lib/rubocop/cop/layout/first_hash_element_line_break.rb +3 -7
- data/lib/rubocop/cop/layout/first_method_argument_line_break.rb +6 -13
- data/lib/rubocop/cop/layout/first_method_parameter_line_break.rb +3 -7
- data/lib/rubocop/cop/layout/first_parameter_indentation.rb +9 -8
- data/lib/rubocop/cop/layout/hash_alignment.rb +76 -57
- data/lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb +45 -29
- data/lib/rubocop/cop/layout/heredoc_indentation.rb +32 -116
- data/lib/rubocop/cop/layout/indentation_consistency.rb +9 -6
- data/lib/rubocop/cop/layout/indentation_style.rb +25 -32
- data/lib/rubocop/cop/layout/indentation_width.rb +34 -15
- data/lib/rubocop/cop/layout/initial_indentation.rb +7 -11
- data/lib/rubocop/cop/layout/leading_comment_space.rb +12 -10
- data/lib/rubocop/cop/layout/leading_empty_lines.rb +6 -11
- data/lib/rubocop/cop/layout/line_end_string_concatenation_indentation.rb +122 -0
- data/lib/rubocop/cop/layout/line_length.rb +37 -47
- data/lib/rubocop/cop/layout/multiline_array_brace_layout.rb +8 -11
- data/lib/rubocop/cop/layout/multiline_array_line_breaks.rb +3 -7
- data/lib/rubocop/cop/layout/multiline_assignment_layout.rb +38 -16
- data/lib/rubocop/cop/layout/multiline_block_layout.rb +41 -37
- data/lib/rubocop/cop/layout/multiline_hash_brace_layout.rb +8 -11
- data/lib/rubocop/cop/layout/multiline_hash_key_line_breaks.rb +3 -7
- data/lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb +6 -13
- data/lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb +8 -11
- data/lib/rubocop/cop/layout/multiline_method_call_indentation.rb +29 -18
- data/lib/rubocop/cop/layout/multiline_method_definition_brace_layout.rb +8 -11
- data/lib/rubocop/cop/layout/multiline_operation_indentation.rb +26 -12
- data/lib/rubocop/cop/layout/parameter_alignment.rb +8 -7
- data/lib/rubocop/cop/layout/redundant_line_break.rb +139 -0
- data/lib/rubocop/cop/layout/rescue_ensure_alignment.rb +37 -30
- data/lib/rubocop/cop/layout/single_line_block_chain.rb +53 -0
- data/lib/rubocop/cop/layout/space_after_colon.rb +10 -8
- data/lib/rubocop/cop/layout/space_after_comma.rb +2 -5
- data/lib/rubocop/cop/layout/space_after_method_name.rb +7 -10
- data/lib/rubocop/cop/layout/space_after_not.rb +9 -11
- data/lib/rubocop/cop/layout/space_after_semicolon.rb +2 -5
- data/lib/rubocop/cop/layout/space_around_block_parameters.rb +45 -52
- data/lib/rubocop/cop/layout/space_around_equals_in_parameter_default.rb +19 -23
- data/lib/rubocop/cop/layout/space_around_keyword.rb +50 -26
- data/lib/rubocop/cop/layout/space_around_method_call_operator.rb +34 -69
- data/lib/rubocop/cop/layout/space_around_operators.rb +51 -25
- data/lib/rubocop/cop/layout/space_before_block_braces.rb +39 -23
- data/lib/rubocop/cop/layout/space_before_brackets.rb +65 -0
- data/lib/rubocop/cop/layout/space_before_comma.rb +3 -5
- data/lib/rubocop/cop/layout/space_before_comment.rb +8 -9
- data/lib/rubocop/cop/layout/space_before_first_arg.rb +9 -15
- data/lib/rubocop/cop/layout/space_before_semicolon.rb +2 -5
- data/lib/rubocop/cop/layout/space_in_lambda_literal.rb +11 -21
- data/lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb +30 -39
- data/lib/rubocop/cop/layout/space_inside_array_percent_literal.rb +5 -15
- data/lib/rubocop/cop/layout/space_inside_block_braces.rb +32 -37
- data/lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb +22 -41
- data/lib/rubocop/cop/layout/space_inside_parens.rb +39 -22
- data/lib/rubocop/cop/layout/space_inside_percent_literal_delimiters.rb +5 -10
- data/lib/rubocop/cop/layout/space_inside_range_literal.rb +8 -17
- data/lib/rubocop/cop/layout/space_inside_reference_brackets.rb +18 -29
- data/lib/rubocop/cop/layout/space_inside_string_interpolation.rb +12 -13
- data/lib/rubocop/cop/layout/trailing_empty_lines.rb +10 -15
- data/lib/rubocop/cop/layout/trailing_whitespace.rb +42 -18
- data/lib/rubocop/cop/legacy/corrections_proxy.rb +43 -0
- data/lib/rubocop/cop/legacy/corrector.rb +27 -0
- data/lib/rubocop/cop/lint/ambiguous_assignment.rb +54 -0
- data/lib/rubocop/cop/lint/ambiguous_block_association.rb +21 -9
- data/lib/rubocop/cop/lint/ambiguous_operator.rb +53 -5
- data/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb +36 -6
- data/lib/rubocop/cop/lint/assignment_in_condition.rb +2 -2
- data/lib/rubocop/cop/lint/big_decimal_new.rb +10 -10
- data/lib/rubocop/cop/lint/binary_operator_with_identical_operands.rb +55 -0
- data/lib/rubocop/cop/lint/boolean_symbol.rb +21 -13
- data/lib/rubocop/cop/lint/circular_argument_reference.rb +1 -1
- data/lib/rubocop/cop/lint/constant_definition_in_block.rb +100 -0
- data/lib/rubocop/cop/lint/constant_resolution.rb +89 -0
- data/lib/rubocop/cop/lint/debugger.rb +61 -21
- data/lib/rubocop/cop/lint/deprecated_class_methods.rb +86 -47
- data/lib/rubocop/cop/lint/deprecated_constants.rb +80 -0
- data/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb +148 -0
- data/lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb +8 -2
- data/lib/rubocop/cop/lint/duplicate_branch.rb +155 -0
- data/lib/rubocop/cop/lint/duplicate_case_condition.rb +3 -13
- data/lib/rubocop/cop/lint/duplicate_elsif_condition.rb +39 -0
- data/lib/rubocop/cop/lint/duplicate_hash_key.rb +2 -4
- data/lib/rubocop/cop/lint/duplicate_methods.rb +12 -16
- data/lib/rubocop/cop/lint/duplicate_regexp_character_class_element.rb +77 -0
- data/lib/rubocop/cop/lint/duplicate_require.rb +47 -0
- data/lib/rubocop/cop/lint/duplicate_rescue_exception.rb +47 -0
- data/lib/rubocop/cop/lint/each_with_object_argument.rb +3 -1
- data/lib/rubocop/cop/lint/else_layout.rb +29 -5
- data/lib/rubocop/cop/lint/empty_block.rb +98 -0
- data/lib/rubocop/cop/lint/empty_class.rb +93 -0
- data/lib/rubocop/cop/lint/empty_conditional_body.rb +67 -0
- data/lib/rubocop/cop/lint/empty_ensure.rb +5 -7
- data/lib/rubocop/cop/lint/empty_expression.rb +2 -2
- data/lib/rubocop/cop/lint/empty_file.rb +48 -0
- data/lib/rubocop/cop/lint/empty_in_pattern.rb +62 -0
- data/lib/rubocop/cop/lint/empty_interpolation.rb +4 -7
- data/lib/rubocop/cop/lint/empty_when.rb +31 -8
- data/lib/rubocop/cop/lint/ensure_return.rb +29 -16
- data/lib/rubocop/cop/lint/erb_new_arguments.rb +18 -20
- data/lib/rubocop/cop/lint/flip_flop.rb +9 -3
- data/lib/rubocop/cop/lint/float_comparison.rb +93 -0
- data/lib/rubocop/cop/lint/float_out_of_range.rb +2 -3
- data/lib/rubocop/cop/lint/format_parameter_mismatch.rb +45 -10
- data/lib/rubocop/cop/lint/hash_compare_by_identity.rb +38 -0
- data/lib/rubocop/cop/lint/heredoc_method_call_position.rb +14 -16
- data/lib/rubocop/cop/lint/identity_comparison.rb +51 -0
- data/lib/rubocop/cop/lint/implicit_string_concatenation.rb +6 -6
- data/lib/rubocop/cop/lint/ineffective_access_modifier.rb +14 -20
- data/lib/rubocop/cop/lint/inherit_exception.rb +14 -9
- data/lib/rubocop/cop/lint/interpolation_check.rb +20 -7
- data/lib/rubocop/cop/lint/lambda_without_literal_block.rb +44 -0
- data/lib/rubocop/cop/lint/literal_as_condition.rb +37 -16
- data/lib/rubocop/cop/lint/literal_in_interpolation.rb +44 -15
- data/lib/rubocop/cop/lint/loop.rb +25 -5
- data/lib/rubocop/cop/lint/missing_cop_enable_directive.rb +35 -23
- data/lib/rubocop/cop/lint/missing_super.rb +101 -0
- data/lib/rubocop/cop/lint/mixed_regexp_capture_types.rb +36 -0
- data/lib/rubocop/cop/lint/multiple_comparison.rb +14 -14
- data/lib/rubocop/cop/lint/nested_method_definition.rb +19 -23
- data/lib/rubocop/cop/lint/nested_percent_literal.rb +18 -6
- data/lib/rubocop/cop/lint/next_without_accumulator.rb +2 -1
- data/lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb +58 -0
- data/lib/rubocop/cop/lint/non_deterministic_require_order.rb +95 -15
- data/lib/rubocop/cop/lint/non_local_exit_from_iterator.rb +12 -9
- data/lib/rubocop/cop/lint/number_conversion.rb +97 -23
- data/lib/rubocop/cop/lint/numbered_parameter_assignment.rb +47 -0
- data/lib/rubocop/cop/lint/or_assignment_to_constant.rb +39 -0
- data/lib/rubocop/cop/lint/ordered_magic_comments.rb +12 -15
- data/lib/rubocop/cop/lint/out_of_range_regexp_ref.rb +96 -0
- data/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb +31 -12
- data/lib/rubocop/cop/lint/percent_string_array.rb +6 -11
- data/lib/rubocop/cop/lint/percent_symbol_array.rb +13 -14
- data/lib/rubocop/cop/lint/raise_exception.rb +19 -7
- data/lib/rubocop/cop/lint/rand_one.rb +5 -4
- data/lib/rubocop/cop/lint/redundant_cop_disable_directive.rb +142 -115
- data/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb +44 -30
- data/lib/rubocop/cop/lint/redundant_dir_glob_sort.rb +50 -0
- data/lib/rubocop/cop/lint/redundant_require_statement.rb +9 -10
- data/lib/rubocop/cop/lint/redundant_safe_navigation.rb +77 -0
- data/lib/rubocop/cop/lint/redundant_splat_expansion.rb +72 -35
- data/lib/rubocop/cop/lint/redundant_string_coercion.rb +8 -15
- data/lib/rubocop/cop/lint/redundant_with_index.rb +13 -18
- data/lib/rubocop/cop/lint/redundant_with_object.rb +13 -18
- data/lib/rubocop/cop/lint/regexp_as_condition.rb +4 -2
- data/lib/rubocop/cop/lint/require_parentheses.rb +4 -6
- data/lib/rubocop/cop/lint/rescue_exception.rb +3 -4
- data/lib/rubocop/cop/lint/rescue_type.rb +10 -16
- data/lib/rubocop/cop/lint/return_in_void_context.rb +3 -6
- data/lib/rubocop/cop/lint/safe_navigation_chain.rb +5 -8
- data/lib/rubocop/cop/lint/safe_navigation_consistency.rb +15 -17
- data/lib/rubocop/cop/lint/safe_navigation_with_empty.rb +12 -4
- data/lib/rubocop/cop/lint/script_permission.rb +10 -7
- data/lib/rubocop/cop/lint/self_assignment.rb +78 -0
- data/lib/rubocop/cop/lint/send_with_mixin_argument.rb +11 -19
- data/lib/rubocop/cop/lint/shadowed_argument.rb +8 -14
- data/lib/rubocop/cop/lint/shadowed_exception.rb +18 -30
- data/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb +21 -7
- data/lib/rubocop/cop/lint/struct_new_override.rb +4 -3
- data/lib/rubocop/cop/lint/suppressed_exception.rb +53 -6
- data/lib/rubocop/cop/lint/symbol_conversion.rb +178 -0
- data/lib/rubocop/cop/lint/syntax.rb +11 -30
- data/lib/rubocop/cop/lint/to_enum_arguments.rb +89 -0
- data/lib/rubocop/cop/lint/to_json.rb +21 -13
- data/lib/rubocop/cop/lint/top_level_return_with_argument.rb +34 -0
- data/lib/rubocop/cop/lint/trailing_comma_in_attribute_declaration.rb +55 -0
- data/lib/rubocop/cop/lint/triple_quotes.rb +71 -0
- data/lib/rubocop/cop/lint/underscore_prefixed_variable_name.rb +5 -7
- data/lib/rubocop/cop/lint/unexpected_block_arity.rb +85 -0
- data/lib/rubocop/cop/lint/unified_integer.rb +5 -6
- data/lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb +204 -0
- data/lib/rubocop/cop/lint/unreachable_code.rb +5 -7
- data/lib/rubocop/cop/lint/unreachable_loop.rb +196 -0
- data/lib/rubocop/cop/lint/unused_block_argument.rb +18 -11
- data/lib/rubocop/cop/lint/unused_method_argument.rb +11 -6
- data/lib/rubocop/cop/lint/uri_escape_unescape.rb +5 -2
- data/lib/rubocop/cop/lint/uri_regexp.rb +12 -47
- data/lib/rubocop/cop/lint/useless_access_modifier.rb +38 -22
- data/lib/rubocop/cop/lint/useless_assignment.rb +10 -14
- data/lib/rubocop/cop/lint/useless_else_without_rescue.rb +7 -11
- data/lib/rubocop/cop/lint/useless_method_definition.rb +68 -0
- data/lib/rubocop/cop/lint/useless_setter_call.rb +12 -10
- data/lib/rubocop/cop/lint/useless_times.rb +109 -0
- data/lib/rubocop/cop/lint/void.rb +8 -19
- data/lib/rubocop/cop/message_annotator.rb +5 -4
- data/lib/rubocop/cop/metrics/abc_size.rb +26 -2
- data/lib/rubocop/cop/metrics/block_length.rb +40 -10
- data/lib/rubocop/cop/metrics/block_nesting.rb +5 -10
- data/lib/rubocop/cop/metrics/class_length.rb +40 -11
- data/lib/rubocop/cop/metrics/cyclomatic_complexity.rb +38 -6
- data/lib/rubocop/cop/metrics/method_length.rb +32 -4
- data/lib/rubocop/cop/metrics/module_length.rb +29 -9
- data/lib/rubocop/cop/metrics/parameter_lists.rb +74 -11
- data/lib/rubocop/cop/metrics/perceived_complexity.rb +7 -9
- data/lib/rubocop/cop/metrics/utils/abc_size_calculator.rb +76 -15
- data/lib/rubocop/cop/metrics/utils/code_length_calculator.rb +160 -0
- data/lib/rubocop/cop/metrics/utils/iterating_block.rb +61 -0
- data/lib/rubocop/cop/metrics/utils/repeated_attribute_discount.rb +143 -0
- data/lib/rubocop/cop/metrics/utils/repeated_csend_discount.rb +42 -0
- data/lib/rubocop/cop/migration/department_name.rb +25 -29
- data/lib/rubocop/cop/mixin/alignment.rb +18 -11
- data/lib/rubocop/cop/mixin/allowed_identifiers.rb +18 -0
- data/lib/rubocop/cop/mixin/allowed_methods.rb +21 -0
- data/lib/rubocop/cop/mixin/annotation_comment.rb +5 -0
- data/lib/rubocop/cop/mixin/array_min_size.rb +2 -4
- data/lib/rubocop/cop/mixin/auto_corrector.rb +12 -0
- data/lib/rubocop/cop/mixin/check_line_breakable.rb +51 -18
- data/lib/rubocop/cop/mixin/code_length.rb +29 -8
- data/lib/rubocop/cop/mixin/comments_help.rb +42 -0
- data/lib/rubocop/cop/mixin/configurable_enforced_style.rb +3 -5
- data/lib/rubocop/cop/mixin/configurable_formatting.rb +4 -11
- data/lib/rubocop/cop/mixin/configurable_max.rb +1 -0
- data/lib/rubocop/cop/mixin/configurable_naming.rb +2 -2
- data/lib/rubocop/cop/mixin/configurable_numbering.rb +4 -3
- data/lib/rubocop/cop/mixin/def_node.rb +3 -5
- data/lib/rubocop/cop/mixin/documentation_comment.rb +4 -7
- data/lib/rubocop/cop/mixin/empty_lines_around_body.rb +14 -14
- data/lib/rubocop/cop/mixin/empty_parameter.rb +2 -1
- data/lib/rubocop/cop/mixin/end_keyword_alignment.rb +11 -2
- data/lib/rubocop/cop/mixin/enforce_superclass.rb +16 -8
- data/lib/rubocop/cop/mixin/first_element_line_break.rb +3 -3
- data/lib/rubocop/cop/mixin/frozen_string_literal.rb +14 -5
- data/lib/rubocop/cop/mixin/gem_declaration.rb +13 -0
- data/lib/rubocop/cop/mixin/hash_alignment_styles.rb +17 -9
- data/lib/rubocop/cop/mixin/hash_transform_method.rb +48 -31
- data/lib/rubocop/cop/mixin/ignored_methods.rb +36 -3
- data/lib/rubocop/cop/mixin/ignored_pattern.rb +1 -1
- data/lib/rubocop/cop/mixin/interpolation.rb +1 -3
- data/lib/rubocop/cop/mixin/line_length_help.rb +17 -15
- data/lib/rubocop/cop/mixin/match_range.rb +2 -5
- data/lib/rubocop/cop/mixin/method_complexity.rb +21 -6
- data/lib/rubocop/cop/mixin/method_preference.rb +1 -2
- data/lib/rubocop/cop/mixin/multiline_element_indentation.rb +4 -3
- data/lib/rubocop/cop/mixin/multiline_element_line_breaks.rb +1 -1
- data/lib/rubocop/cop/mixin/multiline_expression_indentation.rb +13 -42
- data/lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb +14 -14
- data/lib/rubocop/cop/mixin/negative_conditional.rb +6 -4
- data/lib/rubocop/cop/mixin/nil_methods.rb +3 -5
- data/lib/rubocop/cop/mixin/ordered_gem_node.rb +7 -5
- data/lib/rubocop/cop/mixin/parentheses.rb +1 -2
- data/lib/rubocop/cop/mixin/percent_array.rb +14 -9
- data/lib/rubocop/cop/mixin/percent_literal.rb +0 -6
- data/lib/rubocop/cop/mixin/preceding_following_alignment.rb +6 -12
- data/lib/rubocop/cop/mixin/preferred_delimiters.rb +6 -9
- data/lib/rubocop/cop/mixin/range_help.rb +24 -13
- data/lib/rubocop/cop/mixin/rational_literal.rb +1 -0
- data/lib/rubocop/cop/mixin/rescue_node.rb +13 -7
- data/lib/rubocop/cop/mixin/safe_assignment.rb +6 -2
- data/lib/rubocop/cop/mixin/space_after_punctuation.rb +6 -7
- data/lib/rubocop/cop/mixin/space_before_punctuation.rb +5 -5
- data/lib/rubocop/cop/mixin/statement_modifier.rb +45 -23
- data/lib/rubocop/cop/mixin/string_help.rb +4 -1
- data/lib/rubocop/cop/mixin/string_literals_help.rb +3 -5
- data/lib/rubocop/cop/mixin/surrounding_space.rb +15 -31
- data/lib/rubocop/cop/mixin/symbol_help.rb +13 -0
- data/lib/rubocop/cop/mixin/target_ruby_version.rb +5 -1
- data/lib/rubocop/cop/mixin/trailing_body.rb +1 -2
- data/lib/rubocop/cop/mixin/trailing_comma.rb +12 -17
- data/lib/rubocop/cop/mixin/uncommunicative_name.rb +25 -32
- data/lib/rubocop/cop/mixin/unused_argument.rb +5 -9
- data/lib/rubocop/cop/mixin/visibility_help.rb +37 -0
- data/lib/rubocop/cop/naming/accessor_method_name.rb +19 -3
- data/lib/rubocop/cop/naming/ascii_identifiers.rb +29 -8
- data/lib/rubocop/cop/naming/binary_operator_parameter_name.rb +17 -7
- data/lib/rubocop/cop/naming/block_parameter_name.rb +1 -1
- data/lib/rubocop/cop/naming/class_and_module_camel_case.rb +13 -3
- data/lib/rubocop/cop/naming/constant_name.rb +4 -2
- data/lib/rubocop/cop/naming/file_name.rb +36 -34
- data/lib/rubocop/cop/naming/heredoc_delimiter_case.rb +12 -6
- data/lib/rubocop/cop/naming/heredoc_delimiter_naming.rb +3 -3
- data/lib/rubocop/cop/naming/inclusive_language.rb +249 -0
- data/lib/rubocop/cop/naming/memoized_instance_variable_name.rb +134 -26
- data/lib/rubocop/cop/naming/method_name.rb +6 -8
- data/lib/rubocop/cop/naming/method_parameter_name.rb +2 -2
- data/lib/rubocop/cop/naming/predicate_name.rb +10 -13
- data/lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb +59 -15
- data/lib/rubocop/cop/naming/variable_name.rb +3 -1
- data/lib/rubocop/cop/naming/variable_number.rb +94 -9
- data/lib/rubocop/cop/offense.rb +35 -12
- data/lib/rubocop/cop/registry.rb +87 -23
- data/lib/rubocop/cop/security/eval.rb +4 -2
- data/lib/rubocop/cop/security/json_load.rb +8 -8
- data/lib/rubocop/cop/security/marshal_load.rb +4 -4
- data/lib/rubocop/cop/security/open.rb +15 -11
- data/lib/rubocop/cop/security/yaml_load.rb +8 -6
- data/lib/rubocop/cop/severity.rb +4 -14
- data/lib/rubocop/cop/style/access_modifier_declarations.rb +15 -11
- data/lib/rubocop/cop/style/accessor_grouping.rb +150 -0
- data/lib/rubocop/cop/style/alias.rb +46 -45
- data/lib/rubocop/cop/style/and_or.rb +25 -17
- data/lib/rubocop/cop/style/arguments_forwarding.rb +143 -0
- data/lib/rubocop/cop/style/array_coercion.rb +69 -0
- data/lib/rubocop/cop/style/array_join.rb +9 -9
- data/lib/rubocop/cop/style/ascii_comments.rb +6 -7
- data/lib/rubocop/cop/style/attr.rb +15 -15
- data/lib/rubocop/cop/style/auto_resource_cleanup.rb +9 -12
- data/lib/rubocop/cop/style/bare_percent_literals.rb +12 -14
- data/lib/rubocop/cop/style/begin_block.rb +2 -2
- data/lib/rubocop/cop/style/bisected_attr_accessor.rb +125 -0
- data/lib/rubocop/cop/style/bisected_attr_accessor/macro.rb +60 -0
- data/lib/rubocop/cop/style/block_comments.rb +14 -18
- data/lib/rubocop/cop/style/block_delimiters.rb +41 -34
- data/lib/rubocop/cop/style/case_equality.rb +34 -6
- data/lib/rubocop/cop/style/case_like_if.rb +258 -0
- data/lib/rubocop/cop/style/character_literal.rb +12 -15
- data/lib/rubocop/cop/style/class_and_module_children.rb +57 -24
- data/lib/rubocop/cop/style/class_check.rb +6 -11
- data/lib/rubocop/cop/style/class_equality_comparison.rb +67 -0
- data/lib/rubocop/cop/style/class_methods.rb +8 -14
- data/lib/rubocop/cop/style/class_methods_definitions.rb +157 -0
- data/lib/rubocop/cop/style/class_vars.rb +23 -7
- data/lib/rubocop/cop/style/collection_compact.rb +91 -0
- data/lib/rubocop/cop/style/collection_methods.rb +22 -15
- data/lib/rubocop/cop/style/colon_method_call.rb +7 -9
- data/lib/rubocop/cop/style/colon_method_definition.rb +6 -6
- data/lib/rubocop/cop/style/combinable_loops.rb +92 -0
- data/lib/rubocop/cop/style/command_literal.rb +22 -28
- data/lib/rubocop/cop/style/comment_annotation.rb +73 -26
- data/lib/rubocop/cop/style/commented_keyword.rb +34 -21
- data/lib/rubocop/cop/style/conditional_assignment.rb +71 -87
- data/lib/rubocop/cop/style/constant_visibility.rb +31 -2
- data/lib/rubocop/cop/style/copyright.rb +20 -23
- data/lib/rubocop/cop/style/date_time.rb +16 -5
- data/lib/rubocop/cop/style/def_with_parentheses.rb +9 -12
- data/lib/rubocop/cop/style/dir.rb +11 -12
- data/lib/rubocop/cop/style/disable_cops_within_source_code_directive.rb +51 -13
- data/lib/rubocop/cop/style/document_dynamic_eval_definition.rb +169 -0
- data/lib/rubocop/cop/style/documentation.rb +50 -14
- data/lib/rubocop/cop/style/documentation_method.rb +2 -1
- data/lib/rubocop/cop/style/double_cop_disable_directive.rb +7 -16
- data/lib/rubocop/cop/style/double_negation.rb +50 -6
- data/lib/rubocop/cop/style/each_for_simple_loop.rb +7 -10
- data/lib/rubocop/cop/style/each_with_object.rb +17 -19
- data/lib/rubocop/cop/style/empty_block_parameter.rb +9 -10
- data/lib/rubocop/cop/style/empty_case_condition.rb +22 -26
- data/lib/rubocop/cop/style/empty_else.rb +14 -22
- data/lib/rubocop/cop/style/empty_lambda_parameter.rb +9 -10
- data/lib/rubocop/cop/style/empty_literal.rb +46 -31
- data/lib/rubocop/cop/style/empty_method.rb +12 -23
- data/lib/rubocop/cop/style/encoding.rb +6 -10
- data/lib/rubocop/cop/style/end_block.rb +5 -8
- data/lib/rubocop/cop/style/endless_method.rb +101 -0
- data/lib/rubocop/cop/style/eval_with_location.rb +143 -54
- data/lib/rubocop/cop/style/even_odd.rb +9 -11
- data/lib/rubocop/cop/style/expand_path_arguments.rb +25 -23
- data/lib/rubocop/cop/style/explicit_block_argument.rb +114 -0
- data/lib/rubocop/cop/style/exponential_notation.rb +15 -18
- data/lib/rubocop/cop/style/float_division.rb +60 -11
- data/lib/rubocop/cop/style/for.rb +7 -13
- data/lib/rubocop/cop/style/format_string.rb +28 -22
- data/lib/rubocop/cop/style/format_string_token.rb +78 -22
- data/lib/rubocop/cop/style/frozen_string_literal_comment.rb +24 -51
- data/lib/rubocop/cop/style/global_std_stream.rb +66 -0
- data/lib/rubocop/cop/style/global_vars.rb +2 -2
- data/lib/rubocop/cop/style/guard_clause.rb +32 -13
- data/lib/rubocop/cop/style/hash_as_last_array_item.rb +88 -0
- data/lib/rubocop/cop/style/hash_conversion.rb +133 -0
- data/lib/rubocop/cop/style/hash_each_methods.rb +26 -12
- data/lib/rubocop/cop/style/hash_except.rb +96 -0
- data/lib/rubocop/cop/style/hash_like_case.rb +77 -0
- data/lib/rubocop/cop/style/hash_syntax.rb +48 -41
- data/lib/rubocop/cop/style/hash_transform_keys.rb +23 -11
- data/lib/rubocop/cop/style/hash_transform_values.rb +22 -10
- data/lib/rubocop/cop/style/identical_conditional_branches.rb +64 -11
- data/lib/rubocop/cop/style/if_inside_else.rb +50 -2
- data/lib/rubocop/cop/style/if_unless_modifier.rb +58 -49
- data/lib/rubocop/cop/style/if_unless_modifier_of_if_unless.rb +11 -3
- data/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb +122 -0
- data/lib/rubocop/cop/style/if_with_semicolon.rb +51 -3
- data/lib/rubocop/cop/style/implicit_runtime_error.rb +3 -1
- data/lib/rubocop/cop/style/in_pattern_then.rb +56 -0
- data/lib/rubocop/cop/style/infinite_loop.rb +27 -26
- data/lib/rubocop/cop/style/inline_comment.rb +4 -4
- data/lib/rubocop/cop/style/inverse_methods.rb +28 -40
- data/lib/rubocop/cop/style/ip_addresses.rb +3 -4
- data/lib/rubocop/cop/style/keyword_parameters_order.rb +75 -0
- data/lib/rubocop/cop/style/lambda.rb +9 -16
- data/lib/rubocop/cop/style/lambda_call.rb +18 -35
- data/lib/rubocop/cop/style/line_end_concatenation.rb +21 -25
- data/lib/rubocop/cop/style/method_call_with_args_parentheses.rb +62 -13
- data/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb +53 -32
- data/lib/rubocop/cop/style/method_call_with_args_parentheses/require_parentheses.rb +8 -18
- data/lib/rubocop/cop/style/method_call_without_args_parentheses.rb +19 -12
- data/lib/rubocop/cop/style/method_called_on_do_end_block.rb +14 -7
- data/lib/rubocop/cop/style/method_def_parentheses.rb +18 -24
- data/lib/rubocop/cop/style/min_max.rb +10 -14
- data/lib/rubocop/cop/style/missing_else.rb +13 -25
- data/lib/rubocop/cop/style/missing_respond_to_missing.rb +11 -5
- data/lib/rubocop/cop/style/mixin_grouping.rb +26 -39
- data/lib/rubocop/cop/style/mixin_usage.rb +12 -30
- data/lib/rubocop/cop/style/module_function.rb +18 -19
- data/lib/rubocop/cop/style/multiline_block_chain.rb +13 -5
- data/lib/rubocop/cop/style/multiline_if_modifier.rb +3 -10
- data/lib/rubocop/cop/style/multiline_if_then.rb +5 -11
- data/lib/rubocop/cop/style/multiline_in_pattern_then.rb +62 -0
- data/lib/rubocop/cop/style/multiline_memoization.rb +15 -13
- data/lib/rubocop/cop/style/multiline_method_signature.rb +33 -3
- data/lib/rubocop/cop/style/multiline_ternary_operator.rb +32 -11
- data/lib/rubocop/cop/style/multiline_when_then.rb +25 -18
- data/lib/rubocop/cop/style/multiple_comparison.rb +77 -12
- data/lib/rubocop/cop/style/mutable_constant.rb +45 -37
- data/lib/rubocop/cop/style/negated_if.rb +10 -11
- data/lib/rubocop/cop/style/negated_if_else_condition.rb +128 -0
- data/lib/rubocop/cop/style/negated_unless.rb +10 -11
- data/lib/rubocop/cop/style/negated_while.rb +7 -15
- data/lib/rubocop/cop/style/nested_modifier.rb +10 -17
- data/lib/rubocop/cop/style/nested_parenthesized_calls.rb +20 -17
- data/lib/rubocop/cop/style/nested_ternary_operator.rb +30 -4
- data/lib/rubocop/cop/style/next.rb +16 -25
- data/lib/rubocop/cop/style/nil_comparison.rb +19 -11
- data/lib/rubocop/cop/style/nil_lambda.rb +70 -0
- data/lib/rubocop/cop/style/non_nil_check.rb +56 -34
- data/lib/rubocop/cop/style/not.rb +20 -26
- data/lib/rubocop/cop/style/numeric_literal_prefix.rb +6 -11
- data/lib/rubocop/cop/style/numeric_literals.rb +19 -27
- data/lib/rubocop/cop/style/numeric_predicate.rb +15 -23
- data/lib/rubocop/cop/style/one_line_conditional.rb +73 -28
- data/lib/rubocop/cop/style/option_hash.rb +3 -4
- data/lib/rubocop/cop/style/optional_arguments.rb +4 -7
- data/lib/rubocop/cop/style/optional_boolean_parameter.rb +53 -0
- data/lib/rubocop/cop/style/or_assignment.rb +11 -10
- data/lib/rubocop/cop/style/parallel_assignment.rb +27 -24
- data/lib/rubocop/cop/style/parentheses_around_condition.rb +7 -6
- data/lib/rubocop/cop/style/percent_literal_delimiters.rb +16 -24
- data/lib/rubocop/cop/style/percent_q_literals.rb +9 -12
- data/lib/rubocop/cop/style/perl_backrefs.rb +84 -16
- data/lib/rubocop/cop/style/preferred_hash_methods.rb +12 -18
- data/lib/rubocop/cop/style/proc.rb +8 -8
- data/lib/rubocop/cop/style/quoted_symbols.rb +110 -0
- data/lib/rubocop/cop/style/raise_args.rb +41 -37
- data/lib/rubocop/cop/style/random_with_offset.rb +30 -35
- data/lib/rubocop/cop/style/redundant_argument.rb +85 -0
- data/lib/rubocop/cop/style/redundant_assignment.rb +106 -0
- data/lib/rubocop/cop/style/redundant_begin.rb +79 -13
- data/lib/rubocop/cop/style/redundant_capital_w.rb +7 -11
- data/lib/rubocop/cop/style/redundant_condition.rb +28 -15
- data/lib/rubocop/cop/style/redundant_conditional.rb +13 -14
- data/lib/rubocop/cop/style/redundant_exception.rb +21 -16
- data/lib/rubocop/cop/style/redundant_fetch_block.rb +115 -0
- data/lib/rubocop/cop/style/redundant_file_extension_in_require.rb +52 -0
- data/lib/rubocop/cop/style/redundant_freeze.rb +16 -14
- data/lib/rubocop/cop/style/redundant_interpolation.rb +32 -27
- data/lib/rubocop/cop/style/redundant_parentheses.rb +51 -38
- data/lib/rubocop/cop/style/redundant_percent_q.rb +13 -16
- data/lib/rubocop/cop/style/redundant_regexp_character_class.rb +104 -0
- data/lib/rubocop/cop/style/redundant_regexp_escape.rb +118 -0
- data/lib/rubocop/cop/style/redundant_return.rb +24 -22
- data/lib/rubocop/cop/style/redundant_self.rb +46 -26
- data/lib/rubocop/cop/style/redundant_self_assignment.rb +118 -0
- data/lib/rubocop/cop/style/redundant_sort.rb +30 -35
- data/lib/rubocop/cop/style/redundant_sort_by.rb +6 -9
- data/lib/rubocop/cop/style/regexp_literal.rb +24 -30
- data/lib/rubocop/cop/style/rescue_modifier.rb +39 -12
- data/lib/rubocop/cop/style/rescue_standard_error.rb +25 -23
- data/lib/rubocop/cop/style/return_nil.rb +12 -7
- data/lib/rubocop/cop/style/safe_navigation.rb +44 -39
- data/lib/rubocop/cop/style/sample.rb +14 -15
- data/lib/rubocop/cop/style/self_assignment.rb +26 -22
- data/lib/rubocop/cop/style/semicolon.rb +10 -10
- data/lib/rubocop/cop/style/send.rb +5 -7
- data/lib/rubocop/cop/style/signal_exception.rb +32 -27
- data/lib/rubocop/cop/style/single_argument_dig.rb +55 -0
- data/lib/rubocop/cop/style/single_line_block_params.rb +34 -12
- data/lib/rubocop/cop/style/single_line_methods.rb +81 -19
- data/lib/rubocop/cop/style/slicing_with_range.rb +38 -0
- data/lib/rubocop/cop/style/sole_nested_conditional.rb +176 -0
- data/lib/rubocop/cop/style/special_global_vars.rb +21 -54
- data/lib/rubocop/cop/style/stabby_lambda_parentheses.rb +18 -22
- data/lib/rubocop/cop/style/static_class.rb +97 -0
- data/lib/rubocop/cop/style/stderr_puts.rb +9 -13
- data/lib/rubocop/cop/style/string_chars.rb +39 -0
- data/lib/rubocop/cop/style/string_concatenation.rb +169 -0
- data/lib/rubocop/cop/style/string_hash_keys.rb +8 -7
- data/lib/rubocop/cop/style/string_literals.rb +19 -15
- data/lib/rubocop/cop/style/string_literals_in_interpolation.rb +5 -3
- data/lib/rubocop/cop/style/string_methods.rb +7 -17
- data/lib/rubocop/cop/style/strip.rb +10 -14
- data/lib/rubocop/cop/style/struct_inheritance.rb +33 -4
- data/lib/rubocop/cop/style/swap_values.rb +108 -0
- data/lib/rubocop/cop/style/symbol_array.rb +11 -22
- data/lib/rubocop/cop/style/symbol_literal.rb +4 -8
- data/lib/rubocop/cop/style/symbol_proc.rb +50 -32
- data/lib/rubocop/cop/style/ternary_parentheses.rb +29 -33
- data/lib/rubocop/cop/style/top_level_method_definition.rb +83 -0
- data/lib/rubocop/cop/style/trailing_body_on_class.rb +3 -6
- data/lib/rubocop/cop/style/trailing_body_on_method_definition.rb +10 -9
- data/lib/rubocop/cop/style/trailing_body_on_module.rb +3 -6
- data/lib/rubocop/cop/style/trailing_comma_in_arguments.rb +5 -8
- data/lib/rubocop/cop/style/trailing_comma_in_array_literal.rb +5 -8
- data/lib/rubocop/cop/style/trailing_comma_in_block_args.rb +22 -24
- data/lib/rubocop/cop/style/trailing_comma_in_hash_literal.rb +5 -8
- data/lib/rubocop/cop/style/trailing_method_end_statement.rb +12 -38
- data/lib/rubocop/cop/style/trailing_underscore_variable.rb +16 -31
- data/lib/rubocop/cop/style/trivial_accessors.rb +101 -40
- data/lib/rubocop/cop/style/unless_else.rb +7 -11
- data/lib/rubocop/cop/style/unless_logical_operators.rb +105 -0
- data/lib/rubocop/cop/style/unpack_first.rb +7 -9
- data/lib/rubocop/cop/style/variable_interpolation.rb +8 -11
- data/lib/rubocop/cop/style/when_then.rb +7 -7
- data/lib/rubocop/cop/style/while_until_do.rb +6 -16
- data/lib/rubocop/cop/style/while_until_modifier.rb +16 -24
- data/lib/rubocop/cop/style/word_array.rb +6 -25
- data/lib/rubocop/cop/style/yoda_condition.rb +17 -18
- data/lib/rubocop/cop/style/zero_length_predicate.rb +25 -23
- data/lib/rubocop/cop/team.rb +147 -84
- data/lib/rubocop/cop/util.rb +43 -27
- data/lib/rubocop/cop/utils/format_string.rb +22 -9
- data/lib/rubocop/cop/variable_force.rb +11 -26
- data/lib/rubocop/cop/variable_force/assignment.rb +2 -2
- data/lib/rubocop/cop/variable_force/branch.rb +18 -9
- data/lib/rubocop/cop/variable_force/reference.rb +1 -3
- data/lib/rubocop/cop/variable_force/scope.rb +6 -9
- data/lib/rubocop/cop/variable_force/variable.rb +9 -12
- data/lib/rubocop/cop/variable_force/variable_table.rb +1 -1
- data/lib/rubocop/cops_documentation_generator.rb +270 -0
- data/lib/rubocop/core_ext/string.rb +2 -2
- data/lib/rubocop/directive_comment.rb +144 -0
- data/lib/rubocop/error.rb +1 -0
- data/lib/rubocop/ext/processed_source.rb +18 -0
- data/lib/rubocop/ext/regexp_node.rb +87 -0
- data/lib/rubocop/ext/regexp_parser.rb +92 -0
- data/lib/rubocop/file_finder.rb +12 -13
- data/lib/rubocop/formatter/auto_gen_config_formatter.rb +2 -1
- data/lib/rubocop/formatter/base_formatter.rb +0 -4
- data/lib/rubocop/formatter/clang_style_formatter.rb +4 -2
- data/lib/rubocop/formatter/disabled_config_formatter.rb +39 -30
- data/lib/rubocop/formatter/emacs_style_formatter.rb +2 -0
- data/lib/rubocop/formatter/formatter_set.rb +5 -5
- data/lib/rubocop/formatter/git_hub_actions_formatter.rb +44 -0
- data/lib/rubocop/formatter/html_formatter.rb +6 -10
- data/lib/rubocop/formatter/json_formatter.rb +1 -5
- data/lib/rubocop/formatter/junit_formatter.rb +34 -15
- data/lib/rubocop/formatter/offense_count_formatter.rb +2 -2
- data/lib/rubocop/formatter/progress_formatter.rb +3 -4
- data/lib/rubocop/formatter/quiet_formatter.rb +1 -1
- data/lib/rubocop/formatter/simple_text_formatter.rb +40 -7
- data/lib/rubocop/formatter/tap_formatter.rb +6 -2
- data/lib/rubocop/formatter/worst_offenders_formatter.rb +2 -2
- data/lib/rubocop/lockfile.rb +40 -0
- data/lib/rubocop/magic_comment.rb +33 -4
- data/lib/rubocop/name_similarity.rb +18 -10
- data/lib/rubocop/options.rb +126 -91
- data/lib/rubocop/path_util.rb +20 -22
- data/lib/rubocop/platform.rb +1 -1
- data/lib/rubocop/rake_task.rb +12 -11
- data/lib/rubocop/remote_config.rb +15 -11
- data/lib/rubocop/result_cache.rb +50 -31
- data/lib/rubocop/rspec/cop_helper.rb +11 -35
- data/lib/rubocop/rspec/expect_offense.rb +128 -39
- data/lib/rubocop/rspec/shared_contexts.rb +78 -32
- data/lib/rubocop/runner.rb +111 -74
- data/lib/rubocop/string_interpreter.rb +3 -0
- data/lib/rubocop/target_finder.rb +58 -48
- data/lib/rubocop/target_ruby.rb +126 -13
- data/lib/rubocop/util.rb +16 -0
- data/lib/rubocop/version.rb +71 -7
- data/lib/rubocop/yaml_duplication_checker.rb +1 -0
- metadata +189 -91
- data/bin/console +0 -10
- data/bin/setup +0 -7
- data/lib/rubocop/ast/builder.rb +0 -85
- data/lib/rubocop/ast/node.rb +0 -637
- data/lib/rubocop/ast/node/alias_node.rb +0 -24
- data/lib/rubocop/ast/node/and_node.rb +0 -29
- data/lib/rubocop/ast/node/args_node.rb +0 -29
- data/lib/rubocop/ast/node/array_node.rb +0 -70
- data/lib/rubocop/ast/node/block_node.rb +0 -121
- data/lib/rubocop/ast/node/break_node.rb +0 -17
- data/lib/rubocop/ast/node/case_match_node.rb +0 -56
- data/lib/rubocop/ast/node/case_node.rb +0 -56
- data/lib/rubocop/ast/node/class_node.rb +0 -31
- data/lib/rubocop/ast/node/def_node.rb +0 -82
- data/lib/rubocop/ast/node/defined_node.rb +0 -17
- data/lib/rubocop/ast/node/ensure_node.rb +0 -17
- data/lib/rubocop/ast/node/float_node.rb +0 -12
- data/lib/rubocop/ast/node/for_node.rb +0 -53
- data/lib/rubocop/ast/node/forward_args_node.rb +0 -18
- data/lib/rubocop/ast/node/hash_node.rb +0 -109
- data/lib/rubocop/ast/node/if_node.rb +0 -175
- data/lib/rubocop/ast/node/int_node.rb +0 -12
- data/lib/rubocop/ast/node/keyword_splat_node.rb +0 -45
- data/lib/rubocop/ast/node/mixin/basic_literal_node.rb +0 -16
- data/lib/rubocop/ast/node/mixin/binary_operator_node.rb +0 -43
- data/lib/rubocop/ast/node/mixin/collection_node.rb +0 -15
- data/lib/rubocop/ast/node/mixin/conditional_node.rb +0 -45
- data/lib/rubocop/ast/node/mixin/hash_element_node.rb +0 -125
- data/lib/rubocop/ast/node/mixin/method_dispatch_node.rb +0 -269
- data/lib/rubocop/ast/node/mixin/method_identifier_predicates.rb +0 -114
- data/lib/rubocop/ast/node/mixin/modifier_node.rb +0 -17
- data/lib/rubocop/ast/node/mixin/numeric_node.rb +0 -21
- data/lib/rubocop/ast/node/mixin/parameterized_node.rb +0 -61
- data/lib/rubocop/ast/node/mixin/predicate_operator_node.rb +0 -35
- data/lib/rubocop/ast/node/module_node.rb +0 -24
- data/lib/rubocop/ast/node/or_node.rb +0 -29
- data/lib/rubocop/ast/node/pair_node.rb +0 -63
- data/lib/rubocop/ast/node/range_node.rb +0 -18
- data/lib/rubocop/ast/node/regexp_node.rb +0 -33
- data/lib/rubocop/ast/node/resbody_node.rb +0 -24
- data/lib/rubocop/ast/node/retry_node.rb +0 -17
- data/lib/rubocop/ast/node/return_node.rb +0 -24
- data/lib/rubocop/ast/node/self_class_node.rb +0 -24
- data/lib/rubocop/ast/node/send_node.rb +0 -13
- data/lib/rubocop/ast/node/str_node.rb +0 -16
- data/lib/rubocop/ast/node/super_node.rb +0 -21
- data/lib/rubocop/ast/node/symbol_node.rb +0 -12
- data/lib/rubocop/ast/node/until_node.rb +0 -35
- data/lib/rubocop/ast/node/when_node.rb +0 -53
- data/lib/rubocop/ast/node/while_node.rb +0 -35
- data/lib/rubocop/ast/node/yield_node.rb +0 -21
- data/lib/rubocop/ast/sexp.rb +0 -16
- data/lib/rubocop/ast/traversal.rb +0 -202
- data/lib/rubocop/cop/lint/useless_comparison.rb +0 -28
- data/lib/rubocop/cop/mixin/classish_length.rb +0 -37
- data/lib/rubocop/cop/mixin/parser_diagnostic.rb +0 -37
- data/lib/rubocop/cop/mixin/too_many_lines.rb +0 -35
- data/lib/rubocop/cop/style/method_missing_super.rb +0 -34
- data/lib/rubocop/node_pattern.rb +0 -887
- data/lib/rubocop/processed_source.rb +0 -213
- data/lib/rubocop/string_util.rb +0 -14
- data/lib/rubocop/token.rb +0 -114
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca5a85edf6c093ecee74e82617e0c618424e907cbb6a71fb1f996492073a98e4
|
4
|
+
data.tar.gz: 1ceb28336ce8913d79d4260000f5a86ca93190f5e36f6809d690aa20559674fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c020a6c2b13ad36e18afac1a2293f7c30fec5d2d62a36f5f7ffea8887816985ec27b94295fba1e08f9f1b7f462c8b4ca28a4949a32baadcea17e15ff4181b0e3
|
7
|
+
data.tar.gz: 06e9a6431dc25b8152b0b380d4de434409579fcb0b66da5335b434798889fd8f6d6a58064a044595b1a45b2bad7830e8045011c7e20e64f1337ccdd11a04e29c
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,35 +1,35 @@
|
|
1
|
-
[![Gem Version](https://badge.fury.io/rb/rubocop.svg)](https://badge.fury.io/rb/rubocop)
|
2
|
-
[![CircleCI Status](https://circleci.com/gh/rubocop-hq/rubocop/tree/master.svg?style=svg)](https://circleci.com/gh/rubocop-hq/rubocop/tree/master)
|
3
|
-
[![AppVeyor Status](https://ci.appveyor.com/api/projects/status/sj3ye7n5690d0nvg?svg=true)](https://ci.appveyor.com/project/bbatsov/rubocop)
|
4
|
-
[![Coverage Status](https://api.codeclimate.com/v1/badges/ad6e76460499c8c99697/test_coverage)](https://codeclimate.com/github/bbatsov/rubocop)
|
5
|
-
[![Code Climate](https://codeclimate.com/github/bbatsov/rubocop/badges/gpa.svg)](https://codeclimate.com/github/bbatsov/rubocop)
|
6
|
-
[![Inline docs](https://inch-ci.org/github/bbatsov/rubocop.svg)](https://inch-ci.org/github/bbatsov/rubocop)
|
7
|
-
[![SemVer](https://api.dependabot.com/badges/compatibility_score?dependency-name=rubocop&package-manager=bundler&version-scheme=semver)](https://dependabot.com/compatibility-score.html?dependency-name=rubocop&package-manager=bundler&version-scheme=semver)
|
8
|
-
|
9
|
-
[![Patreon](https://img.shields.io/badge/patreon-donate-orange.svg)](https://www.patreon.com/bbatsov)
|
10
|
-
[![OpenCollective](https://opencollective.com/rubocop/backers/badge.svg)](#open-collective-backers)
|
11
|
-
[![OpenCollective](https://opencollective.com/rubocop/sponsors/badge.svg)](#open-collective-sponsors)
|
12
|
-
[![Tidelift](https://tidelift.com/badges/package/rubygems/rubocop)](https://tidelift.com/subscription/pkg/rubygems-rubocop?utm_source=rubygems-rubocop&utm_medium=referral&utm_campaign=readme)
|
13
|
-
|
14
1
|
<p align="center">
|
15
|
-
<img src="https://raw.githubusercontent.com/rubocop
|
2
|
+
<img src="https://raw.githubusercontent.com/rubocop/rubocop/master/logo/rubo-logo-horizontal.png" alt="RuboCop Logo"/>
|
16
3
|
</p>
|
17
4
|
|
5
|
+
----------
|
6
|
+
[![Ruby Style Guide](https://img.shields.io/badge/code_style-rubocop-brightgreen.svg)](https://github.com/rubocop/rubocop)
|
7
|
+
[![Gem Version](https://badge.fury.io/rb/rubocop.svg)](https://badge.fury.io/rb/rubocop)
|
8
|
+
[![CircleCI Status](https://circleci.com/gh/rubocop/rubocop/tree/master.svg?style=svg)](https://circleci.com/gh/rubocop/rubocop/tree/master)
|
9
|
+
[![Actions Status](https://github.com/rubocop/rubocop/workflows/CI/badge.svg?branch=master)](https://github.com/rubocop/rubocop/actions?query=workflow%3ACI)
|
10
|
+
[![Test Coverage](https://api.codeclimate.com/v1/badges/d2d67f728e88ea84ac69/test_coverage)](https://codeclimate.com/github/rubocop/rubocop/test_coverage)
|
11
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/d2d67f728e88ea84ac69/maintainability)](https://codeclimate.com/github/rubocop/rubocop/maintainability)
|
12
|
+
[![SemVer](https://api.dependabot.com/badges/compatibility_score?dependency-name=rubocop&package-manager=bundler&version-scheme=semver)](https://dependabot.com/compatibility-score.html?dependency-name=rubocop&package-manager=bundler&version-scheme=semver)
|
13
|
+
[![Discord](https://img.shields.io/badge/chat-on%20discord-7289da.svg?sanitize=true)](https://discord.gg/wJjWvGRDmm)
|
14
|
+
|
18
15
|
> Role models are important. <br/>
|
19
16
|
> -- Officer Alex J. Murphy / RoboCop
|
20
17
|
|
21
|
-
**RuboCop** is a Ruby static code analyzer and code formatter. Out of
|
22
|
-
|
23
|
-
|
24
|
-
|
18
|
+
**RuboCop** is a Ruby static code analyzer (a.k.a. `linter`) and code formatter. Out of the box it
|
19
|
+
will enforce many of the guidelines outlined in the community [Ruby Style
|
20
|
+
Guide](https://rubystyle.guide). Apart from reporting the problems discovered in your code,
|
21
|
+
RuboCop can also automatically fix many of them for you.
|
25
22
|
|
26
23
|
RuboCop is extremely flexible and most aspects of its behavior can be tweaked via various
|
27
|
-
[configuration options](https://github.com/rubocop
|
24
|
+
[configuration options](https://github.com/rubocop/rubocop/blob/master/config/default.yml).
|
28
25
|
|
29
|
-
|
30
|
-
|
26
|
+
----------
|
27
|
+
[![Patreon](https://img.shields.io/badge/patreon-donate-orange.svg)](https://www.patreon.com/bbatsov)
|
28
|
+
[![OpenCollective](https://opencollective.com/rubocop/backers/badge.svg)](#open-collective-backers)
|
29
|
+
[![OpenCollective](https://opencollective.com/rubocop/sponsors/badge.svg)](#open-collective-sponsors)
|
30
|
+
[![Tidelift](https://tidelift.com/badges/package/rubygems/rubocop)](https://tidelift.com/subscription/pkg/rubygems-rubocop?utm_source=rubygems-rubocop&utm_medium=referral&utm_campaign=readme)
|
31
31
|
|
32
|
-
|
32
|
+
Working on RuboCop is often fun, but it also requires a great deal of time and energy.
|
33
33
|
|
34
34
|
**Please consider [financially supporting its ongoing development](#funding).**
|
35
35
|
|
@@ -47,15 +47,18 @@ If you'd rather install RuboCop using `bundler`, add a line for it in your `Gemf
|
|
47
47
|
gem 'rubocop', require: false
|
48
48
|
```
|
49
49
|
|
50
|
-
RuboCop
|
51
|
-
|
52
|
-
|
53
|
-
might want to use a conservative version lock
|
50
|
+
RuboCop is stable between major versions, both in terms of API and cop configuration.
|
51
|
+
We aim to ease the maintenance of RuboCop extensions and the upgrades between RuboCop
|
52
|
+
releases. All big changes are reserved for major releases.
|
53
|
+
To prevent an unwanted RuboCop update you might want to use a conservative version lock
|
54
|
+
in your `Gemfile`:
|
54
55
|
|
55
56
|
```rb
|
56
|
-
gem 'rubocop', '~>
|
57
|
+
gem 'rubocop', '~> 1.18', require: false
|
57
58
|
```
|
58
59
|
|
60
|
+
See [our versioning policy](https://docs.rubocop.org/rubocop/versioning.html) for further details.
|
61
|
+
|
59
62
|
## Quickstart
|
60
63
|
|
61
64
|
Just type `rubocop` in a Ruby project's folder and watch the magic happen.
|
@@ -71,11 +74,30 @@ You can read a lot more about RuboCop in its [official docs](https://docs.ruboco
|
|
71
74
|
|
72
75
|
## Compatibility
|
73
76
|
|
74
|
-
RuboCop supports the following Ruby implementations:
|
77
|
+
RuboCop officially supports the following Ruby implementations:
|
75
78
|
|
76
|
-
* MRI 2.
|
79
|
+
* MRI 2.5+
|
77
80
|
* JRuby 9.2+
|
78
81
|
|
82
|
+
See the [compatibility documentation](https://docs.rubocop.org/rubocop/compatibility.html) for further details.
|
83
|
+
|
84
|
+
## Readme Badge
|
85
|
+
|
86
|
+
If you use RuboCop in your project, you can include one of these badges in your readme to let people know that your code is written following the community Ruby Style Guide.
|
87
|
+
|
88
|
+
[![Ruby Style Guide](https://img.shields.io/badge/code_style-rubocop-brightgreen.svg)](https://github.com/rubocop/rubocop)
|
89
|
+
|
90
|
+
[![Ruby Style Guide](https://img.shields.io/badge/code_style-community-brightgreen.svg)](https://rubystyle.guide)
|
91
|
+
|
92
|
+
|
93
|
+
Here are the Markdown snippets for the two badges:
|
94
|
+
|
95
|
+
``` markdown
|
96
|
+
[![Ruby Style Guide](https://img.shields.io/badge/code_style-rubocop-brightgreen.svg)](https://github.com/rubocop/rubocop)
|
97
|
+
|
98
|
+
[![Ruby Style Guide](https://img.shields.io/badge/code_style-community-brightgreen.svg)](https://rubystyle.guide)
|
99
|
+
```
|
100
|
+
|
79
101
|
## Team
|
80
102
|
|
81
103
|
Here's a list of RuboCop's core developers:
|
@@ -88,18 +110,23 @@ Here's a list of RuboCop's core developers:
|
|
88
110
|
* [Masataka Kuwabara](https://github.com/pocke)
|
89
111
|
* [Koichi Ito](https://github.com/koic)
|
90
112
|
* [Maxim Krizhanovski](https://github.com/darhazer)
|
113
|
+
* [Benjamin Quorning](https://github.com/bquorning)
|
114
|
+
* [Marc-André Lafortune](https://github.com/marcandre)
|
115
|
+
* [Daniel Vandersluis](https://github.com/dvandersluis)
|
116
|
+
|
117
|
+
See the [team page](https://docs.rubocop.org/rubocop/about/team.html) for more details.
|
91
118
|
|
92
119
|
## Logo
|
93
120
|
|
94
121
|
RuboCop's logo was created by [Dimiter Petrov](https://www.chadomoto.com/). You can find the logo in various
|
95
|
-
formats [here](https://github.com/rubocop
|
122
|
+
formats [here](https://github.com/rubocop/rubocop/tree/master/logo).
|
96
123
|
|
97
124
|
The logo is licensed under a
|
98
125
|
[Creative Commons Attribution-NonCommercial 4.0 International License](https://creativecommons.org/licenses/by-nc/4.0/deed.en_GB).
|
99
126
|
|
100
127
|
## Contributors
|
101
128
|
|
102
|
-
Here's a [list](https://github.com/rubocop
|
129
|
+
Here's a [list](https://github.com/rubocop/rubocop/graphs/contributors) of
|
103
130
|
all the people who have contributed to the development of RuboCop.
|
104
131
|
|
105
132
|
I'm extremely grateful to each and every one of them!
|
@@ -128,14 +155,19 @@ wide array of funding channels to account for your preferences
|
|
128
155
|
currently [Open Collective](https://opencollective.com/rubocop) is our
|
129
156
|
preferred funding platform).
|
130
157
|
|
131
|
-
If you're working in a company that's making significant use of RuboCop we'd appreciate it if you suggest to your company
|
132
|
-
to become a RuboCop sponsor
|
158
|
+
**If you're working in a company that's making significant use of RuboCop we'd appreciate it if you suggest to your company
|
159
|
+
to become a RuboCop sponsor.**
|
133
160
|
|
134
161
|
You can support the development of RuboCop via
|
135
|
-
[
|
162
|
+
[GitHub Sponsors](https://github.com/sponsors/bbatsov),
|
136
163
|
[Patreon](https://www.patreon.com/bbatsov),
|
137
|
-
[PayPal](https://paypal.me/bbatsov)
|
138
|
-
|
164
|
+
[PayPal](https://paypal.me/bbatsov),
|
165
|
+
[Open Collective](https://opencollective.com/rubocop)
|
166
|
+
and [Tidelift](https://tidelift.com/subscription/pkg/rubygems-rubocop?utm_source=rubygems-rubocop&utm_medium=referral&utm_campaign=readme)
|
167
|
+
.
|
168
|
+
|
169
|
+
**Note:** If doing a sponsorship in the form of donation is problematic for your company from an accounting standpoint, we'd recommend
|
170
|
+
the use of Tidelift, where you can get a support-like subscription instead.
|
139
171
|
|
140
172
|
### Open Collective Backers
|
141
173
|
|
@@ -213,5 +245,5 @@ RuboCop's changelog is available [here](CHANGELOG.md).
|
|
213
245
|
|
214
246
|
## Copyright
|
215
247
|
|
216
|
-
Copyright (c) 2012-
|
248
|
+
Copyright (c) 2012-2021 Bozhidar Batsov. See [LICENSE.txt](LICENSE.txt) for
|
217
249
|
further details.
|
data/assets/output.html.erb
CHANGED
@@ -254,7 +254,7 @@
|
|
254
254
|
<% end %>
|
255
255
|
</div>
|
256
256
|
<footer>
|
257
|
-
Generated by <a href="https://github.com/rubocop
|
257
|
+
Generated by <a href="https://github.com/rubocop/rubocop">RuboCop</a>
|
258
258
|
<span class="version"><%= RuboCop::Version::STRING %></span>
|
259
259
|
</footer>
|
260
260
|
</body>
|
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,6 +54,7 @@ AllCops:
|
|
53
54
|
- '**/Podfile'
|
54
55
|
- '**/Puppetfile'
|
55
56
|
- '**/Rakefile'
|
57
|
+
- '**/rakefile'
|
56
58
|
- '**/Snapfile'
|
57
59
|
- '**/Steepfile'
|
58
60
|
- '**/Thorfile'
|
@@ -115,6 +117,8 @@ AllCops:
|
|
115
117
|
# CacheRootDirectory is ~ (nil), which it is by default, the root will be
|
116
118
|
# taken from the environment variable `$XDG_CACHE_HOME` if it is set, or if
|
117
119
|
# `$XDG_CACHE_HOME` is not set, it will be `$HOME/.cache/`.
|
120
|
+
# The CacheRootDirectory can be overwritten by passing the `--cache-root` command
|
121
|
+
# line option or by setting `$RUBOCOP_CACHE_ROOT` environment variable.
|
118
122
|
CacheRootDirectory: ~
|
119
123
|
# It is possible for a malicious user to know the location of RuboCop's cache
|
120
124
|
# directory by looking at CacheRootDirectory, and create a symlink in its
|
@@ -126,15 +130,26 @@ AllCops:
|
|
126
130
|
# What MRI version of the Ruby interpreter is the inspected code intended to
|
127
131
|
# run on? (If there is more than one, set this to the lowest version.)
|
128
132
|
# If a value is specified for TargetRubyVersion then it is used. Acceptable
|
129
|
-
# values are specificed as a float (i.e.
|
133
|
+
# values are specificed as a float (i.e. 3.0); the teeny version of Ruby
|
130
134
|
# should not be included. If the project specifies a Ruby version in the
|
131
|
-
# .ruby-version
|
132
|
-
# the desired version of Ruby by inspecting the
|
133
|
-
#
|
134
|
-
#
|
135
|
-
# from the lock file.) If the
|
136
|
-
#
|
135
|
+
# .tool-versions or .ruby-version files, Gemfile or gems.rb file, RuboCop will
|
136
|
+
# try to determine the desired version of Ruby by inspecting the
|
137
|
+
# .tool-versions file first, then .ruby-version, followed by the Gemfile.lock
|
138
|
+
# or gems.locked file. (Although the Ruby version is specified in the Gemfile
|
139
|
+
# or gems.rb file, RuboCop reads the final value from the lock file.) If the
|
140
|
+
# Ruby version is still unresolved, RuboCop will use the oldest officially
|
141
|
+
# supported Ruby version (currently Ruby 2.5).
|
137
142
|
TargetRubyVersion: ~
|
143
|
+
# Determines if a notification for extension libraries should be shown when
|
144
|
+
# rubocop is run. Keys are the name of the extension, and values are an array
|
145
|
+
# of gems in the Gemfile that the extension is suggested for, if not already
|
146
|
+
# included.
|
147
|
+
SuggestExtensions:
|
148
|
+
rubocop-rails: [rails]
|
149
|
+
rubocop-rspec: [rspec, rspec-rails]
|
150
|
+
rubocop-minitest: [minitest]
|
151
|
+
rubocop-sequel: [sequel]
|
152
|
+
rubocop-rake: [rake]
|
138
153
|
|
139
154
|
#################### Bundler ###############################
|
140
155
|
|
@@ -151,12 +166,27 @@ Bundler/GemComment:
|
|
151
166
|
Description: 'Add a comment describing each gem.'
|
152
167
|
Enabled: false
|
153
168
|
VersionAdded: '0.59'
|
154
|
-
VersionChanged: '0.
|
169
|
+
VersionChanged: '0.85'
|
155
170
|
Include:
|
156
171
|
- '**/*.gemfile'
|
157
172
|
- '**/Gemfile'
|
158
173
|
- '**/gems.rb'
|
159
174
|
IgnoredGems: []
|
175
|
+
OnlyFor: []
|
176
|
+
|
177
|
+
Bundler/GemVersion:
|
178
|
+
Description: 'Requires or forbids specifying gem versions.'
|
179
|
+
Enabled: false
|
180
|
+
VersionAdded: '1.14'
|
181
|
+
EnforcedStyle: 'required'
|
182
|
+
SupportedStyles:
|
183
|
+
- 'required'
|
184
|
+
- 'forbidden'
|
185
|
+
Include:
|
186
|
+
- '**/*.gemfile'
|
187
|
+
- '**/Gemfile'
|
188
|
+
- '**/gems.rb'
|
189
|
+
AllowedGems: []
|
160
190
|
|
161
191
|
Bundler/InsecureProtocolSource:
|
162
192
|
Description: >-
|
@@ -177,6 +207,9 @@ Bundler/OrderedGems:
|
|
177
207
|
VersionAdded: '0.46'
|
178
208
|
VersionChanged: '0.47'
|
179
209
|
TreatCommentsAsGroupSeparators: true
|
210
|
+
# By default, "-" and "_" are ignored for order purposes.
|
211
|
+
# This can be overridden by setting this parameter to true.
|
212
|
+
ConsiderPunctuation: false
|
180
213
|
Include:
|
181
214
|
- '**/*.gemfile'
|
182
215
|
- '**/Gemfile'
|
@@ -184,6 +217,13 @@ Bundler/OrderedGems:
|
|
184
217
|
|
185
218
|
#################### Gemspec ###############################
|
186
219
|
|
220
|
+
Gemspec/DateAssignment:
|
221
|
+
Description: 'Checks that `date =` is not used in gemspec file, it is set automatically when the gem is packaged.'
|
222
|
+
Enabled: pending
|
223
|
+
VersionAdded: '1.10'
|
224
|
+
Include:
|
225
|
+
- '**/*.gemspec'
|
226
|
+
|
187
227
|
Gemspec/DuplicatedAssignment:
|
188
228
|
Description: 'An attribute assignment method calls should be listed only once in a gemspec.'
|
189
229
|
Enabled: true
|
@@ -197,13 +237,17 @@ Gemspec/OrderedDependencies:
|
|
197
237
|
Enabled: true
|
198
238
|
VersionAdded: '0.51'
|
199
239
|
TreatCommentsAsGroupSeparators: true
|
240
|
+
# By default, "-" and "_" are ignored for order purposes.
|
241
|
+
# This can be overridden by setting this parameter to true.
|
242
|
+
ConsiderPunctuation: false
|
200
243
|
Include:
|
201
244
|
- '**/*.gemspec'
|
202
245
|
|
203
246
|
Gemspec/RequiredRubyVersion:
|
204
|
-
Description: 'Checks that `required_ruby_version` of gemspec and `TargetRubyVersion` of .rubocop.yml
|
247
|
+
Description: 'Checks that `required_ruby_version` of gemspec is specified and equal to `TargetRubyVersion` of .rubocop.yml.'
|
205
248
|
Enabled: true
|
206
249
|
VersionAdded: '0.52'
|
250
|
+
VersionChanged: '0.89'
|
207
251
|
Include:
|
208
252
|
- '**/*.gemspec'
|
209
253
|
|
@@ -226,8 +270,8 @@ Layout/AccessModifierIndentation:
|
|
226
270
|
SupportedStyles:
|
227
271
|
- outdent
|
228
272
|
- indent
|
229
|
-
# By default
|
230
|
-
#
|
273
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
274
|
+
# but it can be overridden by setting this parameter.
|
231
275
|
IndentationWidth: ~
|
232
276
|
|
233
277
|
Layout/ArgumentAlignment:
|
@@ -255,8 +299,8 @@ Layout/ArgumentAlignment:
|
|
255
299
|
SupportedStyles:
|
256
300
|
- with_first_argument
|
257
301
|
- with_fixed_indentation
|
258
|
-
# By default
|
259
|
-
#
|
302
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
303
|
+
# but it can be overridden by setting this parameter.
|
260
304
|
IndentationWidth: ~
|
261
305
|
|
262
306
|
Layout/ArrayAlignment:
|
@@ -284,8 +328,8 @@ Layout/ArrayAlignment:
|
|
284
328
|
SupportedStyles:
|
285
329
|
- with_first_element
|
286
330
|
- with_fixed_indentation
|
287
|
-
# By default
|
288
|
-
#
|
331
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
332
|
+
# but it can be overridden by setting this parameter.
|
289
333
|
IndentationWidth: ~
|
290
334
|
|
291
335
|
Layout/AssignmentIndentation:
|
@@ -295,10 +339,23 @@ Layout/AssignmentIndentation:
|
|
295
339
|
Enabled: true
|
296
340
|
VersionAdded: '0.49'
|
297
341
|
VersionChanged: '0.77'
|
298
|
-
# By default
|
299
|
-
#
|
342
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
343
|
+
# but it can be overridden by setting this parameter.
|
300
344
|
IndentationWidth: ~
|
301
345
|
|
346
|
+
Layout/BeginEndAlignment:
|
347
|
+
Description: 'Align ends corresponding to begins correctly.'
|
348
|
+
Enabled: true
|
349
|
+
VersionAdded: '0.91'
|
350
|
+
# The value `start_of_line` means that `end` should be aligned the start of the line
|
351
|
+
# where the `begin` keyword is.
|
352
|
+
# The value `begin` means that `end` should be aligned with the `begin` keyword.
|
353
|
+
EnforcedStyleAlignWith: start_of_line
|
354
|
+
SupportedStylesAlignWith:
|
355
|
+
- start_of_line
|
356
|
+
- begin
|
357
|
+
Severity: warning
|
358
|
+
|
302
359
|
Layout/BlockAlignment:
|
303
360
|
Description: 'Align block ends correctly.'
|
304
361
|
Enabled: true
|
@@ -320,18 +377,19 @@ Layout/BlockEndNewline:
|
|
320
377
|
VersionAdded: '0.49'
|
321
378
|
|
322
379
|
Layout/CaseIndentation:
|
323
|
-
Description: 'Indentation of when in a case/when/[else/]end.'
|
380
|
+
Description: 'Indentation of when in a case/(when|in)/[else/]end.'
|
324
381
|
StyleGuide: '#indent-when-to-case'
|
325
382
|
Enabled: true
|
326
383
|
VersionAdded: '0.49'
|
384
|
+
VersionChanged: '1.16'
|
327
385
|
EnforcedStyle: case
|
328
386
|
SupportedStyles:
|
329
387
|
- case
|
330
388
|
- end
|
331
389
|
IndentOneStep: false
|
332
|
-
# By default
|
333
|
-
#
|
334
|
-
# This only matters if `IndentOneStep` is `true
|
390
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
391
|
+
# but it can be overridden by setting this parameter.
|
392
|
+
# This only matters if `IndentOneStep` is `true`.
|
335
393
|
IndentationWidth: ~
|
336
394
|
|
337
395
|
Layout/ClassStructure:
|
@@ -375,6 +433,7 @@ Layout/ConditionPosition:
|
|
375
433
|
StyleGuide: '#same-line-condition'
|
376
434
|
Enabled: true
|
377
435
|
VersionAdded: '0.53'
|
436
|
+
VersionChanged: '0.83'
|
378
437
|
|
379
438
|
Layout/DefEndAlignment:
|
380
439
|
Description: 'Align ends corresponding to defs correctly.'
|
@@ -388,7 +447,6 @@ Layout/DefEndAlignment:
|
|
388
447
|
SupportedStylesAlignWith:
|
389
448
|
- start_of_line
|
390
449
|
- def
|
391
|
-
AutoCorrect: false
|
392
450
|
Severity: warning
|
393
451
|
|
394
452
|
Layout/DotPosition:
|
@@ -425,11 +483,23 @@ Layout/EmptyLineAfterMagicComment:
|
|
425
483
|
Enabled: true
|
426
484
|
VersionAdded: '0.49'
|
427
485
|
|
486
|
+
Layout/EmptyLineAfterMultilineCondition:
|
487
|
+
Description: 'Enforces empty line after multiline condition.'
|
488
|
+
# This is disabled, because this style is not very common in practice.
|
489
|
+
Enabled: false
|
490
|
+
VersionAdded: '0.90'
|
491
|
+
Reference:
|
492
|
+
- https://github.com/airbnb/ruby#multiline-if-newline
|
493
|
+
|
428
494
|
Layout/EmptyLineBetweenDefs:
|
429
|
-
Description: 'Use empty lines between defs.'
|
495
|
+
Description: 'Use empty lines between class/module/method defs.'
|
430
496
|
StyleGuide: '#empty-lines-between-methods'
|
431
497
|
Enabled: true
|
432
498
|
VersionAdded: '0.49'
|
499
|
+
VersionChanged: '1.7'
|
500
|
+
EmptyLineBetweenMethodDefs: true
|
501
|
+
EmptyLineBetweenClassDefs: true
|
502
|
+
EmptyLineBetweenModuleDefs: true
|
433
503
|
# If `true`, this parameter means that single line method definitions don't
|
434
504
|
# need an empty line between them.
|
435
505
|
AllowAdjacentOneLineDefs: false
|
@@ -460,6 +530,19 @@ Layout/EmptyLinesAroundArguments:
|
|
460
530
|
Enabled: true
|
461
531
|
VersionAdded: '0.52'
|
462
532
|
|
533
|
+
Layout/EmptyLinesAroundAttributeAccessor:
|
534
|
+
Description: "Keep blank lines around attribute accessors."
|
535
|
+
StyleGuide: '#empty-lines-around-attribute-accessor'
|
536
|
+
Enabled: true
|
537
|
+
VersionAdded: '0.83'
|
538
|
+
VersionChanged: '0.84'
|
539
|
+
AllowAliasSyntax: true
|
540
|
+
AllowedMethods:
|
541
|
+
- alias_method
|
542
|
+
- public
|
543
|
+
- protected
|
544
|
+
- private
|
545
|
+
|
463
546
|
Layout/EmptyLinesAroundBeginBody:
|
464
547
|
Description: "Keeps track of empty lines around begin-end bodies."
|
465
548
|
StyleGuide: '#empty-lines-around-bodies'
|
@@ -531,7 +614,6 @@ Layout/EndAlignment:
|
|
531
614
|
- keyword
|
532
615
|
- variable
|
533
616
|
- start_of_line
|
534
|
-
AutoCorrect: false
|
535
617
|
Severity: warning
|
536
618
|
|
537
619
|
Layout/EndOfLine:
|
@@ -584,8 +666,8 @@ Layout/FirstArgumentIndentation:
|
|
584
666
|
# Same as `special_for_inner_method_call` except that the special rule only
|
585
667
|
# applies if the outer method call encloses its arguments in parentheses.
|
586
668
|
- special_for_inner_method_call_in_parentheses
|
587
|
-
# By default
|
588
|
-
#
|
669
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
670
|
+
# but it can be overridden by setting this parameter.
|
589
671
|
IndentationWidth: ~
|
590
672
|
|
591
673
|
Layout/FirstArrayElementIndentation:
|
@@ -611,8 +693,8 @@ Layout/FirstArrayElementIndentation:
|
|
611
693
|
- special_inside_parentheses
|
612
694
|
- consistent
|
613
695
|
- align_brackets
|
614
|
-
# By default
|
615
|
-
#
|
696
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
697
|
+
# but it can be overridden by setting this parameter.
|
616
698
|
IndentationWidth: ~
|
617
699
|
|
618
700
|
Layout/FirstArrayElementLineBreak:
|
@@ -643,8 +725,8 @@ Layout/FirstHashElementIndentation:
|
|
643
725
|
- special_inside_parentheses
|
644
726
|
- consistent
|
645
727
|
- align_braces
|
646
|
-
# By default
|
647
|
-
#
|
728
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
729
|
+
# but it can be overridden by setting this parameter.
|
648
730
|
IndentationWidth: ~
|
649
731
|
|
650
732
|
Layout/FirstHashElementLineBreak:
|
@@ -679,8 +761,8 @@ Layout/FirstParameterIndentation:
|
|
679
761
|
SupportedStyles:
|
680
762
|
- consistent
|
681
763
|
- align_parentheses
|
682
|
-
# By default
|
683
|
-
#
|
764
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
765
|
+
# but it can be overridden by setting this parameter.
|
684
766
|
IndentationWidth: ~
|
685
767
|
|
686
768
|
Layout/HashAlignment:
|
@@ -690,7 +772,7 @@ Layout/HashAlignment:
|
|
690
772
|
Enabled: true
|
691
773
|
AllowMultipleStyles: true
|
692
774
|
VersionAdded: '0.49'
|
693
|
-
VersionChanged: '
|
775
|
+
VersionChanged: '1.16'
|
694
776
|
# Alignment of entries using hash rocket as separator. Valid values are:
|
695
777
|
#
|
696
778
|
# key - left alignment of keys
|
@@ -774,13 +856,7 @@ Layout/HeredocIndentation:
|
|
774
856
|
StyleGuide: '#squiggly-heredocs'
|
775
857
|
Enabled: true
|
776
858
|
VersionAdded: '0.49'
|
777
|
-
VersionChanged: '0.
|
778
|
-
EnforcedStyle: squiggly
|
779
|
-
SupportedStyles:
|
780
|
-
- squiggly
|
781
|
-
- active_support
|
782
|
-
- powerpack
|
783
|
-
- unindent
|
859
|
+
VersionChanged: '0.85'
|
784
860
|
|
785
861
|
Layout/IndentationConsistency:
|
786
862
|
Description: 'Keep indentation straight.'
|
@@ -807,8 +883,8 @@ Layout/IndentationStyle:
|
|
807
883
|
Enabled: true
|
808
884
|
VersionAdded: '0.49'
|
809
885
|
VersionChanged: '0.82'
|
810
|
-
# By default
|
811
|
-
#
|
886
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
887
|
+
# but it can be overridden by setting this parameter.
|
812
888
|
# It is used during auto-correction to determine how many spaces should
|
813
889
|
# replace each tab.
|
814
890
|
IndentationWidth: ~
|
@@ -847,14 +923,28 @@ Layout/LeadingEmptyLines:
|
|
847
923
|
VersionAdded: '0.57'
|
848
924
|
VersionChanged: '0.77'
|
849
925
|
|
926
|
+
Layout/LineEndStringConcatenationIndentation:
|
927
|
+
Description: >-
|
928
|
+
Checks the indentation of the next line after a line that
|
929
|
+
ends with a string literal and a backslash.
|
930
|
+
Enabled: pending
|
931
|
+
VersionAdded: '1.18'
|
932
|
+
EnforcedStyle: aligned
|
933
|
+
SupportedStyles:
|
934
|
+
- aligned
|
935
|
+
- indented
|
936
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
937
|
+
# but it can be overridden by setting this parameter.
|
938
|
+
IndentationWidth: ~
|
939
|
+
|
850
940
|
Layout/LineLength:
|
851
|
-
Description: '
|
852
|
-
StyleGuide: '#
|
941
|
+
Description: 'Checks that line length does not exceed the configured limit.'
|
942
|
+
StyleGuide: '#max-line-length'
|
853
943
|
Enabled: true
|
854
944
|
VersionAdded: '0.25'
|
855
|
-
VersionChanged: '
|
856
|
-
AutoCorrect:
|
857
|
-
Max:
|
945
|
+
VersionChanged: '1.4'
|
946
|
+
AutoCorrect: true
|
947
|
+
Max: 120
|
858
948
|
# To make it possible to copy or click on URIs in the code, we allow lines
|
859
949
|
# containing a URI to be longer than Max.
|
860
950
|
AllowHeredoc: true
|
@@ -977,8 +1067,8 @@ Layout/MultilineMethodCallIndentation:
|
|
977
1067
|
- aligned
|
978
1068
|
- indented
|
979
1069
|
- indented_relative_to_receiver
|
980
|
-
# By default
|
981
|
-
#
|
1070
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
1071
|
+
# but it can be overridden by setting this parameter.
|
982
1072
|
IndentationWidth: ~
|
983
1073
|
|
984
1074
|
Layout/MultilineMethodDefinitionBraceLayout:
|
@@ -1007,8 +1097,8 @@ Layout/MultilineOperationIndentation:
|
|
1007
1097
|
SupportedStyles:
|
1008
1098
|
- aligned
|
1009
1099
|
- indented
|
1010
|
-
# By default
|
1011
|
-
#
|
1100
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
1101
|
+
# but it can be overridden by setting this parameter.
|
1012
1102
|
IndentationWidth: ~
|
1013
1103
|
|
1014
1104
|
Layout/ParameterAlignment:
|
@@ -1036,15 +1126,28 @@ Layout/ParameterAlignment:
|
|
1036
1126
|
SupportedStyles:
|
1037
1127
|
- with_first_parameter
|
1038
1128
|
- with_fixed_indentation
|
1039
|
-
# By default
|
1040
|
-
#
|
1129
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
1130
|
+
# but it can be overridden by setting this parameter.
|
1041
1131
|
IndentationWidth: ~
|
1042
1132
|
|
1133
|
+
Layout/RedundantLineBreak:
|
1134
|
+
Description: >-
|
1135
|
+
Do not break up an expression into multiple lines when it fits
|
1136
|
+
on a single line.
|
1137
|
+
Enabled: false
|
1138
|
+
InspectBlocks: false
|
1139
|
+
VersionAdded: '1.13'
|
1140
|
+
|
1043
1141
|
Layout/RescueEnsureAlignment:
|
1044
1142
|
Description: 'Align rescues and ensures correctly.'
|
1045
1143
|
Enabled: true
|
1046
1144
|
VersionAdded: '0.49'
|
1047
1145
|
|
1146
|
+
Layout/SingleLineBlockChain:
|
1147
|
+
Description: 'Put method call on a separate line if chained to a single line block.'
|
1148
|
+
Enabled: false
|
1149
|
+
VersionAdded: '1.14'
|
1150
|
+
|
1048
1151
|
Layout/SpaceAfterColon:
|
1049
1152
|
Description: 'Use spaces after colons.'
|
1050
1153
|
StyleGuide: '#spaces-operators'
|
@@ -1106,7 +1209,7 @@ Layout/SpaceAroundKeyword:
|
|
1106
1209
|
|
1107
1210
|
Layout/SpaceAroundMethodCallOperator:
|
1108
1211
|
Description: 'Checks method call operators to not have spaces around them.'
|
1109
|
-
Enabled:
|
1212
|
+
Enabled: true
|
1110
1213
|
VersionAdded: '0.82'
|
1111
1214
|
|
1112
1215
|
Layout/SpaceAroundOperators:
|
@@ -1137,7 +1240,13 @@ Layout/SpaceBeforeBlockBraces:
|
|
1137
1240
|
SupportedStylesForEmptyBraces:
|
1138
1241
|
- space
|
1139
1242
|
- no_space
|
1140
|
-
VersionChanged: '0.52
|
1243
|
+
VersionChanged: '0.52'
|
1244
|
+
|
1245
|
+
Layout/SpaceBeforeBrackets:
|
1246
|
+
Description: 'Checks for receiver with a space before the opening brackets.'
|
1247
|
+
StyleGuide: '#space-in-brackets-access'
|
1248
|
+
Enabled: pending
|
1249
|
+
VersionAdded: '1.7'
|
1141
1250
|
|
1142
1251
|
Layout/SpaceBeforeComma:
|
1143
1252
|
Description: 'No spaces before commas.'
|
@@ -1217,7 +1326,7 @@ Layout/SpaceInsideBlockBraces:
|
|
1217
1326
|
|
1218
1327
|
Layout/SpaceInsideHashLiteralBraces:
|
1219
1328
|
Description: "Use spaces inside hash literal braces - or don't."
|
1220
|
-
StyleGuide: '#spaces-
|
1329
|
+
StyleGuide: '#spaces-braces'
|
1221
1330
|
Enabled: true
|
1222
1331
|
VersionAdded: '0.49'
|
1223
1332
|
EnforcedStyle: space
|
@@ -1295,12 +1404,17 @@ Layout/TrailingWhitespace:
|
|
1295
1404
|
StyleGuide: '#no-trailing-whitespace'
|
1296
1405
|
Enabled: true
|
1297
1406
|
VersionAdded: '0.49'
|
1298
|
-
VersionChanged: '0
|
1407
|
+
VersionChanged: '1.0'
|
1299
1408
|
AllowInHeredoc: false
|
1300
1409
|
|
1301
1410
|
#################### Lint ##################################
|
1302
1411
|
### Warnings
|
1303
1412
|
|
1413
|
+
Lint/AmbiguousAssignment:
|
1414
|
+
Description: 'Checks for mistyped shorthand assignments.'
|
1415
|
+
Enabled: pending
|
1416
|
+
VersionAdded: '1.7'
|
1417
|
+
|
1304
1418
|
Lint/AmbiguousBlockAssociation:
|
1305
1419
|
Description: >-
|
1306
1420
|
Checks for ambiguous block association with method when param passed without
|
@@ -1308,6 +1422,8 @@ Lint/AmbiguousBlockAssociation:
|
|
1308
1422
|
StyleGuide: '#syntax'
|
1309
1423
|
Enabled: true
|
1310
1424
|
VersionAdded: '0.48'
|
1425
|
+
VersionChanged: '1.13'
|
1426
|
+
IgnoredMethods: []
|
1311
1427
|
|
1312
1428
|
Lint/AmbiguousOperator:
|
1313
1429
|
Description: >-
|
@@ -1316,6 +1432,7 @@ Lint/AmbiguousOperator:
|
|
1316
1432
|
StyleGuide: '#method-invocation-parens'
|
1317
1433
|
Enabled: true
|
1318
1434
|
VersionAdded: '0.17'
|
1435
|
+
VersionChanged: '0.83'
|
1319
1436
|
|
1320
1437
|
Lint/AmbiguousRegexpLiteral:
|
1321
1438
|
Description: >-
|
@@ -1323,6 +1440,7 @@ Lint/AmbiguousRegexpLiteral:
|
|
1323
1440
|
a method invocation without parentheses.
|
1324
1441
|
Enabled: true
|
1325
1442
|
VersionAdded: '0.17'
|
1443
|
+
VersionChanged: '0.83'
|
1326
1444
|
|
1327
1445
|
Lint/AssignmentInCondition:
|
1328
1446
|
Description: "Don't use assignment in conditions."
|
@@ -1336,39 +1454,138 @@ Lint/BigDecimalNew:
|
|
1336
1454
|
Enabled: true
|
1337
1455
|
VersionAdded: '0.53'
|
1338
1456
|
|
1457
|
+
Lint/BinaryOperatorWithIdenticalOperands:
|
1458
|
+
Description: 'This cop checks for places where binary operator has identical operands.'
|
1459
|
+
Enabled: true
|
1460
|
+
Safe: false
|
1461
|
+
VersionAdded: '0.89'
|
1462
|
+
VersionChanged: '1.7'
|
1463
|
+
|
1339
1464
|
Lint/BooleanSymbol:
|
1340
1465
|
Description: 'Check for `:true` and `:false` symbols.'
|
1341
1466
|
Enabled: true
|
1467
|
+
Safe: false
|
1342
1468
|
VersionAdded: '0.50'
|
1343
|
-
VersionChanged: '0.
|
1469
|
+
VersionChanged: '0.83'
|
1344
1470
|
|
1345
1471
|
Lint/CircularArgumentReference:
|
1346
1472
|
Description: "Default values in optional keyword arguments and optional ordinal arguments should not refer back to the name of the argument."
|
1347
1473
|
Enabled: true
|
1348
1474
|
VersionAdded: '0.33'
|
1349
1475
|
|
1476
|
+
Lint/ConstantDefinitionInBlock:
|
1477
|
+
Description: 'Do not define constants within a block.'
|
1478
|
+
StyleGuide: '#no-constant-definition-in-block'
|
1479
|
+
Enabled: true
|
1480
|
+
VersionAdded: '0.91'
|
1481
|
+
VersionChanged: '1.3'
|
1482
|
+
# `enums` for Typed Enums via T::Enum in Sorbet.
|
1483
|
+
# https://sorbet.org/docs/tenum
|
1484
|
+
AllowedMethods:
|
1485
|
+
- enums
|
1486
|
+
|
1487
|
+
Lint/ConstantResolution:
|
1488
|
+
Description: 'Check that constants are fully qualified with `::`.'
|
1489
|
+
Enabled: false
|
1490
|
+
VersionAdded: '0.86'
|
1491
|
+
# Restrict this cop to only looking at certain names
|
1492
|
+
Only: []
|
1493
|
+
# Restrict this cop from only looking at certain names
|
1494
|
+
Ignore: []
|
1495
|
+
|
1350
1496
|
Lint/Debugger:
|
1351
1497
|
Description: 'Check for debugger calls.'
|
1352
1498
|
Enabled: true
|
1353
1499
|
VersionAdded: '0.14'
|
1354
|
-
VersionChanged: '
|
1500
|
+
VersionChanged: '1.10'
|
1501
|
+
DebuggerReceivers: [] # deprecated
|
1502
|
+
DebuggerMethods:
|
1503
|
+
# Groups are available so that a specific group can be disabled in
|
1504
|
+
# a user's configuration, but are otherwise not significant.
|
1505
|
+
Kernel:
|
1506
|
+
- binding.irb
|
1507
|
+
Byebug:
|
1508
|
+
- byebug
|
1509
|
+
- remote_byebug
|
1510
|
+
- Kernel.byebug
|
1511
|
+
- Kernel.remote_byebug
|
1512
|
+
Capybara:
|
1513
|
+
- save_and_open_page
|
1514
|
+
- save_and_open_screenshot
|
1515
|
+
Pry:
|
1516
|
+
- binding.pry
|
1517
|
+
- binding.remote_pry
|
1518
|
+
- binding.pry_remote
|
1519
|
+
- Pry.rescue
|
1520
|
+
Rails:
|
1521
|
+
- debugger
|
1522
|
+
- Kernel.debugger
|
1523
|
+
WebConsole:
|
1524
|
+
- binding.console
|
1355
1525
|
|
1356
1526
|
Lint/DeprecatedClassMethods:
|
1357
1527
|
Description: 'Check for deprecated class method calls.'
|
1358
1528
|
Enabled: true
|
1359
1529
|
VersionAdded: '0.19'
|
1360
1530
|
|
1531
|
+
Lint/DeprecatedConstants:
|
1532
|
+
Description: 'Checks for deprecated constants.'
|
1533
|
+
Enabled: pending
|
1534
|
+
VersionAdded: '1.8'
|
1535
|
+
# You can configure deprecated constants.
|
1536
|
+
# If there is an alternative method, you can set alternative value as `Alternative`.
|
1537
|
+
# And you can set the deprecated version as `DeprecatedVersion`.
|
1538
|
+
# These options can be omitted if they are not needed.
|
1539
|
+
#
|
1540
|
+
# DeprecatedConstants:
|
1541
|
+
# 'DEPRECATED_CONSTANT':
|
1542
|
+
# Alternative: 'alternative_value'
|
1543
|
+
# DeprecatedVersion: 'deprecated_version'
|
1544
|
+
#
|
1545
|
+
DeprecatedConstants:
|
1546
|
+
'NIL':
|
1547
|
+
Alternative: 'nil'
|
1548
|
+
DeprecatedVersion: '2.4'
|
1549
|
+
'TRUE':
|
1550
|
+
Alternative: 'true'
|
1551
|
+
DeprecatedVersion: '2.4'
|
1552
|
+
'FALSE':
|
1553
|
+
Alternative: 'false'
|
1554
|
+
DeprecatedVersion: '2.4'
|
1555
|
+
'Random::DEFAULT':
|
1556
|
+
Alternative: 'Random.new'
|
1557
|
+
DeprecatedVersion: '3.0'
|
1558
|
+
|
1559
|
+
Lint/DeprecatedOpenSSLConstant:
|
1560
|
+
Description: "Don't use algorithm constants for `OpenSSL::Cipher` and `OpenSSL::Digest`."
|
1561
|
+
Enabled: true
|
1562
|
+
VersionAdded: '0.84'
|
1563
|
+
|
1361
1564
|
Lint/DisjunctiveAssignmentInConstructor:
|
1362
1565
|
Description: 'In constructor, plain assignment is preferred over disjunctive.'
|
1363
1566
|
Enabled: true
|
1364
1567
|
Safe: false
|
1365
1568
|
VersionAdded: '0.62'
|
1569
|
+
VersionChanged: '0.88'
|
1570
|
+
|
1571
|
+
Lint/DuplicateBranch:
|
1572
|
+
Description: Checks that there are no repeated bodies within `if/unless`, `case-when` and `rescue` constructs.
|
1573
|
+
Enabled: pending
|
1574
|
+
VersionAdded: '1.3'
|
1575
|
+
VersionChanged: '1.7'
|
1576
|
+
IgnoreLiteralBranches: false
|
1577
|
+
IgnoreConstantBranches: false
|
1366
1578
|
|
1367
1579
|
Lint/DuplicateCaseCondition:
|
1368
1580
|
Description: 'Do not repeat values in case conditionals.'
|
1369
1581
|
Enabled: true
|
1370
1582
|
VersionAdded: '0.45'
|
1371
1583
|
|
1584
|
+
Lint/DuplicateElsifCondition:
|
1585
|
+
Description: 'Do not repeat conditions used in if `elsif`.'
|
1586
|
+
Enabled: true
|
1587
|
+
VersionAdded: '0.88'
|
1588
|
+
|
1372
1589
|
Lint/DuplicateHashKey:
|
1373
1590
|
Description: 'Check for duplicate keys in hash literals.'
|
1374
1591
|
Enabled: true
|
@@ -1380,6 +1597,21 @@ Lint/DuplicateMethods:
|
|
1380
1597
|
Enabled: true
|
1381
1598
|
VersionAdded: '0.29'
|
1382
1599
|
|
1600
|
+
Lint/DuplicateRegexpCharacterClassElement:
|
1601
|
+
Description: 'Checks for duplicate elements in Regexp character classes.'
|
1602
|
+
Enabled: pending
|
1603
|
+
VersionAdded: '1.1'
|
1604
|
+
|
1605
|
+
Lint/DuplicateRequire:
|
1606
|
+
Description: 'Check for duplicate `require`s and `require_relative`s.'
|
1607
|
+
Enabled: true
|
1608
|
+
VersionAdded: '0.90'
|
1609
|
+
|
1610
|
+
Lint/DuplicateRescueException:
|
1611
|
+
Description: 'Checks that there are no repeated exceptions used in `rescue` expressions.'
|
1612
|
+
Enabled: true
|
1613
|
+
VersionAdded: '0.89'
|
1614
|
+
|
1383
1615
|
Lint/EachWithObjectArgument:
|
1384
1616
|
Description: 'Check for immutable argument given to each_with_object.'
|
1385
1617
|
Enabled: true
|
@@ -1389,19 +1621,51 @@ Lint/ElseLayout:
|
|
1389
1621
|
Description: 'Check for odd code arrangement in an else block.'
|
1390
1622
|
Enabled: true
|
1391
1623
|
VersionAdded: '0.17'
|
1624
|
+
VersionChanged: '1.2'
|
1625
|
+
|
1626
|
+
Lint/EmptyBlock:
|
1627
|
+
Description: 'This cop checks for blocks without a body.'
|
1628
|
+
Enabled: pending
|
1629
|
+
VersionAdded: '1.1'
|
1630
|
+
VersionChanged: '1.15'
|
1631
|
+
AllowComments: true
|
1632
|
+
AllowEmptyLambdas: true
|
1633
|
+
|
1634
|
+
Lint/EmptyClass:
|
1635
|
+
Description: 'Checks for classes and metaclasses without a body.'
|
1636
|
+
Enabled: pending
|
1637
|
+
VersionAdded: '1.3'
|
1638
|
+
AllowComments: false
|
1639
|
+
|
1640
|
+
Lint/EmptyConditionalBody:
|
1641
|
+
Description: 'This cop checks for the presence of `if`, `elsif` and `unless` branches without a body.'
|
1642
|
+
Enabled: true
|
1643
|
+
AllowComments: true
|
1644
|
+
VersionAdded: '0.89'
|
1392
1645
|
|
1393
1646
|
Lint/EmptyEnsure:
|
1394
1647
|
Description: 'Checks for empty ensure block.'
|
1395
1648
|
Enabled: true
|
1396
1649
|
VersionAdded: '0.10'
|
1397
1650
|
VersionChanged: '0.48'
|
1398
|
-
AutoCorrect: false
|
1399
1651
|
|
1400
1652
|
Lint/EmptyExpression:
|
1401
1653
|
Description: 'Checks for empty expressions.'
|
1402
1654
|
Enabled: true
|
1403
1655
|
VersionAdded: '0.45'
|
1404
1656
|
|
1657
|
+
Lint/EmptyFile:
|
1658
|
+
Description: 'Enforces that Ruby source files are not empty.'
|
1659
|
+
Enabled: true
|
1660
|
+
AllowComments: true
|
1661
|
+
VersionAdded: '0.90'
|
1662
|
+
|
1663
|
+
Lint/EmptyInPattern:
|
1664
|
+
Description: 'Checks for the presence of `in` pattern branches without a body.'
|
1665
|
+
Enabled: pending
|
1666
|
+
AllowComments: true
|
1667
|
+
VersionAdded: '1.16'
|
1668
|
+
|
1405
1669
|
Lint/EmptyInterpolation:
|
1406
1670
|
Description: 'Checks for empty string interpolation.'
|
1407
1671
|
Enabled: true
|
@@ -1411,13 +1675,16 @@ Lint/EmptyInterpolation:
|
|
1411
1675
|
Lint/EmptyWhen:
|
1412
1676
|
Description: 'Checks for `when` branches with empty bodies.'
|
1413
1677
|
Enabled: true
|
1678
|
+
AllowComments: true
|
1414
1679
|
VersionAdded: '0.45'
|
1680
|
+
VersionChanged: '0.83'
|
1415
1681
|
|
1416
1682
|
Lint/EnsureReturn:
|
1417
1683
|
Description: 'Do not use return in an ensure block.'
|
1418
1684
|
StyleGuide: '#no-return-ensure'
|
1419
1685
|
Enabled: true
|
1420
1686
|
VersionAdded: '0.9'
|
1687
|
+
VersionChanged: '0.83'
|
1421
1688
|
|
1422
1689
|
Lint/ErbNewArguments:
|
1423
1690
|
Description: 'Use `:trim_mode` and `:eoutvar` keyword arguments to `ERB.new`.'
|
@@ -1430,6 +1697,12 @@ Lint/FlipFlop:
|
|
1430
1697
|
Enabled: true
|
1431
1698
|
VersionAdded: '0.16'
|
1432
1699
|
|
1700
|
+
Lint/FloatComparison:
|
1701
|
+
Description: 'Checks for the presence of precise comparison of floating point numbers.'
|
1702
|
+
StyleGuide: '#float-comparison'
|
1703
|
+
Enabled: true
|
1704
|
+
VersionAdded: '0.89'
|
1705
|
+
|
1433
1706
|
Lint/FloatOutOfRange:
|
1434
1707
|
Description: >-
|
1435
1708
|
Catches floating-point literals too large or small for Ruby to
|
@@ -1442,6 +1715,13 @@ Lint/FormatParameterMismatch:
|
|
1442
1715
|
Enabled: true
|
1443
1716
|
VersionAdded: '0.33'
|
1444
1717
|
|
1718
|
+
Lint/HashCompareByIdentity:
|
1719
|
+
Description: 'Prefer using `Hash#compare_by_identity` than using `object_id` for keys.'
|
1720
|
+
StyleGuide: '#identity-comparison'
|
1721
|
+
Enabled: true
|
1722
|
+
Safe: false
|
1723
|
+
VersionAdded: '0.93'
|
1724
|
+
|
1445
1725
|
Lint/HeredocMethodCallPosition:
|
1446
1726
|
Description: >-
|
1447
1727
|
Checks for the ordering of a method call where
|
@@ -1450,6 +1730,12 @@ Lint/HeredocMethodCallPosition:
|
|
1450
1730
|
StyleGuide: '#heredoc-method-calls'
|
1451
1731
|
VersionAdded: '0.68'
|
1452
1732
|
|
1733
|
+
Lint/IdentityComparison:
|
1734
|
+
Description: 'Prefer `equal?` over `==` when comparing `object_id`.'
|
1735
|
+
Enabled: true
|
1736
|
+
StyleGuide: '#identity-comparison'
|
1737
|
+
VersionAdded: '0.91'
|
1738
|
+
|
1453
1739
|
Lint/ImplicitStringConcatenation:
|
1454
1740
|
Description: >-
|
1455
1741
|
Checks for adjacent string literals on the same line, which
|
@@ -1477,7 +1763,14 @@ Lint/InheritException:
|
|
1477
1763
|
Lint/InterpolationCheck:
|
1478
1764
|
Description: 'Raise warning for interpolation in single q strs.'
|
1479
1765
|
Enabled: true
|
1766
|
+
Safe: false
|
1480
1767
|
VersionAdded: '0.50'
|
1768
|
+
VersionChanged: '0.87'
|
1769
|
+
|
1770
|
+
Lint/LambdaWithoutLiteralBlock:
|
1771
|
+
Description: 'Checks uses of lambda without a literal block.'
|
1772
|
+
Enabled: pending
|
1773
|
+
VersionAdded: '1.8'
|
1481
1774
|
|
1482
1775
|
Lint/LiteralAsCondition:
|
1483
1776
|
Description: 'Checks of literals used in conditions.'
|
@@ -1497,6 +1790,8 @@ Lint/Loop:
|
|
1497
1790
|
StyleGuide: '#loop-with-break'
|
1498
1791
|
Enabled: true
|
1499
1792
|
VersionAdded: '0.9'
|
1793
|
+
VersionChanged: '1.3'
|
1794
|
+
Safe: false
|
1500
1795
|
|
1501
1796
|
Lint/MissingCopEnableDirective:
|
1502
1797
|
Description: 'Checks for a `# rubocop:enable` after `# rubocop:disable`.'
|
@@ -1511,11 +1806,25 @@ Lint/MissingCopEnableDirective:
|
|
1511
1806
|
# .inf for any size
|
1512
1807
|
MaximumRangeSize: .inf
|
1513
1808
|
|
1809
|
+
Lint/MissingSuper:
|
1810
|
+
Description: >-
|
1811
|
+
This cop checks for the presence of constructors and lifecycle callbacks
|
1812
|
+
without calls to `super`.
|
1813
|
+
Enabled: true
|
1814
|
+
VersionAdded: '0.89'
|
1815
|
+
VersionChanged: '1.4'
|
1816
|
+
|
1817
|
+
Lint/MixedRegexpCaptureTypes:
|
1818
|
+
Description: 'Do not mix named captures and numbered captures in a Regexp literal.'
|
1819
|
+
Enabled: true
|
1820
|
+
VersionAdded: '0.85'
|
1821
|
+
|
1514
1822
|
Lint/MultipleComparison:
|
1515
1823
|
Description: "Use `&&` operator to compare multiple values."
|
1516
1824
|
Enabled: true
|
1517
1825
|
VersionAdded: '0.47'
|
1518
|
-
VersionChanged: '
|
1826
|
+
VersionChanged: '1.1'
|
1827
|
+
AllowMethodComparison: true
|
1519
1828
|
|
1520
1829
|
Lint/NestedMethodDefinition:
|
1521
1830
|
Description: 'Do not use nested method definitions.'
|
@@ -1535,6 +1844,11 @@ Lint/NextWithoutAccumulator:
|
|
1535
1844
|
Enabled: true
|
1536
1845
|
VersionAdded: '0.36'
|
1537
1846
|
|
1847
|
+
Lint/NoReturnInBeginEndBlocks:
|
1848
|
+
Description: 'Do not `return` inside `begin..end` blocks in assignment contexts.'
|
1849
|
+
Enabled: pending
|
1850
|
+
VersionAdded: '1.2'
|
1851
|
+
|
1538
1852
|
Lint/NonDeterministicRequireOrder:
|
1539
1853
|
Description: 'Always sort arrays returned by Dir.glob when requiring files.'
|
1540
1854
|
Enabled: true
|
@@ -1550,14 +1864,35 @@ Lint/NumberConversion:
|
|
1550
1864
|
Description: 'Checks unsafe usage of number conversion methods.'
|
1551
1865
|
Enabled: false
|
1552
1866
|
VersionAdded: '0.53'
|
1553
|
-
VersionChanged: '
|
1867
|
+
VersionChanged: '1.1'
|
1554
1868
|
SafeAutoCorrect: false
|
1869
|
+
IgnoredMethods: []
|
1870
|
+
IgnoredClasses:
|
1871
|
+
- Time
|
1872
|
+
- DateTime
|
1873
|
+
|
1874
|
+
Lint/NumberedParameterAssignment:
|
1875
|
+
Description: 'Checks for uses of numbered parameter assignment.'
|
1876
|
+
Enabled: pending
|
1877
|
+
VersionAdded: '1.9'
|
1878
|
+
|
1879
|
+
Lint/OrAssignmentToConstant:
|
1880
|
+
Description: 'Checks unintended or-assignment to constant.'
|
1881
|
+
Enabled: pending
|
1882
|
+
Safe: false
|
1883
|
+
VersionAdded: '1.9'
|
1555
1884
|
|
1556
1885
|
Lint/OrderedMagicComments:
|
1557
1886
|
Description: 'Checks the proper ordering of magic comments and whether a magic comment is not placed before a shebang.'
|
1558
1887
|
Enabled: true
|
1559
1888
|
VersionAdded: '0.53'
|
1560
1889
|
|
1890
|
+
Lint/OutOfRangeRegexpRef:
|
1891
|
+
Description: 'Checks for out of range reference for Regexp because it always returns nil.'
|
1892
|
+
Enabled: true
|
1893
|
+
Safe: false
|
1894
|
+
VersionAdded: '0.89'
|
1895
|
+
|
1561
1896
|
Lint/ParenthesesAsGroupedExpression:
|
1562
1897
|
Description: >-
|
1563
1898
|
Checks for method calls with a space before the opening
|
@@ -1565,6 +1900,7 @@ Lint/ParenthesesAsGroupedExpression:
|
|
1565
1900
|
StyleGuide: '#parens-no-spaces'
|
1566
1901
|
Enabled: true
|
1567
1902
|
VersionAdded: '0.12'
|
1903
|
+
VersionChanged: '0.83'
|
1568
1904
|
|
1569
1905
|
Lint/PercentStringArray:
|
1570
1906
|
Description: >-
|
@@ -1582,8 +1918,10 @@ Lint/PercentSymbolArray:
|
|
1582
1918
|
Lint/RaiseException:
|
1583
1919
|
Description: Checks for `raise` or `fail` statements which are raising `Exception` class.
|
1584
1920
|
StyleGuide: '#raise-exception'
|
1585
|
-
Enabled:
|
1921
|
+
Enabled: true
|
1922
|
+
Safe: false
|
1586
1923
|
VersionAdded: '0.81'
|
1924
|
+
VersionChanged: '0.86'
|
1587
1925
|
AllowedImplicitNamespaces:
|
1588
1926
|
- 'Gem'
|
1589
1927
|
|
@@ -1607,15 +1945,35 @@ Lint/RedundantCopEnableDirective:
|
|
1607
1945
|
Enabled: true
|
1608
1946
|
VersionAdded: '0.76'
|
1609
1947
|
|
1948
|
+
Lint/RedundantDirGlobSort:
|
1949
|
+
Description: 'Checks for redundant `sort` method to `Dir.glob` and `Dir[]`.'
|
1950
|
+
Enabled: pending
|
1951
|
+
VersionAdded: '1.8'
|
1952
|
+
|
1610
1953
|
Lint/RedundantRequireStatement:
|
1611
1954
|
Description: 'Checks for unnecessary `require` statement.'
|
1612
1955
|
Enabled: true
|
1613
1956
|
VersionAdded: '0.76'
|
1614
1957
|
|
1958
|
+
Lint/RedundantSafeNavigation:
|
1959
|
+
Description: 'Checks for redundant safe navigation calls.'
|
1960
|
+
Enabled: true
|
1961
|
+
VersionAdded: '0.93'
|
1962
|
+
AllowedMethods:
|
1963
|
+
- instance_of?
|
1964
|
+
- kind_of?
|
1965
|
+
- is_a?
|
1966
|
+
- eql?
|
1967
|
+
- respond_to?
|
1968
|
+
- equal?
|
1969
|
+
Safe: false
|
1970
|
+
|
1615
1971
|
Lint/RedundantSplatExpansion:
|
1616
1972
|
Description: 'Checks for splat unnecessarily being called on literals.'
|
1617
1973
|
Enabled: true
|
1618
1974
|
VersionAdded: '0.76'
|
1975
|
+
VersionChanged: '1.7'
|
1976
|
+
AllowPercentLiteralArrayArgument: true
|
1619
1977
|
|
1620
1978
|
Lint/RedundantStringCoercion:
|
1621
1979
|
Description: 'Checks for Object#to_s usage in string interpolation.'
|
@@ -1640,6 +1998,7 @@ Lint/RegexpAsCondition:
|
|
1640
1998
|
The regexp literal matches `$_` implicitly.
|
1641
1999
|
Enabled: true
|
1642
2000
|
VersionAdded: '0.51'
|
2001
|
+
VersionChanged: '0.86'
|
1643
2002
|
|
1644
2003
|
Lint/RequireParentheses:
|
1645
2004
|
Description: >-
|
@@ -1653,7 +2012,7 @@ Lint/RescueException:
|
|
1653
2012
|
StyleGuide: '#no-blind-rescues'
|
1654
2013
|
Enabled: true
|
1655
2014
|
VersionAdded: '0.9'
|
1656
|
-
VersionChanged: '0.27
|
2015
|
+
VersionChanged: '0.27'
|
1657
2016
|
|
1658
2017
|
Lint/RescueType:
|
1659
2018
|
Description: 'Avoid rescuing from non constants that could result in a `TypeError`.'
|
@@ -1676,6 +2035,7 @@ Lint/SafeNavigationChain:
|
|
1676
2035
|
- presence
|
1677
2036
|
- try
|
1678
2037
|
- try!
|
2038
|
+
- in?
|
1679
2039
|
|
1680
2040
|
Lint/SafeNavigationConsistency:
|
1681
2041
|
Description: >-
|
@@ -1696,6 +2056,7 @@ Lint/SafeNavigationWithEmpty:
|
|
1696
2056
|
Description: 'Avoid `foo&.empty?` in conditionals.'
|
1697
2057
|
Enabled: true
|
1698
2058
|
VersionAdded: '0.62'
|
2059
|
+
VersionChanged: '0.87'
|
1699
2060
|
|
1700
2061
|
Lint/ScriptPermission:
|
1701
2062
|
Description: 'Grant script file execute permission.'
|
@@ -1703,6 +2064,11 @@ Lint/ScriptPermission:
|
|
1703
2064
|
VersionAdded: '0.49'
|
1704
2065
|
VersionChanged: '0.50'
|
1705
2066
|
|
2067
|
+
Lint/SelfAssignment:
|
2068
|
+
Description: 'Checks for self-assignments.'
|
2069
|
+
Enabled: true
|
2070
|
+
VersionAdded: '0.89'
|
2071
|
+
|
1706
2072
|
Lint/SendWithMixinArgument:
|
1707
2073
|
Description: 'Checks for `send` method when using mixin.'
|
1708
2074
|
Enabled: true
|
@@ -1731,7 +2097,7 @@ Lint/ShadowingOuterLocalVariable:
|
|
1731
2097
|
|
1732
2098
|
Lint/StructNewOverride:
|
1733
2099
|
Description: 'Disallow overriding the `Struct` built-in methods via `Struct.new`.'
|
1734
|
-
Enabled:
|
2100
|
+
Enabled: true
|
1735
2101
|
VersionAdded: '0.81'
|
1736
2102
|
|
1737
2103
|
Lint/SuppressedException:
|
@@ -1739,36 +2105,99 @@ Lint/SuppressedException:
|
|
1739
2105
|
StyleGuide: '#dont-hide-exceptions'
|
1740
2106
|
Enabled: true
|
1741
2107
|
AllowComments: true
|
2108
|
+
AllowNil: true
|
1742
2109
|
VersionAdded: '0.9'
|
1743
|
-
VersionChanged: '
|
2110
|
+
VersionChanged: '1.12'
|
2111
|
+
|
2112
|
+
Lint/SymbolConversion:
|
2113
|
+
Description: 'Checks for unnecessary symbol conversions.'
|
2114
|
+
Enabled: pending
|
2115
|
+
VersionAdded: '1.9'
|
2116
|
+
VersionChanged: '1.16'
|
2117
|
+
EnforcedStyle: strict
|
2118
|
+
SupportedStyles:
|
2119
|
+
- strict
|
2120
|
+
- consistent
|
1744
2121
|
|
1745
2122
|
Lint/Syntax:
|
1746
|
-
Description: 'Checks syntax
|
2123
|
+
Description: 'Checks for syntax errors.'
|
1747
2124
|
Enabled: true
|
1748
2125
|
VersionAdded: '0.9'
|
1749
2126
|
|
2127
|
+
Lint/ToEnumArguments:
|
2128
|
+
Description: 'This cop ensures that `to_enum`/`enum_for`, called for the current method, has correct arguments.'
|
2129
|
+
Enabled: pending
|
2130
|
+
VersionAdded: '1.1'
|
1750
2131
|
|
1751
2132
|
Lint/ToJSON:
|
1752
2133
|
Description: 'Ensure #to_json includes an optional argument.'
|
1753
2134
|
Enabled: true
|
1754
2135
|
VersionAdded: '0.66'
|
1755
2136
|
|
2137
|
+
Lint/TopLevelReturnWithArgument:
|
2138
|
+
Description: 'This cop detects top level return statements with argument.'
|
2139
|
+
Enabled: true
|
2140
|
+
VersionAdded: '0.89'
|
2141
|
+
|
2142
|
+
Lint/TrailingCommaInAttributeDeclaration:
|
2143
|
+
Description: 'This cop checks for trailing commas in attribute declarations.'
|
2144
|
+
Enabled: true
|
2145
|
+
VersionAdded: '0.90'
|
2146
|
+
|
2147
|
+
Lint/TripleQuotes:
|
2148
|
+
Description: 'Checks for useless triple quote constructs.'
|
2149
|
+
Enabled: pending
|
2150
|
+
VersionAdded: '1.9'
|
2151
|
+
|
1756
2152
|
Lint/UnderscorePrefixedVariableName:
|
1757
2153
|
Description: 'Do not use prefix `_` for a variable that is used.'
|
1758
2154
|
Enabled: true
|
1759
2155
|
VersionAdded: '0.21'
|
1760
2156
|
AllowKeywordBlockArguments: false
|
1761
2157
|
|
2158
|
+
Lint/UnexpectedBlockArity:
|
2159
|
+
Description: 'Looks for blocks that have fewer arguments that the calling method expects.'
|
2160
|
+
Enabled: pending
|
2161
|
+
Safe: false
|
2162
|
+
VersionAdded: '1.5'
|
2163
|
+
Methods:
|
2164
|
+
chunk_while: 2
|
2165
|
+
each_with_index: 2
|
2166
|
+
each_with_object: 2
|
2167
|
+
inject: 2
|
2168
|
+
max: 2
|
2169
|
+
min: 2
|
2170
|
+
minmax: 2
|
2171
|
+
reduce: 2
|
2172
|
+
slice_when: 2
|
2173
|
+
sort: 2
|
2174
|
+
|
1762
2175
|
Lint/UnifiedInteger:
|
1763
2176
|
Description: 'Use Integer instead of Fixnum or Bignum.'
|
1764
2177
|
Enabled: true
|
1765
2178
|
VersionAdded: '0.43'
|
1766
2179
|
|
2180
|
+
Lint/UnmodifiedReduceAccumulator:
|
2181
|
+
Description: Checks for `reduce` or `inject` blocks that do not update the accumulator each iteration.
|
2182
|
+
Enabled: pending
|
2183
|
+
VersionAdded: '1.1'
|
2184
|
+
VersionChanged: '1.5'
|
2185
|
+
|
1767
2186
|
Lint/UnreachableCode:
|
1768
2187
|
Description: 'Unreachable code.'
|
1769
2188
|
Enabled: true
|
1770
2189
|
VersionAdded: '0.9'
|
1771
2190
|
|
2191
|
+
Lint/UnreachableLoop:
|
2192
|
+
Description: 'This cop checks for loops that will have at most one iteration.'
|
2193
|
+
Enabled: true
|
2194
|
+
VersionAdded: '0.89'
|
2195
|
+
VersionChanged: '1.7'
|
2196
|
+
IgnoredPatterns:
|
2197
|
+
# RSpec uses `times` in its message expectations
|
2198
|
+
# eg. `exactly(2).times`
|
2199
|
+
- !ruby/regexp /(exactly|at_least|at_most)\(\d+\)\.times/
|
2200
|
+
|
1772
2201
|
Lint/UnusedBlockArgument:
|
1773
2202
|
Description: 'Checks for unused block arguments.'
|
1774
2203
|
StyleGuide: '#underscore-unused-vars'
|
@@ -1808,7 +2237,7 @@ Lint/UselessAccessModifier:
|
|
1808
2237
|
Description: 'Checks for useless access modifiers.'
|
1809
2238
|
Enabled: true
|
1810
2239
|
VersionAdded: '0.20'
|
1811
|
-
VersionChanged: '0.
|
2240
|
+
VersionChanged: '0.83'
|
1812
2241
|
ContextCreatingMethods: []
|
1813
2242
|
MethodCreatingMethods: []
|
1814
2243
|
|
@@ -1818,21 +2247,30 @@ Lint/UselessAssignment:
|
|
1818
2247
|
Enabled: true
|
1819
2248
|
VersionAdded: '0.11'
|
1820
2249
|
|
1821
|
-
Lint/UselessComparison:
|
1822
|
-
Description: 'Checks for comparison of something with itself.'
|
1823
|
-
Enabled: true
|
1824
|
-
VersionAdded: '0.11'
|
1825
|
-
|
1826
2250
|
Lint/UselessElseWithoutRescue:
|
1827
2251
|
Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
|
1828
2252
|
Enabled: true
|
1829
2253
|
VersionAdded: '0.17'
|
1830
2254
|
|
2255
|
+
Lint/UselessMethodDefinition:
|
2256
|
+
Description: 'Checks for useless method definitions.'
|
2257
|
+
Enabled: true
|
2258
|
+
VersionAdded: '0.90'
|
2259
|
+
Safe: false
|
2260
|
+
AllowComments: true
|
2261
|
+
|
1831
2262
|
Lint/UselessSetterCall:
|
1832
2263
|
Description: 'Checks for useless setter call to a local variable.'
|
1833
2264
|
Enabled: true
|
2265
|
+
SafeAutoCorrect: false
|
1834
2266
|
VersionAdded: '0.13'
|
1835
|
-
VersionChanged: '
|
2267
|
+
VersionChanged: '1.2'
|
2268
|
+
Safe: false
|
2269
|
+
|
2270
|
+
Lint/UselessTimes:
|
2271
|
+
Description: 'Checks for useless `Integer#times` calls.'
|
2272
|
+
Enabled: true
|
2273
|
+
VersionAdded: '0.91'
|
1836
2274
|
Safe: false
|
1837
2275
|
|
1838
2276
|
Lint/Void:
|
@@ -1852,20 +2290,23 @@ Metrics/AbcSize:
|
|
1852
2290
|
- https://en.wikipedia.org/wiki/ABC_Software_Metric
|
1853
2291
|
Enabled: true
|
1854
2292
|
VersionAdded: '0.27'
|
1855
|
-
VersionChanged: '
|
2293
|
+
VersionChanged: '1.5'
|
1856
2294
|
# The ABC size is a calculated magnitude, so this number can be an Integer or
|
1857
2295
|
# a Float.
|
1858
2296
|
IgnoredMethods: []
|
1859
|
-
|
2297
|
+
CountRepeatedAttributes: true
|
2298
|
+
Max: 17
|
1860
2299
|
|
1861
2300
|
Metrics/BlockLength:
|
1862
2301
|
Description: 'Avoid long blocks with many lines.'
|
1863
2302
|
Enabled: true
|
1864
2303
|
VersionAdded: '0.44'
|
1865
|
-
VersionChanged: '
|
2304
|
+
VersionChanged: '1.5'
|
1866
2305
|
CountComments: false # count full line comments?
|
1867
2306
|
Max: 25
|
1868
|
-
|
2307
|
+
CountAsOne: []
|
2308
|
+
ExcludedMethods: [] # deprecated, retained for backwards compatibility
|
2309
|
+
IgnoredMethods:
|
1869
2310
|
# By default, exclude the `#refine` method, as it tends to have larger
|
1870
2311
|
# associated blocks.
|
1871
2312
|
- refine
|
@@ -1885,8 +2326,10 @@ Metrics/ClassLength:
|
|
1885
2326
|
Description: 'Avoid classes longer than 100 lines of code.'
|
1886
2327
|
Enabled: true
|
1887
2328
|
VersionAdded: '0.25'
|
2329
|
+
VersionChanged: '0.87'
|
1888
2330
|
CountComments: false # count full line comments?
|
1889
2331
|
Max: 100
|
2332
|
+
CountAsOne: []
|
1890
2333
|
|
1891
2334
|
# Avoid complex methods.
|
1892
2335
|
Metrics/CyclomaticComplexity:
|
@@ -1897,32 +2340,38 @@ Metrics/CyclomaticComplexity:
|
|
1897
2340
|
VersionAdded: '0.25'
|
1898
2341
|
VersionChanged: '0.81'
|
1899
2342
|
IgnoredMethods: []
|
1900
|
-
Max:
|
2343
|
+
Max: 7
|
1901
2344
|
|
1902
2345
|
Metrics/MethodLength:
|
1903
2346
|
Description: 'Avoid methods longer than 10 lines of code.'
|
1904
2347
|
StyleGuide: '#short-methods'
|
1905
2348
|
Enabled: true
|
1906
2349
|
VersionAdded: '0.25'
|
1907
|
-
VersionChanged: '
|
2350
|
+
VersionChanged: '1.5'
|
1908
2351
|
CountComments: false # count full line comments?
|
1909
2352
|
Max: 10
|
1910
|
-
|
2353
|
+
CountAsOne: []
|
2354
|
+
ExcludedMethods: [] # deprecated, retained for backwards compatibility
|
2355
|
+
IgnoredMethods: []
|
1911
2356
|
|
1912
2357
|
Metrics/ModuleLength:
|
1913
2358
|
Description: 'Avoid modules longer than 100 lines of code.'
|
1914
2359
|
Enabled: true
|
1915
2360
|
VersionAdded: '0.31'
|
2361
|
+
VersionChanged: '0.87'
|
1916
2362
|
CountComments: false # count full line comments?
|
1917
2363
|
Max: 100
|
2364
|
+
CountAsOne: []
|
1918
2365
|
|
1919
2366
|
Metrics/ParameterLists:
|
1920
2367
|
Description: 'Avoid parameter lists longer than three or four parameters.'
|
1921
2368
|
StyleGuide: '#too-many-params'
|
1922
2369
|
Enabled: true
|
1923
2370
|
VersionAdded: '0.25'
|
2371
|
+
VersionChanged: '1.5'
|
1924
2372
|
Max: 5
|
1925
2373
|
CountKeywordArgs: true
|
2374
|
+
MaxOptionalParameters: 3
|
1926
2375
|
|
1927
2376
|
Metrics/PerceivedComplexity:
|
1928
2377
|
Description: >-
|
@@ -1932,7 +2381,7 @@ Metrics/PerceivedComplexity:
|
|
1932
2381
|
VersionAdded: '0.25'
|
1933
2382
|
VersionChanged: '0.81'
|
1934
2383
|
IgnoredMethods: []
|
1935
|
-
Max:
|
2384
|
+
Max: 8
|
1936
2385
|
|
1937
2386
|
################## Migration #############################
|
1938
2387
|
|
@@ -1952,16 +2401,19 @@ Naming/AccessorMethodName:
|
|
1952
2401
|
VersionAdded: '0.50'
|
1953
2402
|
|
1954
2403
|
Naming/AsciiIdentifiers:
|
1955
|
-
Description: 'Use only ascii symbols in identifiers.'
|
2404
|
+
Description: 'Use only ascii symbols in identifiers and constants.'
|
1956
2405
|
StyleGuide: '#english-identifiers'
|
1957
2406
|
Enabled: true
|
1958
2407
|
VersionAdded: '0.50'
|
2408
|
+
VersionChanged: '0.87'
|
2409
|
+
AsciiConstants: true
|
1959
2410
|
|
1960
2411
|
Naming/BinaryOperatorParameterName:
|
1961
2412
|
Description: 'When defining binary operators, name the argument other.'
|
1962
2413
|
StyleGuide: '#other-arg'
|
1963
2414
|
Enabled: true
|
1964
2415
|
VersionAdded: '0.50'
|
2416
|
+
VersionChanged: '1.2'
|
1965
2417
|
|
1966
2418
|
Naming/BlockParameterName:
|
1967
2419
|
Description: >-
|
@@ -1983,6 +2435,11 @@ Naming/ClassAndModuleCamelCase:
|
|
1983
2435
|
StyleGuide: '#camelcase-classes'
|
1984
2436
|
Enabled: true
|
1985
2437
|
VersionAdded: '0.50'
|
2438
|
+
VersionChanged: '0.85'
|
2439
|
+
# Allowed class/module names can be specified here.
|
2440
|
+
# These can be full or part of the name.
|
2441
|
+
AllowedNames:
|
2442
|
+
- module_parent
|
1986
2443
|
|
1987
2444
|
Naming/ConstantName:
|
1988
2445
|
Description: 'Constants should use SCREAMING_SNAKE_CASE.'
|
@@ -2003,6 +2460,10 @@ Naming/FileName:
|
|
2003
2460
|
# It further expects it to be nested inside modules which match the names
|
2004
2461
|
# of subdirectories in its path.
|
2005
2462
|
ExpectMatchingDefinition: false
|
2463
|
+
# When `false`, changes the behavior of ExpectMatchingDefinition to match only
|
2464
|
+
# whether each source file's class or module name matches the file name --
|
2465
|
+
# not whether the nested module hierarchy matches the subdirectory path.
|
2466
|
+
CheckDefinitionPathHierarchy: true
|
2006
2467
|
# If non-`nil`, expect all source file names to match the following regex.
|
2007
2468
|
# Only the file name itself is matched, not the entire file path.
|
2008
2469
|
# Use anchors as necessary if you want to match the entire name rather than
|
@@ -2059,6 +2520,7 @@ Naming/HeredocDelimiterCase:
|
|
2059
2520
|
StyleGuide: '#heredoc-delimiters'
|
2060
2521
|
Enabled: true
|
2061
2522
|
VersionAdded: '0.50'
|
2523
|
+
VersionChanged: '1.2'
|
2062
2524
|
EnforcedStyle: uppercase
|
2063
2525
|
SupportedStyles:
|
2064
2526
|
- lowercase
|
@@ -2072,17 +2534,43 @@ Naming/HeredocDelimiterNaming:
|
|
2072
2534
|
ForbiddenDelimiters:
|
2073
2535
|
- !ruby/regexp '/(^|\s)(EO[A-Z]{1}|END)(\s|$)/'
|
2074
2536
|
|
2537
|
+
Naming/InclusiveLanguage:
|
2538
|
+
Description: 'Recommend the use of inclusive language instead of problematic terms.'
|
2539
|
+
Enabled: pending
|
2540
|
+
VersionAdded: '1.18'
|
2541
|
+
CheckIdentifiers: true
|
2542
|
+
CheckConstants: true
|
2543
|
+
CheckVariables: true
|
2544
|
+
CheckStrings: false
|
2545
|
+
CheckSymbols: true
|
2546
|
+
CheckComments: true
|
2547
|
+
CheckFilepaths: true
|
2548
|
+
FlaggedTerms:
|
2549
|
+
whitelist:
|
2550
|
+
Regex: !ruby/regexp '/white[-_\s]?list/'
|
2551
|
+
Suggestions:
|
2552
|
+
- allowlist
|
2553
|
+
- permit
|
2554
|
+
blacklist:
|
2555
|
+
Regex: !ruby/regexp '/black[-_\s]?list/'
|
2556
|
+
Suggestions:
|
2557
|
+
- denylist
|
2558
|
+
- block
|
2559
|
+
slave:
|
2560
|
+
Suggestions: ['replica', 'secondary', 'follower']
|
2561
|
+
|
2075
2562
|
Naming/MemoizedInstanceVariableName:
|
2076
2563
|
Description: >-
|
2077
2564
|
Memoized method name should match memo instance variable name.
|
2078
2565
|
Enabled: true
|
2079
2566
|
VersionAdded: '0.53'
|
2080
|
-
VersionChanged: '
|
2567
|
+
VersionChanged: '1.2'
|
2081
2568
|
EnforcedStyleForLeadingUnderscores: disallowed
|
2082
2569
|
SupportedStylesForLeadingUnderscores:
|
2083
2570
|
- disallowed
|
2084
2571
|
- required
|
2085
2572
|
- optional
|
2573
|
+
Safe: false
|
2086
2574
|
|
2087
2575
|
Naming/MethodName:
|
2088
2576
|
Description: 'Use the configured style when naming methods.'
|
@@ -2113,17 +2601,18 @@ Naming/MethodParameterName:
|
|
2113
2601
|
AllowNamesEndingInNumbers: true
|
2114
2602
|
# Allowed names that will not register an offense
|
2115
2603
|
AllowedNames:
|
2116
|
-
-
|
2117
|
-
- id
|
2118
|
-
- to
|
2604
|
+
- at
|
2119
2605
|
- by
|
2120
|
-
-
|
2606
|
+
- db
|
2607
|
+
- id
|
2121
2608
|
- in
|
2122
|
-
-
|
2609
|
+
- io
|
2123
2610
|
- ip
|
2124
|
-
-
|
2611
|
+
- of
|
2612
|
+
- 'on'
|
2125
2613
|
- os
|
2126
2614
|
- pp
|
2615
|
+
- to
|
2127
2616
|
# Forbidden names that will register an offense
|
2128
2617
|
ForbiddenNames: []
|
2129
2618
|
|
@@ -2168,20 +2657,33 @@ Naming/VariableName:
|
|
2168
2657
|
StyleGuide: '#snake-case-symbols-methods-vars'
|
2169
2658
|
Enabled: true
|
2170
2659
|
VersionAdded: '0.50'
|
2660
|
+
VersionChanged: '1.8'
|
2171
2661
|
EnforcedStyle: snake_case
|
2172
2662
|
SupportedStyles:
|
2173
2663
|
- snake_case
|
2174
2664
|
- camelCase
|
2665
|
+
AllowedIdentifiers: []
|
2175
2666
|
|
2176
2667
|
Naming/VariableNumber:
|
2177
|
-
Description: 'Use the configured style when numbering variables.'
|
2668
|
+
Description: 'Use the configured style when numbering symbols, methods and variables.'
|
2669
|
+
StyleGuide: '#snake-case-symbols-methods-vars-with-numbers'
|
2178
2670
|
Enabled: true
|
2179
2671
|
VersionAdded: '0.50'
|
2672
|
+
VersionChanged: '1.4'
|
2180
2673
|
EnforcedStyle: normalcase
|
2181
2674
|
SupportedStyles:
|
2182
2675
|
- snake_case
|
2183
2676
|
- normalcase
|
2184
2677
|
- non_integer
|
2678
|
+
CheckMethodNames: true
|
2679
|
+
CheckSymbols: true
|
2680
|
+
AllowedIdentifiers:
|
2681
|
+
- capture3 # Open3.capture3
|
2682
|
+
- iso8601 # Time#iso8601
|
2683
|
+
- rfc1123_date # CGI.rfc1123_date
|
2684
|
+
- rfc822 # Time#rfc822
|
2685
|
+
- rfc2822 # Time#rfc2822
|
2686
|
+
- rfc3339 # DateTime.rfc3339
|
2185
2687
|
|
2186
2688
|
#################### Security ##############################
|
2187
2689
|
|
@@ -2194,7 +2696,7 @@ Security/JSONLoad:
|
|
2194
2696
|
Description: >-
|
2195
2697
|
Prefer usage of `JSON.parse` over `JSON.load` due to potential
|
2196
2698
|
security issues. See reference for more information.
|
2197
|
-
Reference: 'https://ruby-doc.org/stdlib-2.
|
2699
|
+
Reference: 'https://ruby-doc.org/stdlib-2.7.0/libdoc/json/rdoc/JSON.html#method-i-load'
|
2198
2700
|
Enabled: true
|
2199
2701
|
VersionAdded: '0.43'
|
2200
2702
|
VersionChanged: '0.44'
|
@@ -2207,21 +2709,22 @@ Security/MarshalLoad:
|
|
2207
2709
|
Description: >-
|
2208
2710
|
Avoid using of `Marshal.load` or `Marshal.restore` due to potential
|
2209
2711
|
security issues. See reference for more information.
|
2210
|
-
Reference: 'https://ruby-doc.org/core-2.
|
2712
|
+
Reference: 'https://ruby-doc.org/core-2.7.0/Marshal.html#module-Marshal-label-Security+considerations'
|
2211
2713
|
Enabled: true
|
2212
2714
|
VersionAdded: '0.47'
|
2213
2715
|
|
2214
2716
|
Security/Open:
|
2215
|
-
Description: 'The use of Kernel#open
|
2717
|
+
Description: 'The use of `Kernel#open` and `URI.open` represent a serious security risk.'
|
2216
2718
|
Enabled: true
|
2217
2719
|
VersionAdded: '0.53'
|
2720
|
+
VersionChanged: '1.0'
|
2218
2721
|
Safe: false
|
2219
2722
|
|
2220
2723
|
Security/YAMLLoad:
|
2221
2724
|
Description: >-
|
2222
2725
|
Prefer usage of `YAML.safe_load` over `YAML.load` due to potential
|
2223
2726
|
security issues. See reference for more information.
|
2224
|
-
Reference: 'https://ruby-doc.org/stdlib-2.
|
2727
|
+
Reference: 'https://ruby-doc.org/stdlib-2.7.0/libdoc/yaml/rdoc/YAML.html#module-YAML-label-Security'
|
2225
2728
|
Enabled: true
|
2226
2729
|
VersionAdded: '0.47'
|
2227
2730
|
SafeAutoCorrect: false
|
@@ -2239,6 +2742,17 @@ Style/AccessModifierDeclarations:
|
|
2239
2742
|
- group
|
2240
2743
|
AllowModifiersOnSymbols: true
|
2241
2744
|
|
2745
|
+
Style/AccessorGrouping:
|
2746
|
+
Description: 'Checks for grouping of accessors in `class` and `module` bodies.'
|
2747
|
+
Enabled: true
|
2748
|
+
VersionAdded: '0.87'
|
2749
|
+
EnforcedStyle: grouped
|
2750
|
+
SupportedStyles:
|
2751
|
+
# separated: each accessor goes in a separate statement.
|
2752
|
+
# grouped: accessors are grouped into a single statement.
|
2753
|
+
- separated
|
2754
|
+
- grouped
|
2755
|
+
|
2242
2756
|
Style/Alias:
|
2243
2757
|
Description: 'Use alias instead of alias_method.'
|
2244
2758
|
StyleGuide: '#alias-method-lexically'
|
@@ -2258,11 +2772,27 @@ Style/AndOr:
|
|
2258
2772
|
VersionChanged: '0.25'
|
2259
2773
|
# Whether `and` and `or` are banned only in conditionals (conditionals)
|
2260
2774
|
# or completely (always).
|
2261
|
-
EnforcedStyle:
|
2775
|
+
EnforcedStyle: conditionals
|
2262
2776
|
SupportedStyles:
|
2263
2777
|
- always
|
2264
2778
|
- conditionals
|
2265
2779
|
|
2780
|
+
Style/ArgumentsForwarding:
|
2781
|
+
Description: 'Use arguments forwarding.'
|
2782
|
+
StyleGuide: '#arguments-forwarding'
|
2783
|
+
Enabled: pending
|
2784
|
+
AllowOnlyRestArgument: true
|
2785
|
+
VersionAdded: '1.1'
|
2786
|
+
|
2787
|
+
Style/ArrayCoercion:
|
2788
|
+
Description: >-
|
2789
|
+
Use Array() instead of explicit Array check or [*var], when dealing
|
2790
|
+
with a variable you want to treat as an Array, but you're not certain it's an array.
|
2791
|
+
StyleGuide: '#array-coercion'
|
2792
|
+
Safe: false
|
2793
|
+
Enabled: false
|
2794
|
+
VersionAdded: '0.88'
|
2795
|
+
|
2266
2796
|
Style/ArrayJoin:
|
2267
2797
|
Description: 'Use Array#join instead of Array#*.'
|
2268
2798
|
StyleGuide: '#array-join'
|
@@ -2276,7 +2806,8 @@ Style/AsciiComments:
|
|
2276
2806
|
Enabled: true
|
2277
2807
|
VersionAdded: '0.9'
|
2278
2808
|
VersionChanged: '0.52'
|
2279
|
-
AllowedChars:
|
2809
|
+
AllowedChars:
|
2810
|
+
- ©
|
2280
2811
|
|
2281
2812
|
Style/Attr:
|
2282
2813
|
Description: 'Checks for uses of Module#attr.'
|
@@ -2306,6 +2837,13 @@ Style/BeginBlock:
|
|
2306
2837
|
Enabled: true
|
2307
2838
|
VersionAdded: '0.9'
|
2308
2839
|
|
2840
|
+
Style/BisectedAttrAccessor:
|
2841
|
+
Description: >-
|
2842
|
+
Checks for places where `attr_reader` and `attr_writer`
|
2843
|
+
for the same method can be combined into single `attr_accessor`.
|
2844
|
+
Enabled: true
|
2845
|
+
VersionAdded: '0.87'
|
2846
|
+
|
2309
2847
|
Style/BlockComments:
|
2310
2848
|
Description: 'Do not use block comments.'
|
2311
2849
|
StyleGuide: '#no-block-comments'
|
@@ -2428,6 +2966,7 @@ Style/CaseEquality:
|
|
2428
2966
|
StyleGuide: '#no-case-equality'
|
2429
2967
|
Enabled: true
|
2430
2968
|
VersionAdded: '0.9'
|
2969
|
+
VersionChanged: '0.89'
|
2431
2970
|
# If AllowOnConstant is enabled, the cop will ignore violations when the receiver of
|
2432
2971
|
# the case equality operator is a constant.
|
2433
2972
|
#
|
@@ -2438,6 +2977,13 @@ Style/CaseEquality:
|
|
2438
2977
|
# String === "string"
|
2439
2978
|
AllowOnConstant: false
|
2440
2979
|
|
2980
|
+
Style/CaseLikeIf:
|
2981
|
+
Description: 'This cop identifies places where `if-elsif` constructions can be replaced with `case-when`.'
|
2982
|
+
StyleGuide: '#case-vs-if-else'
|
2983
|
+
Enabled: true
|
2984
|
+
Safe: false
|
2985
|
+
VersionAdded: '0.88'
|
2986
|
+
|
2441
2987
|
Style/CharacterLiteral:
|
2442
2988
|
Description: 'Checks for uses of character literals.'
|
2443
2989
|
StyleGuide: '#no-character-literals'
|
@@ -2453,7 +2999,6 @@ Style/ClassAndModuleChildren:
|
|
2453
2999
|
# have the knowledge to perform either operation safely and thus requires
|
2454
3000
|
# manual oversight.
|
2455
3001
|
SafeAutoCorrect: false
|
2456
|
-
AutoCorrect: false
|
2457
3002
|
Enabled: true
|
2458
3003
|
VersionAdded: '0.19'
|
2459
3004
|
#
|
@@ -2485,6 +3030,16 @@ Style/ClassCheck:
|
|
2485
3030
|
- is_a?
|
2486
3031
|
- kind_of?
|
2487
3032
|
|
3033
|
+
Style/ClassEqualityComparison:
|
3034
|
+
Description: 'Enforces the use of `Object#instance_of?` instead of class comparison for equality.'
|
3035
|
+
StyleGuide: '#instance-of-vs-class-comparison'
|
3036
|
+
Enabled: true
|
3037
|
+
VersionAdded: '0.93'
|
3038
|
+
IgnoredMethods:
|
3039
|
+
- ==
|
3040
|
+
- equal?
|
3041
|
+
- eql?
|
3042
|
+
|
2488
3043
|
Style/ClassMethods:
|
2489
3044
|
Description: 'Use self when defining module/class methods.'
|
2490
3045
|
StyleGuide: '#def-self-class-methods'
|
@@ -2492,19 +3047,36 @@ Style/ClassMethods:
|
|
2492
3047
|
VersionAdded: '0.9'
|
2493
3048
|
VersionChanged: '0.20'
|
2494
3049
|
|
3050
|
+
Style/ClassMethodsDefinitions:
|
3051
|
+
Description: 'Enforces using `def self.method_name` or `class << self` to define class methods.'
|
3052
|
+
StyleGuide: '#def-self-class-methods'
|
3053
|
+
Enabled: false
|
3054
|
+
VersionAdded: '0.89'
|
3055
|
+
EnforcedStyle: def_self
|
3056
|
+
SupportedStyles:
|
3057
|
+
- def_self
|
3058
|
+
- self_class
|
3059
|
+
|
2495
3060
|
Style/ClassVars:
|
2496
3061
|
Description: 'Avoid the use of class variables.'
|
2497
3062
|
StyleGuide: '#no-class-vars'
|
2498
3063
|
Enabled: true
|
2499
3064
|
VersionAdded: '0.13'
|
2500
3065
|
|
3066
|
+
Style/CollectionCompact:
|
3067
|
+
Description: 'Use `{Array,Hash}#{compact,compact!}` instead of custom logic to reject nils.'
|
3068
|
+
Enabled: pending
|
3069
|
+
Safe: false
|
3070
|
+
VersionAdded: '1.2'
|
3071
|
+
VersionChanged: '1.3'
|
3072
|
+
|
2501
3073
|
# Align with the style guide.
|
2502
3074
|
Style/CollectionMethods:
|
2503
3075
|
Description: 'Preferred collection methods.'
|
2504
3076
|
StyleGuide: '#map-find-select-reduce-include-size'
|
2505
3077
|
Enabled: false
|
2506
3078
|
VersionAdded: '0.9'
|
2507
|
-
VersionChanged: '
|
3079
|
+
VersionChanged: '1.7'
|
2508
3080
|
Safe: false
|
2509
3081
|
# Mapping from undesired method to desired method
|
2510
3082
|
# e.g. to use `detect` over `find`:
|
@@ -2519,6 +3091,11 @@ Style/CollectionMethods:
|
|
2519
3091
|
detect: 'find'
|
2520
3092
|
find_all: 'select'
|
2521
3093
|
member?: 'include?'
|
3094
|
+
# Methods in this array accept a final symbol as an implicit block
|
3095
|
+
# eg. `inject(:+)`
|
3096
|
+
MethodsAcceptingSymbol:
|
3097
|
+
- inject
|
3098
|
+
- reduce
|
2522
3099
|
|
2523
3100
|
Style/ColonMethodCall:
|
2524
3101
|
Description: 'Do not use :: for method call.'
|
@@ -2532,6 +3109,14 @@ Style/ColonMethodDefinition:
|
|
2532
3109
|
Enabled: true
|
2533
3110
|
VersionAdded: '0.52'
|
2534
3111
|
|
3112
|
+
Style/CombinableLoops:
|
3113
|
+
Description: >-
|
3114
|
+
Checks for places where multiple consecutive loops over the same data
|
3115
|
+
can be combined into a single loop.
|
3116
|
+
Enabled: true
|
3117
|
+
Safe: false
|
3118
|
+
VersionAdded: '0.90'
|
3119
|
+
|
2535
3120
|
Style/CommandLiteral:
|
2536
3121
|
Description: 'Use `` or %x around command literals.'
|
2537
3122
|
StyleGuide: '#percent-x'
|
@@ -2553,22 +3138,25 @@ Style/CommandLiteral:
|
|
2553
3138
|
Style/CommentAnnotation:
|
2554
3139
|
Description: >-
|
2555
3140
|
Checks formatting of special comments
|
2556
|
-
(TODO, FIXME, OPTIMIZE, HACK, REVIEW).
|
3141
|
+
(TODO, FIXME, OPTIMIZE, HACK, REVIEW, NOTE).
|
2557
3142
|
StyleGuide: '#annotate-keywords'
|
2558
3143
|
Enabled: true
|
2559
3144
|
VersionAdded: '0.10'
|
2560
|
-
VersionChanged: '
|
3145
|
+
VersionChanged: '1.3'
|
2561
3146
|
Keywords:
|
2562
3147
|
- TODO
|
2563
3148
|
- FIXME
|
2564
3149
|
- OPTIMIZE
|
2565
3150
|
- HACK
|
2566
3151
|
- REVIEW
|
3152
|
+
- NOTE
|
3153
|
+
RequireColon: true
|
2567
3154
|
|
2568
3155
|
Style/CommentedKeyword:
|
2569
3156
|
Description: 'Do not place comments on the same line as certain keywords.'
|
2570
3157
|
Enabled: true
|
2571
3158
|
VersionAdded: '0.51'
|
3159
|
+
VersionChanged: '1.7'
|
2572
3160
|
|
2573
3161
|
Style/ConditionalAssignment:
|
2574
3162
|
Description: >-
|
@@ -2597,6 +3185,8 @@ Style/ConstantVisibility:
|
|
2597
3185
|
visibility declarations.
|
2598
3186
|
Enabled: false
|
2599
3187
|
VersionAdded: '0.66'
|
3188
|
+
VersionChanged: '1.10'
|
3189
|
+
IgnoreModules: false
|
2600
3190
|
|
2601
3191
|
# Checks that you have put a copyright in a comment before any code.
|
2602
3192
|
#
|
@@ -2628,7 +3218,8 @@ Style/DateTime:
|
|
2628
3218
|
StyleGuide: '#date--time'
|
2629
3219
|
Enabled: false
|
2630
3220
|
VersionAdded: '0.51'
|
2631
|
-
VersionChanged: '0.
|
3221
|
+
VersionChanged: '0.92'
|
3222
|
+
SafeAutoCorrect: false
|
2632
3223
|
AllowCoercion: false
|
2633
3224
|
|
2634
3225
|
Style/DefWithParentheses:
|
@@ -2650,11 +3241,23 @@ Style/DisableCopsWithinSourceCodeDirective:
|
|
2650
3241
|
Forbids disabling/enabling cops within source code.
|
2651
3242
|
Enabled: false
|
2652
3243
|
VersionAdded: '0.82'
|
3244
|
+
VersionChanged: '1.9'
|
3245
|
+
AllowedCops: []
|
3246
|
+
|
3247
|
+
Style/DocumentDynamicEvalDefinition:
|
3248
|
+
Description: >-
|
3249
|
+
When using `class_eval` (or other `eval`) with string interpolation,
|
3250
|
+
add a comment block showing its appearance if interpolated.
|
3251
|
+
StyleGuide: '#eval-comment-docs'
|
3252
|
+
Enabled: pending
|
3253
|
+
VersionAdded: '1.1'
|
3254
|
+
VersionChanged: '1.3'
|
2653
3255
|
|
2654
3256
|
Style/Documentation:
|
2655
3257
|
Description: 'Document classes and non-namespace modules.'
|
2656
3258
|
Enabled: true
|
2657
3259
|
VersionAdded: '0.9'
|
3260
|
+
AllowedConstants: []
|
2658
3261
|
Exclude:
|
2659
3262
|
- 'spec/**/*'
|
2660
3263
|
- 'test/**/*'
|
@@ -2678,6 +3281,12 @@ Style/DoubleNegation:
|
|
2678
3281
|
StyleGuide: '#no-bang-bang'
|
2679
3282
|
Enabled: true
|
2680
3283
|
VersionAdded: '0.19'
|
3284
|
+
VersionChanged: '1.2'
|
3285
|
+
EnforcedStyle: allowed_in_returns
|
3286
|
+
SafeAutoCorrect: false
|
3287
|
+
SupportedStyles:
|
3288
|
+
- allowed_in_returns
|
3289
|
+
- forbidden
|
2681
3290
|
|
2682
3291
|
Style/EachForSimpleLoop:
|
2683
3292
|
Description: >-
|
@@ -2752,6 +3361,17 @@ Style/EndBlock:
|
|
2752
3361
|
VersionAdded: '0.9'
|
2753
3362
|
VersionChanged: '0.81'
|
2754
3363
|
|
3364
|
+
Style/EndlessMethod:
|
3365
|
+
Description: 'Avoid the use of multi-lined endless method definitions.'
|
3366
|
+
StyleGuide: '#endless-methods'
|
3367
|
+
Enabled: pending
|
3368
|
+
VersionAdded: '1.8'
|
3369
|
+
EnforcedStyle: allow_single_line
|
3370
|
+
SupportedStyles:
|
3371
|
+
- allow_single_line
|
3372
|
+
- allow_always
|
3373
|
+
- disallow
|
3374
|
+
|
2755
3375
|
Style/EvalWithLocation:
|
2756
3376
|
Description: 'Pass `__FILE__` and `__LINE__` to `eval` method, as they are used by backtraces.'
|
2757
3377
|
Enabled: true
|
@@ -2769,10 +3389,19 @@ Style/ExpandPathArguments:
|
|
2769
3389
|
Enabled: true
|
2770
3390
|
VersionAdded: '0.53'
|
2771
3391
|
|
3392
|
+
Style/ExplicitBlockArgument:
|
3393
|
+
Description: >-
|
3394
|
+
Consider using explicit block argument to avoid writing block literal
|
3395
|
+
that just passes its arguments to another block.
|
3396
|
+
StyleGuide: '#block-argument'
|
3397
|
+
Enabled: true
|
3398
|
+
VersionAdded: '0.89'
|
3399
|
+
VersionChanged: '1.8'
|
3400
|
+
|
2772
3401
|
Style/ExponentialNotation:
|
2773
3402
|
Description: 'When using exponential notation, favor a mantissa between 1 (inclusive) and 10 (exclusive).'
|
2774
3403
|
StyleGuide: '#exponential-notation'
|
2775
|
-
Enabled:
|
3404
|
+
Enabled: true
|
2776
3405
|
VersionAdded: '0.82'
|
2777
3406
|
EnforcedStyle: scientific
|
2778
3407
|
SupportedStyles:
|
@@ -2783,9 +3412,11 @@ Style/ExponentialNotation:
|
|
2783
3412
|
Style/FloatDivision:
|
2784
3413
|
Description: 'For performing float division, coerce one side only.'
|
2785
3414
|
StyleGuide: '#float-division'
|
2786
|
-
Reference: 'https://
|
3415
|
+
Reference: 'https://blog.rubystyle.guide/ruby/2019/06/21/float-division.html'
|
2787
3416
|
Enabled: true
|
2788
3417
|
VersionAdded: '0.72'
|
3418
|
+
VersionChanged: '1.9'
|
3419
|
+
Safe: false
|
2789
3420
|
EnforcedStyle: single_coerce
|
2790
3421
|
SupportedStyles:
|
2791
3422
|
- left_coerce
|
@@ -2827,8 +3458,13 @@ Style/FormatStringToken:
|
|
2827
3458
|
# Prefer simple looking "template" style tokens like `%{name}`, `%{age}`
|
2828
3459
|
- template
|
2829
3460
|
- unannotated
|
3461
|
+
# `MaxUnannotatedPlaceholdersAllowed` defines the number of `unannotated`
|
3462
|
+
# style token in a format string to be allowed when enforced style is not
|
3463
|
+
# `unannotated`.
|
3464
|
+
MaxUnannotatedPlaceholdersAllowed: 1
|
2830
3465
|
VersionAdded: '0.49'
|
2831
|
-
VersionChanged: '0
|
3466
|
+
VersionChanged: '1.0'
|
3467
|
+
IgnoredMethods: []
|
2832
3468
|
|
2833
3469
|
Style/FrozenStringLiteralComment:
|
2834
3470
|
Description: >-
|
@@ -2841,8 +3477,7 @@ Style/FrozenStringLiteralComment:
|
|
2841
3477
|
SupportedStyles:
|
2842
3478
|
# `always` will always add the frozen string literal comment to a file
|
2843
3479
|
# regardless of the Ruby version or if `freeze` or `<<` are called on a
|
2844
|
-
# string literal.
|
2845
|
-
# possible that this will create errors in Ruby 2.3.0+.
|
3480
|
+
# string literal. It is possible that this will create errors.
|
2846
3481
|
- always
|
2847
3482
|
# `always_true` will add the frozen string literal comment to a file,
|
2848
3483
|
# similarly to the `always` style, but will also change any disabled
|
@@ -2851,7 +3486,14 @@ Style/FrozenStringLiteralComment:
|
|
2851
3486
|
# `never` will enforce that the frozen string literal comment does not
|
2852
3487
|
# exist in a file.
|
2853
3488
|
- never
|
2854
|
-
|
3489
|
+
SafeAutoCorrect: false
|
3490
|
+
|
3491
|
+
Style/GlobalStdStream:
|
3492
|
+
Description: 'Enforces the use of `$stdout/$stderr/$stdin` instead of `STDOUT/STDERR/STDIN`.'
|
3493
|
+
StyleGuide: '#global-stdout'
|
3494
|
+
Enabled: true
|
3495
|
+
VersionAdded: '0.89'
|
3496
|
+
SafeAutoCorrect: false
|
2855
3497
|
|
2856
3498
|
Style/GlobalVars:
|
2857
3499
|
Description: 'Do not introduce global variables.'
|
@@ -2872,12 +3514,51 @@ Style/GuardClause:
|
|
2872
3514
|
# needs to have to trigger this cop
|
2873
3515
|
MinBodyLength: 1
|
2874
3516
|
|
3517
|
+
Style/HashAsLastArrayItem:
|
3518
|
+
Description: >-
|
3519
|
+
Checks for presence or absence of braces around hash literal as a last
|
3520
|
+
array item depending on configuration.
|
3521
|
+
StyleGuide: '#hash-literal-as-last-array-item'
|
3522
|
+
Enabled: true
|
3523
|
+
VersionAdded: '0.88'
|
3524
|
+
EnforcedStyle: braces
|
3525
|
+
SupportedStyles:
|
3526
|
+
- braces
|
3527
|
+
- no_braces
|
3528
|
+
|
3529
|
+
Style/HashConversion:
|
3530
|
+
Description: 'Avoid Hash[] in favor of ary.to_h or literal hashes.'
|
3531
|
+
StyleGuide: '#avoid-hash-constructor'
|
3532
|
+
Enabled: pending
|
3533
|
+
VersionAdded: '1.10'
|
3534
|
+
VersionChanged: '1.11'
|
3535
|
+
AllowSplatArgument: true
|
3536
|
+
|
2875
3537
|
Style/HashEachMethods:
|
2876
3538
|
Description: 'Use Hash#each_key and Hash#each_value.'
|
2877
3539
|
StyleGuide: '#hash-each'
|
2878
|
-
Enabled:
|
2879
|
-
VersionAdded: '0.80'
|
3540
|
+
Enabled: true
|
2880
3541
|
Safe: false
|
3542
|
+
VersionAdded: '0.80'
|
3543
|
+
VersionChanged: '1.16'
|
3544
|
+
AllowedReceivers: []
|
3545
|
+
|
3546
|
+
Style/HashExcept:
|
3547
|
+
Description: >-
|
3548
|
+
Checks for usages of `Hash#reject`, `Hash#select`, and `Hash#filter` methods
|
3549
|
+
that can be replaced with `Hash#except` method.
|
3550
|
+
Enabled: pending
|
3551
|
+
VersionAdded: '1.7'
|
3552
|
+
|
3553
|
+
Style/HashLikeCase:
|
3554
|
+
Description: >-
|
3555
|
+
Checks for places where `case-when` represents a simple 1:1
|
3556
|
+
mapping and can be replaced with a hash lookup.
|
3557
|
+
Enabled: true
|
3558
|
+
VersionAdded: '0.88'
|
3559
|
+
# `MinBranchesCount` defines the number of branches `case` needs to have
|
3560
|
+
# to trigger this cop
|
3561
|
+
MinBranchesCount: 3
|
2881
3562
|
|
2882
3563
|
Style/HashSyntax:
|
2883
3564
|
Description: >-
|
@@ -2903,15 +3584,17 @@ Style/HashSyntax:
|
|
2903
3584
|
PreferHashRocketsForNonAlnumEndingSymbols: false
|
2904
3585
|
|
2905
3586
|
Style/HashTransformKeys:
|
2906
|
-
Description: 'Prefer `transform_keys` over `each_with_object`
|
2907
|
-
Enabled:
|
3587
|
+
Description: 'Prefer `transform_keys` over `each_with_object`, `map`, or `to_h`.'
|
3588
|
+
Enabled: true
|
2908
3589
|
VersionAdded: '0.80'
|
3590
|
+
VersionChanged: '0.90'
|
2909
3591
|
Safe: false
|
2910
3592
|
|
2911
3593
|
Style/HashTransformValues:
|
2912
|
-
Description: 'Prefer `transform_values` over `each_with_object`
|
2913
|
-
Enabled:
|
3594
|
+
Description: 'Prefer `transform_values` over `each_with_object`, `map`, or `to_h`.'
|
3595
|
+
Enabled: true
|
2914
3596
|
VersionAdded: '0.80'
|
3597
|
+
VersionChanged: '0.90'
|
2915
3598
|
Safe: false
|
2916
3599
|
|
2917
3600
|
Style/IdenticalConditionalBranches:
|
@@ -2921,12 +3604,14 @@ Style/IdenticalConditionalBranches:
|
|
2921
3604
|
out of the conditional.
|
2922
3605
|
Enabled: true
|
2923
3606
|
VersionAdded: '0.36'
|
3607
|
+
VersionChanged: '1.16'
|
2924
3608
|
|
2925
3609
|
Style/IfInsideElse:
|
2926
3610
|
Description: 'Finds if nodes inside else, which can be converted to elsif.'
|
2927
3611
|
Enabled: true
|
2928
3612
|
AllowIfModifier: false
|
2929
3613
|
VersionAdded: '0.36'
|
3614
|
+
VersionChanged: '1.3'
|
2930
3615
|
|
2931
3616
|
Style/IfUnlessModifier:
|
2932
3617
|
Description: >-
|
@@ -2942,12 +3627,22 @@ Style/IfUnlessModifierOfIfUnless:
|
|
2942
3627
|
Avoid modifier if/unless usage on conditionals.
|
2943
3628
|
Enabled: true
|
2944
3629
|
VersionAdded: '0.39'
|
3630
|
+
VersionChanged: '0.87'
|
3631
|
+
|
3632
|
+
Style/IfWithBooleanLiteralBranches:
|
3633
|
+
Description: 'Checks for redundant `if` with boolean literal branches.'
|
3634
|
+
Enabled: pending
|
3635
|
+
VersionAdded: '1.9'
|
3636
|
+
SafeAutoCorrect: false
|
3637
|
+
AllowedMethods:
|
3638
|
+
- nonzero?
|
2945
3639
|
|
2946
3640
|
Style/IfWithSemicolon:
|
2947
3641
|
Description: 'Do not use if x; .... Use the ternary operator instead.'
|
2948
3642
|
StyleGuide: '#no-semicolon-ifs'
|
2949
3643
|
Enabled: true
|
2950
3644
|
VersionAdded: '0.9'
|
3645
|
+
VersionChanged: '0.83'
|
2951
3646
|
|
2952
3647
|
Style/ImplicitRuntimeError:
|
2953
3648
|
Description: >-
|
@@ -2956,13 +3651,21 @@ Style/ImplicitRuntimeError:
|
|
2956
3651
|
Enabled: false
|
2957
3652
|
VersionAdded: '0.41'
|
2958
3653
|
|
3654
|
+
Style/InPatternThen:
|
3655
|
+
Description: 'Checks for `in;` uses in `case` expressions.'
|
3656
|
+
StyleGuide: '#no-in-pattern-semicolons'
|
3657
|
+
Enabled: pending
|
3658
|
+
VersionAdded: '1.16'
|
3659
|
+
|
2959
3660
|
Style/InfiniteLoop:
|
2960
|
-
Description:
|
3661
|
+
Description: >-
|
3662
|
+
Use Kernel#loop for infinite loops.
|
3663
|
+
This cop is unsafe in the body may raise a `StopIteration` exception.
|
3664
|
+
Safe: false
|
2961
3665
|
StyleGuide: '#infinite-loop'
|
2962
3666
|
Enabled: true
|
2963
3667
|
VersionAdded: '0.26'
|
2964
3668
|
VersionChanged: '0.61'
|
2965
|
-
SafeAutoCorrect: true
|
2966
3669
|
|
2967
3670
|
Style/InlineComment:
|
2968
3671
|
Description: 'Avoid trailing inline comments.'
|
@@ -3000,11 +3703,23 @@ Style/IpAddresses:
|
|
3000
3703
|
Description: "Don't include literal IP addresses in code."
|
3001
3704
|
Enabled: false
|
3002
3705
|
VersionAdded: '0.58'
|
3003
|
-
VersionChanged: '0.
|
3706
|
+
VersionChanged: '0.91'
|
3004
3707
|
# Allow addresses to be permitted
|
3005
3708
|
AllowedAddresses:
|
3006
3709
|
- "::"
|
3007
3710
|
# :: is a valid IPv6 address, but could potentially be legitimately in code
|
3711
|
+
Exclude:
|
3712
|
+
- '**/*.gemfile'
|
3713
|
+
- '**/Gemfile'
|
3714
|
+
- '**/gems.rb'
|
3715
|
+
- '**/*.gemspec'
|
3716
|
+
|
3717
|
+
Style/KeywordParametersOrder:
|
3718
|
+
Description: 'Enforces that optional keyword parameters are placed at the end of the parameters list.'
|
3719
|
+
StyleGuide: '#keyword-parameters-order'
|
3720
|
+
Enabled: true
|
3721
|
+
VersionAdded: '0.90'
|
3722
|
+
VersionChanged: '1.7'
|
3008
3723
|
|
3009
3724
|
Style/Lambda:
|
3010
3725
|
Description: 'Use the new lambda literal syntax for single-line blocks.'
|
@@ -3043,7 +3758,7 @@ Style/MethodCallWithArgsParentheses:
|
|
3043
3758
|
StyleGuide: '#method-invocation-parens'
|
3044
3759
|
Enabled: false
|
3045
3760
|
VersionAdded: '0.47'
|
3046
|
-
VersionChanged: '
|
3761
|
+
VersionChanged: '1.7'
|
3047
3762
|
IgnoreMacros: true
|
3048
3763
|
IgnoredMethods: []
|
3049
3764
|
IgnoredPatterns: []
|
@@ -3051,6 +3766,7 @@ Style/MethodCallWithArgsParentheses:
|
|
3051
3766
|
AllowParenthesesInMultilineCall: false
|
3052
3767
|
AllowParenthesesInChaining: false
|
3053
3768
|
AllowParenthesesInCamelCaseMethod: false
|
3769
|
+
AllowParenthesesInStringInterpolation: false
|
3054
3770
|
EnforcedStyle: require_parentheses
|
3055
3771
|
SupportedStyles:
|
3056
3772
|
- require_parentheses
|
@@ -3077,19 +3793,13 @@ Style/MethodDefParentheses:
|
|
3077
3793
|
StyleGuide: '#method-parens'
|
3078
3794
|
Enabled: true
|
3079
3795
|
VersionAdded: '0.16'
|
3080
|
-
VersionChanged: '
|
3796
|
+
VersionChanged: '1.7'
|
3081
3797
|
EnforcedStyle: require_parentheses
|
3082
3798
|
SupportedStyles:
|
3083
3799
|
- require_parentheses
|
3084
3800
|
- require_no_parentheses
|
3085
3801
|
- require_no_parentheses_except_multiline
|
3086
3802
|
|
3087
|
-
Style/MethodMissingSuper:
|
3088
|
-
Description: Checks for `method_missing` to call `super`.
|
3089
|
-
StyleGuide: '#no-method-missing'
|
3090
|
-
Enabled: true
|
3091
|
-
VersionAdded: '0.56'
|
3092
|
-
|
3093
3803
|
Style/MinMax:
|
3094
3804
|
Description: >-
|
3095
3805
|
Use `Enumerable#minmax` instead of `Enumerable#min`
|
@@ -3175,6 +3885,12 @@ Style/MultilineIfThen:
|
|
3175
3885
|
VersionAdded: '0.9'
|
3176
3886
|
VersionChanged: '0.26'
|
3177
3887
|
|
3888
|
+
Style/MultilineInPatternThen:
|
3889
|
+
Description: 'Do not use `then` for multi-line `in` statement.'
|
3890
|
+
StyleGuide: '#no-then'
|
3891
|
+
Enabled: pending
|
3892
|
+
VersionAdded: '1.16'
|
3893
|
+
|
3178
3894
|
Style/MultilineMemoization:
|
3179
3895
|
Description: 'Wrap multiline memoizations in a `begin` and `end` block.'
|
3180
3896
|
Enabled: true
|
@@ -3189,6 +3905,7 @@ Style/MultilineMethodSignature:
|
|
3189
3905
|
Description: 'Avoid multi-line method signatures.'
|
3190
3906
|
Enabled: false
|
3191
3907
|
VersionAdded: '0.59'
|
3908
|
+
VersionChanged: '1.7'
|
3192
3909
|
|
3193
3910
|
Style/MultilineTernaryOperator:
|
3194
3911
|
Description: >-
|
@@ -3197,6 +3914,7 @@ Style/MultilineTernaryOperator:
|
|
3197
3914
|
StyleGuide: '#no-multiline-ternary'
|
3198
3915
|
Enabled: true
|
3199
3916
|
VersionAdded: '0.9'
|
3917
|
+
VersionChanged: '0.86'
|
3200
3918
|
|
3201
3919
|
Style/MultilineWhenThen:
|
3202
3920
|
Description: 'Do not use then for multi-line when statement.'
|
@@ -3210,12 +3928,14 @@ Style/MultipleComparison:
|
|
3210
3928
|
use Array#include? instead.
|
3211
3929
|
Enabled: true
|
3212
3930
|
VersionAdded: '0.49'
|
3931
|
+
VersionChanged: '1.1'
|
3213
3932
|
|
3214
3933
|
Style/MutableConstant:
|
3215
3934
|
Description: 'Do not assign mutable objects to constants.'
|
3216
3935
|
Enabled: true
|
3217
3936
|
VersionAdded: '0.34'
|
3218
|
-
VersionChanged: '
|
3937
|
+
VersionChanged: '1.8'
|
3938
|
+
SafeAutoCorrect: false
|
3219
3939
|
EnforcedStyle: literals
|
3220
3940
|
SupportedStyles:
|
3221
3941
|
# literals: freeze literals assigned to constants
|
@@ -3244,6 +3964,13 @@ Style/NegatedIf:
|
|
3244
3964
|
- prefix
|
3245
3965
|
- postfix
|
3246
3966
|
|
3967
|
+
Style/NegatedIfElseCondition:
|
3968
|
+
Description: >-
|
3969
|
+
This cop checks for uses of `if-else` and ternary operators with a negated condition
|
3970
|
+
which can be simplified by inverting condition and swapping branches.
|
3971
|
+
Enabled: pending
|
3972
|
+
VersionAdded: '1.2'
|
3973
|
+
|
3247
3974
|
Style/NegatedUnless:
|
3248
3975
|
Description: 'Favor if over unless for negative conditions.'
|
3249
3976
|
StyleGuide: '#if-for-negatives'
|
@@ -3301,6 +4028,7 @@ Style/NestedTernaryOperator:
|
|
3301
4028
|
StyleGuide: '#no-nested-ternary'
|
3302
4029
|
Enabled: true
|
3303
4030
|
VersionAdded: '0.9'
|
4031
|
+
VersionChanged: '0.86'
|
3304
4032
|
|
3305
4033
|
Style/Next:
|
3306
4034
|
Description: 'Use `next` to skip iteration instead of a condition at the end.'
|
@@ -3330,6 +4058,12 @@ Style/NilComparison:
|
|
3330
4058
|
- predicate
|
3331
4059
|
- comparison
|
3332
4060
|
|
4061
|
+
Style/NilLambda:
|
4062
|
+
Description: 'Prefer `-> {}` to `-> { nil }`.'
|
4063
|
+
Enabled: pending
|
4064
|
+
VersionAdded: '1.3'
|
4065
|
+
VersionChanged: '1.15'
|
4066
|
+
|
3333
4067
|
Style/NonNilCheck:
|
3334
4068
|
Description: 'Checks for redundant nil checks.'
|
3335
4069
|
StyleGuide: '#no-non-nil-checks'
|
@@ -3383,7 +4117,6 @@ Style/NumericPredicate:
|
|
3383
4117
|
# object. Switching these methods has to be done with knowledge of the types
|
3384
4118
|
# of the variables which rubocop doesn't have.
|
3385
4119
|
SafeAutoCorrect: false
|
3386
|
-
AutoCorrect: false
|
3387
4120
|
Enabled: true
|
3388
4121
|
VersionAdded: '0.42'
|
3389
4122
|
VersionChanged: '0.59'
|
@@ -3399,12 +4132,13 @@ Style/NumericPredicate:
|
|
3399
4132
|
|
3400
4133
|
Style/OneLineConditional:
|
3401
4134
|
Description: >-
|
3402
|
-
Favor the ternary operator(?:) over
|
3403
|
-
if/then/else/end constructs.
|
4135
|
+
Favor the ternary operator (?:) or multi-line constructs over
|
4136
|
+
single-line if/then/else/end constructs.
|
3404
4137
|
StyleGuide: '#ternary-operator'
|
3405
4138
|
Enabled: true
|
4139
|
+
AlwaysCorrectToMultiline: false
|
3406
4140
|
VersionAdded: '0.9'
|
3407
|
-
VersionChanged: '0.
|
4141
|
+
VersionChanged: '0.90'
|
3408
4142
|
|
3409
4143
|
Style/OptionHash:
|
3410
4144
|
Description: "Don't use option hashes when you can use keyword arguments."
|
@@ -3425,7 +4159,18 @@ Style/OptionalArguments:
|
|
3425
4159
|
of the argument list.
|
3426
4160
|
StyleGuide: '#optional-arguments'
|
3427
4161
|
Enabled: true
|
4162
|
+
Safe: false
|
3428
4163
|
VersionAdded: '0.33'
|
4164
|
+
VersionChanged: '0.83'
|
4165
|
+
|
4166
|
+
Style/OptionalBooleanParameter:
|
4167
|
+
Description: 'Use keyword arguments when defining method with boolean argument.'
|
4168
|
+
StyleGuide: '#boolean-keyword-arguments'
|
4169
|
+
Enabled: true
|
4170
|
+
Safe: false
|
4171
|
+
VersionAdded: '0.89'
|
4172
|
+
AllowedMethods:
|
4173
|
+
- respond_to_missing?
|
3429
4174
|
|
3430
4175
|
Style/OrAssignment:
|
3431
4176
|
Description: 'Recommend usage of double pipe equals (||=) where applicable.'
|
@@ -3468,7 +4213,7 @@ Style/PercentLiteralDelimiters:
|
|
3468
4213
|
'%r': '{}'
|
3469
4214
|
'%w': '[]'
|
3470
4215
|
'%W': '[]'
|
3471
|
-
VersionChanged: '0.48
|
4216
|
+
VersionChanged: '0.48'
|
3472
4217
|
|
3473
4218
|
Style/PercentQLiterals:
|
3474
4219
|
Description: 'Checks if uses of %Q/%q match the configured preference.'
|
@@ -3504,16 +4249,27 @@ Style/Proc:
|
|
3504
4249
|
VersionAdded: '0.9'
|
3505
4250
|
VersionChanged: '0.18'
|
3506
4251
|
|
4252
|
+
Style/QuotedSymbols:
|
4253
|
+
Description: 'Use a consistent style for quoted symbols.'
|
4254
|
+
Enabled: pending
|
4255
|
+
VersionAdded: '1.16'
|
4256
|
+
EnforcedStyle: same_as_string_literals
|
4257
|
+
SupportedStyles:
|
4258
|
+
- same_as_string_literals
|
4259
|
+
- single_quotes
|
4260
|
+
- double_quotes
|
4261
|
+
|
3507
4262
|
Style/RaiseArgs:
|
3508
4263
|
Description: 'Checks the arguments passed to raise/fail.'
|
3509
4264
|
StyleGuide: '#exception-class-messages'
|
3510
4265
|
Enabled: true
|
3511
4266
|
VersionAdded: '0.14'
|
3512
|
-
VersionChanged: '
|
4267
|
+
VersionChanged: '1.2'
|
3513
4268
|
EnforcedStyle: exploded
|
3514
4269
|
SupportedStyles:
|
3515
4270
|
- compact # raise Exception.new(msg)
|
3516
4271
|
- exploded # raise Exception, msg
|
4272
|
+
AllowedCompactTypes: []
|
3517
4273
|
|
3518
4274
|
Style/RandomWithOffset:
|
3519
4275
|
Description: >-
|
@@ -3523,6 +4279,27 @@ Style/RandomWithOffset:
|
|
3523
4279
|
Enabled: true
|
3524
4280
|
VersionAdded: '0.52'
|
3525
4281
|
|
4282
|
+
Style/RedundantArgument:
|
4283
|
+
Description: 'Check for a redundant argument passed to certain methods.'
|
4284
|
+
Enabled: pending
|
4285
|
+
Safe: false
|
4286
|
+
VersionAdded: '1.4'
|
4287
|
+
VersionChanged: '1.7'
|
4288
|
+
Methods:
|
4289
|
+
# Array#join
|
4290
|
+
join: ''
|
4291
|
+
# String#split
|
4292
|
+
split: ' '
|
4293
|
+
# String#chomp
|
4294
|
+
chomp: "\n"
|
4295
|
+
# String#chomp!
|
4296
|
+
chomp!: "\n"
|
4297
|
+
|
4298
|
+
Style/RedundantAssignment:
|
4299
|
+
Description: 'Checks for redundant assignment before returning.'
|
4300
|
+
Enabled: true
|
4301
|
+
VersionAdded: '0.87'
|
4302
|
+
|
3526
4303
|
Style/RedundantBegin:
|
3527
4304
|
Description: "Don't use begin blocks when they are not needed."
|
3528
4305
|
StyleGuide: '#begin-implicit'
|
@@ -3552,6 +4329,27 @@ Style/RedundantException:
|
|
3552
4329
|
VersionAdded: '0.14'
|
3553
4330
|
VersionChanged: '0.29'
|
3554
4331
|
|
4332
|
+
Style/RedundantFetchBlock:
|
4333
|
+
Description: >-
|
4334
|
+
Use `fetch(key, value)` instead of `fetch(key) { value }`
|
4335
|
+
when value has Numeric, Rational, Complex, Symbol or String type, `false`, `true`, `nil` or is a constant.
|
4336
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#hashfetch-with-argument-vs-hashfetch--block-code'
|
4337
|
+
Enabled: true
|
4338
|
+
Safe: false
|
4339
|
+
# If enabled, this cop will autocorrect usages of
|
4340
|
+
# `fetch` being called with block returning a constant.
|
4341
|
+
# This can be dangerous since constants will not be defined at that moment.
|
4342
|
+
SafeForConstants: false
|
4343
|
+
VersionAdded: '0.86'
|
4344
|
+
|
4345
|
+
Style/RedundantFileExtensionInRequire:
|
4346
|
+
Description: >-
|
4347
|
+
Checks for the presence of superfluous `.rb` extension in
|
4348
|
+
the filename provided to `require` and `require_relative`.
|
4349
|
+
StyleGuide: '#no-explicit-rb-to-require'
|
4350
|
+
Enabled: true
|
4351
|
+
VersionAdded: '0.88'
|
4352
|
+
|
3555
4353
|
Style/RedundantFreeze:
|
3556
4354
|
Description: "Checks usages of Object#freeze on immutable objects."
|
3557
4355
|
Enabled: true
|
@@ -3574,6 +4372,16 @@ Style/RedundantPercentQ:
|
|
3574
4372
|
Enabled: true
|
3575
4373
|
VersionAdded: '0.76'
|
3576
4374
|
|
4375
|
+
Style/RedundantRegexpCharacterClass:
|
4376
|
+
Description: 'Checks for unnecessary single-element Regexp character classes.'
|
4377
|
+
Enabled: true
|
4378
|
+
VersionAdded: '0.85'
|
4379
|
+
|
4380
|
+
Style/RedundantRegexpEscape:
|
4381
|
+
Description: 'Checks for redundant escapes in Regexps.'
|
4382
|
+
Enabled: true
|
4383
|
+
VersionAdded: '0.85'
|
4384
|
+
|
3577
4385
|
Style/RedundantReturn:
|
3578
4386
|
Description: "Don't use return where it's not required."
|
3579
4387
|
StyleGuide: '#no-explicit-return'
|
@@ -3590,6 +4398,12 @@ Style/RedundantSelf:
|
|
3590
4398
|
VersionAdded: '0.10'
|
3591
4399
|
VersionChanged: '0.13'
|
3592
4400
|
|
4401
|
+
Style/RedundantSelfAssignment:
|
4402
|
+
Description: 'Checks for places where redundant assignments are made for in place modification methods.'
|
4403
|
+
Enabled: true
|
4404
|
+
Safe: false
|
4405
|
+
VersionAdded: '0.90'
|
4406
|
+
|
3593
4407
|
Style/RedundantSort:
|
3594
4408
|
Description: >-
|
3595
4409
|
Use `min` instead of `sort.first`,
|
@@ -3652,6 +4466,8 @@ Style/SafeNavigation:
|
|
3652
4466
|
This cop transforms usages of a method call safeguarded by
|
3653
4467
|
a check for the existence of the object to
|
3654
4468
|
safe navigation (`&.`).
|
4469
|
+
Auto-correction is unsafe as it assumes the object will
|
4470
|
+
be `nil` or truthy, but never `false`.
|
3655
4471
|
Enabled: true
|
3656
4472
|
VersionAdded: '0.43'
|
3657
4473
|
VersionChanged: '0.77'
|
@@ -3664,6 +4480,7 @@ Style/SafeNavigation:
|
|
3664
4480
|
- presence
|
3665
4481
|
- try
|
3666
4482
|
- try!
|
4483
|
+
SafeAutoCorrect: false
|
3667
4484
|
|
3668
4485
|
Style/Sample:
|
3669
4486
|
Description: >-
|
@@ -3709,11 +4526,17 @@ Style/SignalException:
|
|
3709
4526
|
- only_fail
|
3710
4527
|
- semantic
|
3711
4528
|
|
4529
|
+
Style/SingleArgumentDig:
|
4530
|
+
Description: 'Avoid using single argument dig method.'
|
4531
|
+
Enabled: true
|
4532
|
+
VersionAdded: '0.89'
|
4533
|
+
Safe: false
|
4534
|
+
|
3712
4535
|
Style/SingleLineBlockParams:
|
3713
4536
|
Description: 'Enforces the names of some block params.'
|
3714
4537
|
Enabled: false
|
3715
4538
|
VersionAdded: '0.16'
|
3716
|
-
VersionChanged: '
|
4539
|
+
VersionChanged: '1.6'
|
3717
4540
|
Methods:
|
3718
4541
|
- reduce:
|
3719
4542
|
- acc
|
@@ -3727,9 +4550,24 @@ Style/SingleLineMethods:
|
|
3727
4550
|
StyleGuide: '#no-single-line-methods'
|
3728
4551
|
Enabled: true
|
3729
4552
|
VersionAdded: '0.9'
|
3730
|
-
VersionChanged: '
|
4553
|
+
VersionChanged: '1.8'
|
3731
4554
|
AllowIfMethodIsEmpty: true
|
3732
4555
|
|
4556
|
+
Style/SlicingWithRange:
|
4557
|
+
Description: 'Checks array slicing is done with endless ranges when suitable.'
|
4558
|
+
Enabled: true
|
4559
|
+
VersionAdded: '0.83'
|
4560
|
+
Safe: false
|
4561
|
+
|
4562
|
+
Style/SoleNestedConditional:
|
4563
|
+
Description: >-
|
4564
|
+
Finds sole nested conditional nodes
|
4565
|
+
which can be merged into outer conditional node.
|
4566
|
+
Enabled: true
|
4567
|
+
VersionAdded: '0.89'
|
4568
|
+
VersionChanged: '1.5'
|
4569
|
+
AllowModifier: false
|
4570
|
+
|
3733
4571
|
Style/SpecialGlobalVars:
|
3734
4572
|
Description: 'Avoid Perl-style global variables.'
|
3735
4573
|
StyleGuide: '#no-cryptic-perlisms'
|
@@ -3752,12 +4590,35 @@ Style/StabbyLambdaParentheses:
|
|
3752
4590
|
- require_parentheses
|
3753
4591
|
- require_no_parentheses
|
3754
4592
|
|
4593
|
+
Style/StaticClass:
|
4594
|
+
Description: 'Prefer modules to classes with only class methods.'
|
4595
|
+
StyleGuide: '#modules-vs-classes'
|
4596
|
+
Enabled: false
|
4597
|
+
Safe: false
|
4598
|
+
VersionAdded: '1.3'
|
4599
|
+
|
3755
4600
|
Style/StderrPuts:
|
3756
4601
|
Description: 'Use `warn` instead of `$stderr.puts`.'
|
3757
4602
|
StyleGuide: '#warn'
|
3758
4603
|
Enabled: true
|
3759
4604
|
VersionAdded: '0.51'
|
3760
4605
|
|
4606
|
+
Style/StringChars:
|
4607
|
+
Description: 'Checks for uses of `String#split` with empty string or regexp literal argument.'
|
4608
|
+
StyleGuide: '#string-chars'
|
4609
|
+
Enabled: pending
|
4610
|
+
Safe: false
|
4611
|
+
VersionAdded: '1.12'
|
4612
|
+
|
4613
|
+
Style/StringConcatenation:
|
4614
|
+
Description: 'Checks for places where string concatenation can be replaced with string interpolation.'
|
4615
|
+
StyleGuide: '#string-interpolation'
|
4616
|
+
Enabled: true
|
4617
|
+
Safe: false
|
4618
|
+
VersionAdded: '0.89'
|
4619
|
+
VersionChanged: '1.18'
|
4620
|
+
Mode: aggressive
|
4621
|
+
|
3761
4622
|
Style/StringHashKeys:
|
3762
4623
|
Description: 'Prefer symbols instead of strings as hash keys.'
|
3763
4624
|
StyleGuide: '#symbols-as-keys'
|
@@ -3795,7 +4656,7 @@ Style/StringMethods:
|
|
3795
4656
|
Description: 'Checks if configured preferred methods are used over non-preferred.'
|
3796
4657
|
Enabled: false
|
3797
4658
|
VersionAdded: '0.34'
|
3798
|
-
VersionChanged: '0.34
|
4659
|
+
VersionChanged: '0.34'
|
3799
4660
|
# Mapping from undesired method to desired_method
|
3800
4661
|
# e.g. to use `to_sym` over `intern`:
|
3801
4662
|
#
|
@@ -3815,6 +4676,14 @@ Style/StructInheritance:
|
|
3815
4676
|
StyleGuide: '#no-extend-struct-new'
|
3816
4677
|
Enabled: true
|
3817
4678
|
VersionAdded: '0.29'
|
4679
|
+
VersionChanged: '0.86'
|
4680
|
+
|
4681
|
+
Style/SwapValues:
|
4682
|
+
Description: 'This cop enforces the use of shorthand-style swapping of 2 variables.'
|
4683
|
+
StyleGuide: '#values-swapping'
|
4684
|
+
Enabled: pending
|
4685
|
+
VersionAdded: '1.1'
|
4686
|
+
SafeAutoCorrect: false
|
3818
4687
|
|
3819
4688
|
Style/SymbolArray:
|
3820
4689
|
Description: 'Use %i or %I for arrays of symbols.'
|
@@ -3836,9 +4705,10 @@ Style/SymbolLiteral:
|
|
3836
4705
|
Style/SymbolProc:
|
3837
4706
|
Description: 'Use symbols as procs instead of blocks when possible.'
|
3838
4707
|
Enabled: true
|
3839
|
-
|
4708
|
+
Safe: false
|
3840
4709
|
VersionAdded: '0.26'
|
3841
|
-
VersionChanged: '
|
4710
|
+
VersionChanged: '1.5'
|
4711
|
+
AllowMethodsWithArguments: false
|
3842
4712
|
# A list of method names to be ignored by the check.
|
3843
4713
|
# The names should be fairly unique, otherwise you'll end up ignoring lots of code.
|
3844
4714
|
IgnoredMethods:
|
@@ -3857,6 +4727,12 @@ Style/TernaryParentheses:
|
|
3857
4727
|
- require_parentheses_when_complex
|
3858
4728
|
AllowSafeAssignment: true
|
3859
4729
|
|
4730
|
+
Style/TopLevelMethodDefinition:
|
4731
|
+
Description: 'This cop looks for top-level method definitions.'
|
4732
|
+
StyleGuide: '#top-level-methods'
|
4733
|
+
Enabled: false
|
4734
|
+
VersionAdded: '1.15'
|
4735
|
+
|
3860
4736
|
Style/TrailingBodyOnClass:
|
3861
4737
|
Description: 'Class body goes below class statement.'
|
3862
4738
|
Enabled: true
|
@@ -3943,7 +4819,7 @@ Style/TrivialAccessors:
|
|
3943
4819
|
StyleGuide: '#attr_family'
|
3944
4820
|
Enabled: true
|
3945
4821
|
VersionAdded: '0.9'
|
3946
|
-
VersionChanged: '
|
4822
|
+
VersionChanged: '1.15'
|
3947
4823
|
# When set to `false` the cop will suggest the use of accessor methods
|
3948
4824
|
# in situations like:
|
3949
4825
|
#
|
@@ -3962,7 +4838,7 @@ Style/TrivialAccessors:
|
|
3962
4838
|
# on_exception :restart
|
3963
4839
|
#
|
3964
4840
|
# Commonly used in DSLs
|
3965
|
-
AllowDSLWriters:
|
4841
|
+
AllowDSLWriters: true
|
3966
4842
|
IgnoreClassMethods: false
|
3967
4843
|
AllowedMethods:
|
3968
4844
|
- to_ary
|
@@ -3991,6 +4867,16 @@ Style/UnlessElse:
|
|
3991
4867
|
Enabled: true
|
3992
4868
|
VersionAdded: '0.9'
|
3993
4869
|
|
4870
|
+
Style/UnlessLogicalOperators:
|
4871
|
+
Description: >-
|
4872
|
+
Checks for use of logical operators in an unless condition.
|
4873
|
+
Enabled: false
|
4874
|
+
VersionAdded: '1.11'
|
4875
|
+
EnforcedStyle: forbid_mixed_logical_operators
|
4876
|
+
SupportedStyles:
|
4877
|
+
- forbid_mixed_logical_operators
|
4878
|
+
- forbid_logical_operators
|
4879
|
+
|
3994
4880
|
Style/UnpackFirst:
|
3995
4881
|
Description: >-
|
3996
4882
|
Checks for accessing the first element of `String#unpack`
|