rubocop 0.93.1 → 1.79.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -1
- data/README.md +133 -103
- data/assets/output.css.erb +159 -0
- data/assets/output.html.erb +2 -161
- data/config/default.yml +1864 -271
- data/config/internal_affairs.yml +31 -0
- data/config/obsoletion.yml +243 -0
- data/exe/rubocop +16 -9
- data/lib/rubocop/arguments_env.rb +17 -0
- data/lib/rubocop/arguments_file.rb +17 -0
- data/lib/rubocop/cache_config.rb +29 -0
- data/lib/rubocop/cached_data.rb +22 -8
- data/lib/rubocop/cli/command/{auto_genenerate_config.rb → auto_generate_config.rb} +55 -29
- data/lib/rubocop/cli/command/execute_runner.rb +39 -19
- data/lib/rubocop/cli/command/init_dotfile.rb +2 -4
- data/lib/rubocop/cli/command/lsp.rb +19 -0
- data/lib/rubocop/cli/command/show_cops.rb +26 -7
- data/lib/rubocop/cli/command/show_docs_url.rb +48 -0
- data/lib/rubocop/cli/command/suggest_extensions.rb +132 -0
- data/lib/rubocop/cli/command/version.rb +2 -2
- data/lib/rubocop/cli.rb +108 -16
- data/lib/rubocop/comment_config.rb +107 -104
- data/lib/rubocop/config.rb +160 -58
- data/lib/rubocop/config_finder.rb +78 -0
- data/lib/rubocop/config_loader.rb +112 -102
- data/lib/rubocop/config_loader_resolver.rb +124 -47
- data/lib/rubocop/config_obsoletion/changed_enforced_styles.rb +33 -0
- data/lib/rubocop/config_obsoletion/changed_parameter.rb +26 -0
- data/lib/rubocop/config_obsoletion/cop_rule.rb +33 -0
- data/lib/rubocop/config_obsoletion/extracted_cop.rb +47 -0
- data/lib/rubocop/config_obsoletion/parameter_rule.rb +56 -0
- data/lib/rubocop/config_obsoletion/removed_cop.rb +41 -0
- data/lib/rubocop/config_obsoletion/renamed_cop.rb +49 -0
- data/lib/rubocop/config_obsoletion/rule.rb +41 -0
- data/lib/rubocop/config_obsoletion/split_cop.rb +27 -0
- data/lib/rubocop/config_obsoletion.rb +110 -238
- data/lib/rubocop/config_regeneration.rb +1 -1
- data/lib/rubocop/config_store.rb +13 -3
- data/lib/rubocop/config_validator.rb +110 -43
- data/lib/rubocop/cop/autocorrect_logic.rb +82 -18
- data/lib/rubocop/cop/badge.rb +21 -26
- data/lib/rubocop/cop/base.rb +235 -118
- data/lib/rubocop/cop/bundler/duplicated_gem.rb +33 -16
- data/lib/rubocop/cop/bundler/duplicated_group.rb +127 -0
- data/lib/rubocop/cop/bundler/gem_comment.rb +46 -13
- data/lib/rubocop/cop/bundler/gem_filename.rb +102 -0
- data/lib/rubocop/cop/bundler/gem_version.rb +132 -0
- data/lib/rubocop/cop/bundler/insecure_protocol_source.rb +46 -22
- data/lib/rubocop/cop/bundler/ordered_gems.rb +17 -20
- data/lib/rubocop/cop/commissioner.rb +57 -36
- data/lib/rubocop/cop/cop.rb +86 -54
- data/lib/rubocop/cop/corrector.rb +41 -22
- data/lib/rubocop/cop/correctors/alignment_corrector.rb +10 -27
- data/lib/rubocop/cop/correctors/condition_corrector.rb +1 -1
- data/lib/rubocop/cop/correctors/each_to_for_corrector.rb +8 -14
- data/lib/rubocop/cop/correctors/empty_line_corrector.rb +1 -1
- data/lib/rubocop/cop/correctors/for_to_each_corrector.rb +11 -18
- data/lib/rubocop/cop/correctors/if_then_corrector.rb +55 -0
- data/lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb +10 -7
- data/lib/rubocop/cop/correctors/line_break_corrector.rb +13 -8
- data/lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb +26 -12
- data/lib/rubocop/cop/correctors/ordered_gem_corrector.rb +10 -16
- data/lib/rubocop/cop/correctors/parentheses_corrector.rb +65 -4
- data/lib/rubocop/cop/correctors/percent_literal_corrector.rb +17 -13
- data/lib/rubocop/cop/correctors/punctuation_corrector.rb +1 -1
- data/lib/rubocop/cop/correctors/require_library_corrector.rb +23 -0
- data/lib/rubocop/cop/correctors/space_corrector.rb +1 -1
- data/lib/rubocop/cop/correctors/string_literal_corrector.rb +7 -9
- data/lib/rubocop/cop/correctors/unused_arg_corrector.rb +2 -2
- data/lib/rubocop/cop/documentation.rb +47 -3
- data/lib/rubocop/cop/exclude_limit.rb +26 -0
- data/lib/rubocop/cop/force.rb +13 -1
- data/lib/rubocop/cop/gemspec/add_runtime_dependency.rb +38 -0
- data/lib/rubocop/cop/gemspec/attribute_assignment.rb +91 -0
- data/lib/rubocop/cop/gemspec/dependency_version.rb +152 -0
- data/lib/rubocop/cop/gemspec/deprecated_attribute_assignment.rb +91 -0
- data/lib/rubocop/cop/gemspec/development_dependencies.rb +107 -0
- data/lib/rubocop/cop/gemspec/duplicated_assignment.rb +47 -40
- data/lib/rubocop/cop/gemspec/ordered_dependencies.rb +16 -19
- data/lib/rubocop/cop/gemspec/require_mfa.rb +159 -0
- data/lib/rubocop/cop/gemspec/required_ruby_version.rb +50 -32
- data/lib/rubocop/cop/gemspec/ruby_version_globals_usage.rb +9 -14
- data/lib/rubocop/cop/generator/configuration_injector.rb +2 -3
- data/lib/rubocop/cop/generator/require_file_injector.rb +5 -8
- data/lib/rubocop/cop/generator.rb +38 -39
- data/lib/rubocop/cop/internal_affairs/cop_description.rb +118 -0
- data/lib/rubocop/cop/internal_affairs/cop_enabled.rb +85 -0
- data/lib/rubocop/cop/internal_affairs/create_empty_file.rb +37 -0
- data/lib/rubocop/cop/internal_affairs/empty_line_between_expect_offense_and_correction.rb +69 -0
- data/lib/rubocop/cop/internal_affairs/example_description.rb +118 -0
- data/lib/rubocop/cop/internal_affairs/example_heredoc_delimiter.rb +111 -0
- data/lib/rubocop/cop/internal_affairs/inherit_deprecated_cop_class.rb +34 -0
- data/lib/rubocop/cop/internal_affairs/lambda_or_proc.rb +46 -0
- data/lib/rubocop/cop/internal_affairs/location_exists.rb +116 -0
- data/lib/rubocop/cop/internal_affairs/location_expression.rb +38 -0
- data/lib/rubocop/cop/internal_affairs/location_line_equality_comparison.rb +61 -0
- data/lib/rubocop/cop/internal_affairs/method_name_end_with.rb +82 -0
- data/lib/rubocop/cop/internal_affairs/method_name_equal.rb +19 -22
- data/lib/rubocop/cop/internal_affairs/node_destructuring.rb +3 -3
- data/lib/rubocop/cop/internal_affairs/node_first_or_last_argument.rb +54 -0
- data/lib/rubocop/cop/internal_affairs/node_matcher_directive.rb +241 -0
- data/lib/rubocop/cop/internal_affairs/node_pattern_groups/ast_processor.rb +63 -0
- data/lib/rubocop/cop/internal_affairs/node_pattern_groups/ast_walker.rb +131 -0
- data/lib/rubocop/cop/internal_affairs/node_pattern_groups.rb +231 -0
- data/lib/rubocop/cop/internal_affairs/node_type_group.rb +92 -0
- data/lib/rubocop/cop/internal_affairs/node_type_multiple_predicates.rb +126 -0
- data/lib/rubocop/cop/internal_affairs/node_type_predicate.rb +5 -5
- data/lib/rubocop/cop/internal_affairs/numblock_handler.rb +69 -0
- data/lib/rubocop/cop/internal_affairs/offense_location_keyword.rb +3 -2
- data/lib/rubocop/cop/internal_affairs/on_send_without_on_csend.rb +90 -0
- data/lib/rubocop/cop/internal_affairs/operator_keyword.rb +48 -0
- data/lib/rubocop/cop/internal_affairs/plugin.rb +33 -0
- data/lib/rubocop/cop/internal_affairs/processed_source_buffer_name.rb +42 -0
- data/lib/rubocop/cop/internal_affairs/redundant_context_config_parameter.rb +46 -0
- data/lib/rubocop/cop/internal_affairs/redundant_described_class_as_subject.rb +63 -0
- data/lib/rubocop/cop/internal_affairs/redundant_expect_offense_arguments.rb +34 -0
- data/lib/rubocop/cop/internal_affairs/redundant_let_rubocop_config_new.rb +73 -0
- data/lib/rubocop/cop/internal_affairs/redundant_location_argument.rb +2 -1
- data/lib/rubocop/cop/internal_affairs/redundant_message_argument.rb +9 -21
- data/lib/rubocop/cop/internal_affairs/redundant_method_dispatch_node.rb +56 -0
- data/lib/rubocop/cop/internal_affairs/redundant_source_range.rb +75 -0
- data/lib/rubocop/cop/internal_affairs/single_line_comparison.rb +63 -0
- data/lib/rubocop/cop/internal_affairs/style_detected_api_use.rb +146 -0
- data/lib/rubocop/cop/internal_affairs/undefined_config.rb +94 -0
- data/lib/rubocop/cop/internal_affairs/useless_message_assertion.rb +6 -9
- data/lib/rubocop/cop/internal_affairs/useless_restrict_on_send.rb +60 -0
- data/lib/rubocop/cop/internal_affairs.rb +32 -1
- data/lib/rubocop/cop/layout/access_modifier_indentation.rb +18 -12
- data/lib/rubocop/cop/layout/argument_alignment.rb +79 -21
- data/lib/rubocop/cop/layout/array_alignment.rb +11 -10
- data/lib/rubocop/cop/layout/assignment_indentation.rb +13 -11
- data/lib/rubocop/cop/layout/begin_end_alignment.rb +2 -6
- data/lib/rubocop/cop/layout/block_alignment.rb +64 -53
- data/lib/rubocop/cop/layout/block_end_newline.rb +34 -15
- data/lib/rubocop/cop/layout/case_indentation.rb +73 -11
- data/lib/rubocop/cop/layout/class_structure.rb +114 -38
- data/lib/rubocop/cop/layout/closing_heredoc_indentation.rb +2 -3
- data/lib/rubocop/cop/layout/closing_parenthesis_indentation.rb +26 -36
- data/lib/rubocop/cop/layout/comment_indentation.rb +55 -28
- data/lib/rubocop/cop/layout/condition_position.rb +1 -5
- data/lib/rubocop/cop/layout/def_end_alignment.rb +6 -10
- data/lib/rubocop/cop/layout/dot_position.rb +48 -15
- data/lib/rubocop/cop/layout/else_alignment.rb +27 -13
- data/lib/rubocop/cop/layout/empty_comment.rb +9 -14
- data/lib/rubocop/cop/layout/empty_line_after_guard_clause.rb +82 -28
- data/lib/rubocop/cop/layout/empty_line_after_magic_comment.rb +14 -7
- data/lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb +2 -2
- data/lib/rubocop/cop/layout/empty_line_between_defs.rb +170 -27
- data/lib/rubocop/cop/layout/empty_lines.rb +4 -4
- data/lib/rubocop/cop/layout/empty_lines_after_module_inclusion.rb +101 -0
- data/lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb +48 -22
- data/lib/rubocop/cop/layout/empty_lines_around_arguments.rb +13 -29
- data/lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb +26 -5
- data/lib/rubocop/cop/layout/empty_lines_around_begin_body.rb +6 -7
- data/lib/rubocop/cop/layout/empty_lines_around_block_body.rb +8 -5
- data/lib/rubocop/cop/layout/empty_lines_around_class_body.rb +11 -11
- data/lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb +24 -17
- data/lib/rubocop/cop/layout/empty_lines_around_method_body.rb +24 -2
- data/lib/rubocop/cop/layout/empty_lines_around_module_body.rb +10 -10
- data/lib/rubocop/cop/layout/end_alignment.rb +36 -10
- data/lib/rubocop/cop/layout/end_of_line.rb +11 -11
- data/lib/rubocop/cop/layout/extra_spacing.rb +19 -21
- data/lib/rubocop/cop/layout/first_argument_indentation.rb +70 -39
- data/lib/rubocop/cop/layout/first_array_element_indentation.rb +49 -31
- data/lib/rubocop/cop/layout/first_array_element_line_break.rb +37 -11
- data/lib/rubocop/cop/layout/first_hash_element_indentation.rb +79 -29
- data/lib/rubocop/cop/layout/first_hash_element_line_break.rb +39 -5
- data/lib/rubocop/cop/layout/first_method_argument_line_break.rb +67 -11
- data/lib/rubocop/cop/layout/first_method_parameter_line_break.rb +54 -22
- data/lib/rubocop/cop/layout/first_parameter_indentation.rb +12 -11
- data/lib/rubocop/cop/layout/hash_alignment.rb +73 -37
- data/lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb +41 -15
- data/lib/rubocop/cop/layout/heredoc_indentation.rb +16 -27
- data/lib/rubocop/cop/layout/indentation_consistency.rb +10 -7
- data/lib/rubocop/cop/layout/indentation_style.rb +32 -32
- data/lib/rubocop/cop/layout/indentation_width.rb +64 -37
- data/lib/rubocop/cop/layout/initial_indentation.rb +3 -6
- data/lib/rubocop/cop/layout/leading_comment_space.rb +87 -5
- data/lib/rubocop/cop/layout/leading_empty_lines.rb +1 -1
- data/lib/rubocop/cop/layout/line_continuation_leading_space.rb +153 -0
- data/lib/rubocop/cop/layout/line_continuation_spacing.rb +146 -0
- data/lib/rubocop/cop/layout/line_end_string_concatenation_indentation.rb +143 -0
- data/lib/rubocop/cop/layout/line_length.rb +200 -64
- data/lib/rubocop/cop/layout/multiline_array_brace_layout.rb +7 -7
- data/lib/rubocop/cop/layout/multiline_array_line_breaks.rb +33 -4
- data/lib/rubocop/cop/layout/multiline_assignment_layout.rb +31 -5
- data/lib/rubocop/cop/layout/multiline_block_layout.rb +15 -20
- data/lib/rubocop/cop/layout/multiline_hash_brace_layout.rb +7 -7
- data/lib/rubocop/cop/layout/multiline_hash_key_line_breaks.rb +32 -5
- data/lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb +68 -4
- data/lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb +9 -8
- data/lib/rubocop/cop/layout/multiline_method_call_indentation.rb +69 -26
- data/lib/rubocop/cop/layout/multiline_method_definition_brace_layout.rb +8 -8
- data/lib/rubocop/cop/layout/multiline_method_parameter_line_breaks.rb +78 -0
- data/lib/rubocop/cop/layout/multiline_operation_indentation.rb +21 -18
- data/lib/rubocop/cop/layout/parameter_alignment.rb +11 -11
- data/lib/rubocop/cop/layout/redundant_line_break.rb +134 -0
- data/lib/rubocop/cop/layout/rescue_ensure_alignment.rb +38 -36
- data/lib/rubocop/cop/layout/single_line_block_chain.rb +69 -0
- data/lib/rubocop/cop/layout/space_after_colon.rb +4 -6
- data/lib/rubocop/cop/layout/space_after_comma.rb +10 -2
- data/lib/rubocop/cop/layout/space_after_method_name.rb +3 -5
- data/lib/rubocop/cop/layout/space_after_not.rb +3 -2
- data/lib/rubocop/cop/layout/space_after_semicolon.rb +11 -1
- data/lib/rubocop/cop/layout/space_around_block_parameters.rb +32 -34
- data/lib/rubocop/cop/layout/space_around_equals_in_parameter_default.rb +3 -2
- data/lib/rubocop/cop/layout/space_around_keyword.rb +42 -11
- data/lib/rubocop/cop/layout/space_around_method_call_operator.rb +3 -3
- data/lib/rubocop/cop/layout/space_around_operators.rb +101 -41
- data/lib/rubocop/cop/layout/space_before_block_braces.rb +29 -16
- data/lib/rubocop/cop/layout/space_before_brackets.rb +40 -0
- data/lib/rubocop/cop/layout/space_before_comma.rb +1 -1
- data/lib/rubocop/cop/layout/space_before_comment.rb +4 -6
- data/lib/rubocop/cop/layout/space_before_first_arg.rb +10 -12
- data/lib/rubocop/cop/layout/space_before_semicolon.rb +1 -1
- data/lib/rubocop/cop/layout/space_in_lambda_literal.rb +16 -12
- data/lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb +51 -39
- data/lib/rubocop/cop/layout/space_inside_array_percent_literal.rb +5 -7
- data/lib/rubocop/cop/layout/space_inside_block_braces.rb +56 -33
- data/lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb +41 -8
- data/lib/rubocop/cop/layout/space_inside_parens.rb +93 -25
- data/lib/rubocop/cop/layout/space_inside_percent_literal_delimiters.rb +34 -0
- data/lib/rubocop/cop/layout/space_inside_range_literal.rb +1 -1
- data/lib/rubocop/cop/layout/space_inside_reference_brackets.rb +12 -9
- data/lib/rubocop/cop/layout/space_inside_string_interpolation.rb +7 -8
- data/lib/rubocop/cop/layout/trailing_empty_lines.rb +15 -10
- data/lib/rubocop/cop/layout/trailing_whitespace.rb +72 -16
- data/lib/rubocop/cop/legacy/corrections_proxy.rb +3 -9
- data/lib/rubocop/cop/legacy/corrector.rb +13 -5
- data/lib/rubocop/cop/lint/ambiguous_assignment.rb +54 -0
- data/lib/rubocop/cop/lint/ambiguous_block_association.rb +50 -12
- data/lib/rubocop/cop/lint/ambiguous_operator.rb +11 -9
- data/lib/rubocop/cop/lint/ambiguous_operator_precedence.rb +111 -0
- data/lib/rubocop/cop/lint/ambiguous_range.rb +113 -0
- data/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb +13 -7
- data/lib/rubocop/cop/lint/array_literal_in_regexp.rb +118 -0
- data/lib/rubocop/cop/lint/assignment_in_condition.rb +25 -15
- data/lib/rubocop/cop/lint/big_decimal_new.rb +5 -7
- data/lib/rubocop/cop/lint/binary_operator_with_identical_operands.rb +30 -14
- data/lib/rubocop/cop/lint/boolean_symbol.rb +10 -7
- data/lib/rubocop/cop/lint/circular_argument_reference.rb +5 -15
- data/lib/rubocop/cop/lint/constant_definition_in_block.rb +30 -4
- data/lib/rubocop/cop/lint/constant_overwritten_in_rescue.rb +51 -0
- data/lib/rubocop/cop/lint/constant_reassignment.rb +148 -0
- data/lib/rubocop/cop/lint/constant_resolution.rb +7 -3
- data/lib/rubocop/cop/lint/cop_directive_syntax.rb +84 -0
- data/lib/rubocop/cop/lint/debugger.rb +99 -35
- data/lib/rubocop/cop/lint/deprecated_class_methods.rb +73 -63
- data/lib/rubocop/cop/lint/deprecated_constants.rb +88 -0
- data/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb +25 -21
- data/lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb +24 -1
- data/lib/rubocop/cop/lint/duplicate_branch.rb +188 -0
- data/lib/rubocop/cop/lint/duplicate_case_condition.rb +4 -18
- data/lib/rubocop/cop/lint/duplicate_elsif_condition.rb +1 -1
- data/lib/rubocop/cop/lint/duplicate_hash_key.rb +4 -9
- data/lib/rubocop/cop/lint/duplicate_magic_comment.rb +73 -0
- data/lib/rubocop/cop/lint/duplicate_match_pattern.rb +122 -0
- data/lib/rubocop/cop/lint/duplicate_methods.rb +168 -58
- data/lib/rubocop/cop/lint/duplicate_regexp_character_class_element.rb +121 -0
- data/lib/rubocop/cop/lint/duplicate_require.rb +14 -4
- data/lib/rubocop/cop/lint/duplicate_rescue_exception.rb +1 -1
- data/lib/rubocop/cop/lint/duplicate_set_element.rb +87 -0
- data/lib/rubocop/cop/lint/each_with_object_argument.rb +3 -6
- data/lib/rubocop/cop/lint/else_layout.rb +32 -10
- data/lib/rubocop/cop/lint/empty_block.rb +94 -0
- data/lib/rubocop/cop/lint/empty_class.rb +95 -0
- data/lib/rubocop/cop/lint/empty_conditional_body.rb +85 -4
- data/lib/rubocop/cop/lint/empty_ensure.rb +3 -15
- data/lib/rubocop/cop/lint/empty_expression.rb +1 -3
- data/lib/rubocop/cop/lint/empty_file.rb +2 -6
- data/lib/rubocop/cop/lint/empty_in_pattern.rb +64 -0
- data/lib/rubocop/cop/lint/empty_interpolation.rb +5 -9
- data/lib/rubocop/cop/lint/empty_when.rb +5 -5
- data/lib/rubocop/cop/lint/ensure_return.rb +3 -13
- data/lib/rubocop/cop/lint/erb_new_arguments.rb +40 -43
- data/lib/rubocop/cop/lint/flip_flop.rb +8 -2
- data/lib/rubocop/cop/lint/float_comparison.rb +59 -16
- data/lib/rubocop/cop/lint/float_out_of_range.rb +2 -9
- data/lib/rubocop/cop/lint/format_parameter_mismatch.rb +17 -22
- data/lib/rubocop/cop/lint/hash_compare_by_identity.rb +15 -4
- data/lib/rubocop/cop/lint/hash_new_with_keyword_arguments_as_default.rb +55 -0
- data/lib/rubocop/cop/lint/heredoc_method_call_position.rb +18 -21
- data/lib/rubocop/cop/lint/identity_comparison.rb +19 -16
- data/lib/rubocop/cop/lint/implicit_string_concatenation.rb +25 -15
- data/lib/rubocop/cop/lint/incompatible_io_select_with_fiber_scheduler.rb +81 -0
- data/lib/rubocop/cop/lint/ineffective_access_modifier.rb +6 -16
- data/lib/rubocop/cop/lint/inherit_exception.rb +29 -29
- data/lib/rubocop/cop/lint/interpolation_check.rb +21 -13
- data/lib/rubocop/cop/lint/it_without_arguments_in_block.rb +50 -0
- data/lib/rubocop/cop/lint/lambda_without_literal_block.rb +51 -0
- data/lib/rubocop/cop/lint/literal_as_condition.rb +145 -13
- data/lib/rubocop/cop/lint/literal_assignment_in_condition.rb +85 -0
- data/lib/rubocop/cop/lint/literal_in_interpolation.rb +130 -18
- data/lib/rubocop/cop/lint/loop.rb +13 -19
- data/lib/rubocop/cop/lint/missing_cop_enable_directive.rb +48 -22
- data/lib/rubocop/cop/lint/missing_super.rb +70 -10
- data/lib/rubocop/cop/lint/mixed_case_range.rb +113 -0
- data/lib/rubocop/cop/lint/mixed_regexp_capture_types.rb +3 -3
- data/lib/rubocop/cop/lint/multiple_comparison.rb +5 -4
- data/lib/rubocop/cop/lint/nested_method_definition.rb +64 -20
- data/lib/rubocop/cop/lint/nested_percent_literal.rb +17 -5
- data/lib/rubocop/cop/lint/next_without_accumulator.rb +11 -10
- data/lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb +53 -0
- data/lib/rubocop/cop/lint/non_atomic_file_operation.rb +174 -0
- data/lib/rubocop/cop/lint/non_deterministic_require_order.rb +41 -18
- data/lib/rubocop/cop/lint/non_local_exit_from_iterator.rb +7 -4
- data/lib/rubocop/cop/lint/number_conversion.rb +142 -21
- data/lib/rubocop/cop/lint/numbered_parameter_assignment.rb +46 -0
- data/lib/rubocop/cop/lint/numeric_operation_with_constant_result.rb +94 -0
- data/lib/rubocop/cop/lint/or_assignment_to_constant.rb +41 -0
- data/lib/rubocop/cop/lint/ordered_magic_comments.rb +5 -8
- data/lib/rubocop/cop/lint/out_of_range_regexp_ref.rb +63 -13
- data/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb +17 -15
- data/lib/rubocop/cop/lint/percent_string_array.rb +13 -7
- data/lib/rubocop/cop/lint/percent_symbol_array.rb +4 -10
- data/lib/rubocop/cop/lint/raise_exception.rb +36 -12
- data/lib/rubocop/cop/lint/rand_one.rb +3 -7
- data/lib/rubocop/cop/lint/redundant_cop_disable_directive.rb +156 -97
- data/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb +33 -23
- data/lib/rubocop/cop/lint/redundant_dir_glob_sort.rb +62 -0
- data/lib/rubocop/cop/lint/redundant_regexp_quantifiers.rb +130 -0
- data/lib/rubocop/cop/lint/redundant_require_statement.rb +36 -6
- data/lib/rubocop/cop/lint/redundant_safe_navigation.rb +196 -15
- data/lib/rubocop/cop/lint/redundant_splat_expansion.rb +67 -33
- data/lib/rubocop/cop/lint/redundant_string_coercion.rb +37 -21
- data/lib/rubocop/cop/lint/redundant_type_conversion.rb +261 -0
- data/lib/rubocop/cop/lint/redundant_with_index.rb +22 -14
- data/lib/rubocop/cop/lint/redundant_with_object.rb +17 -15
- data/lib/rubocop/cop/lint/refinement_import_methods.rb +52 -0
- data/lib/rubocop/cop/lint/regexp_as_condition.rb +9 -6
- data/lib/rubocop/cop/lint/require_parentheses.rb +6 -10
- data/lib/rubocop/cop/lint/require_range_parentheses.rb +57 -0
- data/lib/rubocop/cop/lint/require_relative_self_path.rb +50 -0
- data/lib/rubocop/cop/lint/rescue_exception.rb +2 -7
- data/lib/rubocop/cop/lint/rescue_type.rb +7 -18
- data/lib/rubocop/cop/lint/return_in_void_context.rb +13 -30
- data/lib/rubocop/cop/lint/safe_navigation_chain.rb +73 -19
- data/lib/rubocop/cop/lint/safe_navigation_consistency.rb +109 -47
- data/lib/rubocop/cop/lint/safe_navigation_with_empty.rb +3 -3
- data/lib/rubocop/cop/lint/script_permission.rb +4 -4
- data/lib/rubocop/cop/lint/self_assignment.rb +72 -11
- data/lib/rubocop/cop/lint/send_with_mixin_argument.rb +8 -12
- data/lib/rubocop/cop/lint/shadowed_argument.rb +8 -13
- data/lib/rubocop/cop/lint/shadowed_exception.rb +30 -43
- data/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb +68 -5
- data/lib/rubocop/cop/lint/shared_mutable_default.rb +76 -0
- data/lib/rubocop/cop/lint/struct_new_override.rb +16 -16
- data/lib/rubocop/cop/lint/suppressed_exception.rb +48 -5
- data/lib/rubocop/cop/lint/suppressed_exception_in_number_conversion.rb +111 -0
- data/lib/rubocop/cop/lint/symbol_conversion.rb +184 -0
- data/lib/rubocop/cop/lint/syntax.rb +17 -10
- data/lib/rubocop/cop/lint/to_enum_arguments.rb +99 -0
- data/lib/rubocop/cop/lint/to_json.rb +2 -3
- data/lib/rubocop/cop/lint/top_level_return_with_argument.rb +24 -10
- data/lib/rubocop/cop/lint/trailing_comma_in_attribute_declaration.rb +4 -6
- data/lib/rubocop/cop/lint/triple_quotes.rb +71 -0
- data/lib/rubocop/cop/lint/underscore_prefixed_variable_name.rb +2 -4
- data/lib/rubocop/cop/lint/unescaped_bracket_in_regexp.rb +88 -0
- data/lib/rubocop/cop/lint/unexpected_block_arity.rb +92 -0
- data/lib/rubocop/cop/lint/unified_integer.rb +4 -5
- data/lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb +205 -0
- data/lib/rubocop/cop/lint/unreachable_code.rb +59 -14
- data/lib/rubocop/cop/lint/unreachable_loop.rb +48 -11
- data/lib/rubocop/cop/lint/unused_block_argument.rb +11 -9
- data/lib/rubocop/cop/lint/unused_method_argument.rb +29 -9
- data/lib/rubocop/cop/lint/uri_escape_unescape.rb +2 -1
- data/lib/rubocop/cop/lint/uri_regexp.rb +25 -7
- data/lib/rubocop/cop/lint/useless_access_modifier.rb +57 -24
- data/lib/rubocop/cop/lint/useless_assignment.rb +109 -25
- data/lib/rubocop/cop/lint/useless_constant_scoping.rb +71 -0
- data/lib/rubocop/cop/lint/useless_default_value_argument.rb +90 -0
- data/lib/rubocop/cop/lint/useless_defined.rb +55 -0
- data/lib/rubocop/cop/lint/useless_else_without_rescue.rb +6 -7
- data/lib/rubocop/cop/lint/useless_method_definition.rb +18 -11
- data/lib/rubocop/cop/lint/useless_numeric_operation.rb +79 -0
- data/lib/rubocop/cop/lint/useless_or.rb +98 -0
- data/lib/rubocop/cop/lint/useless_rescue.rb +89 -0
- data/lib/rubocop/cop/lint/useless_ruby2_keywords.rb +127 -0
- data/lib/rubocop/cop/lint/useless_setter_call.rb +29 -37
- data/lib/rubocop/cop/lint/useless_times.rb +25 -17
- data/lib/rubocop/cop/lint/utils/nil_receiver_checker.rb +121 -0
- data/lib/rubocop/cop/lint/void.rb +156 -31
- data/lib/rubocop/cop/message_annotator.rb +12 -7
- data/lib/rubocop/cop/metrics/abc_size.rb +35 -3
- data/lib/rubocop/cop/metrics/block_length.rb +30 -16
- data/lib/rubocop/cop/metrics/block_nesting.rb +23 -16
- data/lib/rubocop/cop/metrics/class_length.rb +30 -20
- data/lib/rubocop/cop/metrics/collection_literal_length.rb +83 -0
- data/lib/rubocop/cop/metrics/cyclomatic_complexity.rb +7 -14
- data/lib/rubocop/cop/metrics/method_length.rb +32 -11
- data/lib/rubocop/cop/metrics/module_length.rb +17 -14
- data/lib/rubocop/cop/metrics/parameter_lists.rb +104 -7
- data/lib/rubocop/cop/metrics/perceived_complexity.rb +3 -4
- data/lib/rubocop/cop/metrics/utils/abc_size_calculator.rb +28 -26
- data/lib/rubocop/cop/metrics/utils/code_length_calculator.rb +69 -18
- data/lib/rubocop/cop/metrics/utils/repeated_attribute_discount.rb +143 -0
- data/lib/rubocop/cop/metrics/utils/repeated_csend_discount.rb +6 -1
- data/lib/rubocop/cop/migration/department_name.rb +8 -10
- data/lib/rubocop/cop/mixin/alignment.rb +20 -11
- data/lib/rubocop/cop/mixin/allowed_identifiers.rb +18 -0
- data/lib/rubocop/cop/mixin/allowed_methods.rb +29 -2
- data/lib/rubocop/cop/mixin/allowed_pattern.rb +68 -0
- data/lib/rubocop/cop/mixin/allowed_receivers.rb +34 -0
- data/lib/rubocop/cop/mixin/annotation_comment.rb +56 -28
- data/lib/rubocop/cop/mixin/check_assignment.rb +4 -12
- data/lib/rubocop/cop/mixin/check_line_breakable.rb +53 -9
- data/lib/rubocop/cop/mixin/check_single_line_suitability.rb +49 -0
- data/lib/rubocop/cop/mixin/code_length.rb +17 -6
- data/lib/rubocop/cop/mixin/comments_help.rb +62 -15
- data/lib/rubocop/cop/mixin/configurable_enforced_style.rb +23 -11
- data/lib/rubocop/cop/mixin/configurable_formatting.rb +4 -8
- data/lib/rubocop/cop/mixin/configurable_max.rb +5 -0
- data/lib/rubocop/cop/mixin/configurable_numbering.rb +4 -3
- data/lib/rubocop/cop/mixin/def_node.rb +5 -12
- data/lib/rubocop/cop/mixin/dig_help.rb +27 -0
- data/lib/rubocop/cop/mixin/documentation_comment.rb +8 -8
- data/lib/rubocop/cop/mixin/duplication.rb +1 -1
- data/lib/rubocop/cop/mixin/empty_lines_around_body.rb +7 -8
- data/lib/rubocop/cop/mixin/empty_parameter.rb +2 -3
- data/lib/rubocop/cop/mixin/end_keyword_alignment.rb +3 -6
- data/lib/rubocop/cop/mixin/endless_method_rewriter.rb +24 -0
- data/lib/rubocop/cop/mixin/enforce_superclass.rb +19 -7
- data/lib/rubocop/cop/mixin/first_element_line_break.rb +13 -11
- data/lib/rubocop/cop/mixin/forbidden_identifiers.rb +20 -0
- data/lib/rubocop/cop/mixin/forbidden_pattern.rb +16 -0
- data/lib/rubocop/cop/mixin/frozen_string_literal.rb +53 -16
- data/lib/rubocop/cop/mixin/gem_declaration.rb +13 -0
- data/lib/rubocop/cop/mixin/gemspec_help.rb +52 -0
- data/lib/rubocop/cop/mixin/hash_alignment_styles.rb +34 -24
- data/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb +236 -0
- data/lib/rubocop/cop/mixin/hash_subset.rb +203 -0
- data/lib/rubocop/cop/mixin/hash_transform_method.rb +83 -88
- data/lib/rubocop/cop/mixin/heredoc.rb +11 -2
- data/lib/rubocop/cop/mixin/interpolation.rb +1 -3
- data/lib/rubocop/cop/mixin/line_length_help.rb +65 -20
- data/lib/rubocop/cop/mixin/match_range.rb +2 -5
- data/lib/rubocop/cop/mixin/method_complexity.rb +33 -19
- data/lib/rubocop/cop/mixin/method_preference.rb +1 -2
- data/lib/rubocop/cop/mixin/min_branches_count.rb +40 -0
- data/lib/rubocop/cop/mixin/multiline_element_indentation.rb +39 -16
- data/lib/rubocop/cop/mixin/multiline_element_line_breaks.rb +6 -9
- data/lib/rubocop/cop/mixin/multiline_expression_indentation.rb +26 -55
- data/lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb +2 -3
- data/lib/rubocop/cop/mixin/negative_conditional.rb +4 -2
- data/lib/rubocop/cop/mixin/ordered_gem_node.rb +12 -7
- data/lib/rubocop/cop/mixin/percent_array.rb +75 -9
- data/lib/rubocop/cop/mixin/percent_literal.rb +2 -8
- data/lib/rubocop/cop/mixin/preceding_following_alignment.rb +79 -41
- data/lib/rubocop/cop/mixin/preferred_delimiters.rb +6 -9
- data/lib/rubocop/cop/mixin/range_help.rb +51 -22
- data/lib/rubocop/cop/mixin/rational_literal.rb +1 -0
- data/lib/rubocop/cop/mixin/require_library.rb +61 -0
- data/lib/rubocop/cop/mixin/rescue_node.rb +9 -7
- data/lib/rubocop/cop/mixin/safe_assignment.rb +7 -3
- data/lib/rubocop/cop/mixin/space_after_punctuation.rb +3 -5
- data/lib/rubocop/cop/mixin/space_before_punctuation.rb +3 -4
- data/lib/rubocop/cop/mixin/statement_modifier.rb +34 -10
- data/lib/rubocop/cop/mixin/string_help.rb +10 -5
- data/lib/rubocop/cop/mixin/string_literals_help.rb +15 -5
- data/lib/rubocop/cop/mixin/surrounding_space.rb +17 -13
- data/lib/rubocop/cop/mixin/symbol_help.rb +13 -0
- data/lib/rubocop/cop/mixin/target_ruby_version.rb +17 -1
- data/lib/rubocop/cop/mixin/trailing_body.rb +2 -3
- data/lib/rubocop/cop/mixin/trailing_comma.rb +26 -11
- data/lib/rubocop/cop/mixin/uncommunicative_name.rb +12 -14
- data/lib/rubocop/cop/mixin/unused_argument.rb +1 -3
- data/lib/rubocop/cop/mixin/visibility_help.rb +42 -8
- data/lib/rubocop/cop/naming/accessor_method_name.rb +23 -2
- data/lib/rubocop/cop/naming/ascii_identifiers.rb +4 -9
- data/lib/rubocop/cop/naming/binary_operator_parameter_name.rb +15 -5
- data/lib/rubocop/cop/naming/block_forwarding.rb +156 -0
- data/lib/rubocop/cop/naming/block_parameter_name.rb +3 -3
- data/lib/rubocop/cop/naming/class_and_module_camel_case.rb +4 -2
- data/lib/rubocop/cop/naming/constant_name.rb +14 -14
- data/lib/rubocop/cop/naming/file_name.rb +48 -26
- data/lib/rubocop/cop/naming/heredoc_delimiter_case.rb +12 -6
- data/lib/rubocop/cop/naming/heredoc_delimiter_naming.rb +4 -2
- data/lib/rubocop/cop/naming/inclusive_language.rb +297 -0
- data/lib/rubocop/cop/naming/memoized_instance_variable_name.rb +155 -32
- data/lib/rubocop/cop/naming/method_name.rb +191 -19
- data/lib/rubocop/cop/naming/method_parameter_name.rb +2 -2
- data/lib/rubocop/cop/naming/predicate_method.rb +306 -0
- data/lib/rubocop/cop/naming/predicate_prefix.rb +204 -0
- data/lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb +72 -13
- data/lib/rubocop/cop/naming/variable_name.rb +65 -5
- data/lib/rubocop/cop/naming/variable_number.rb +107 -13
- data/lib/rubocop/cop/offense.rb +9 -15
- data/lib/rubocop/cop/registry.rb +95 -53
- data/lib/rubocop/cop/security/compound_hash.rb +108 -0
- data/lib/rubocop/cop/security/eval.rb +4 -2
- data/lib/rubocop/cop/security/io_methods.rb +49 -0
- data/lib/rubocop/cop/security/json_load.rb +10 -8
- data/lib/rubocop/cop/security/marshal_load.rb +2 -1
- data/lib/rubocop/cop/security/open.rb +28 -10
- data/lib/rubocop/cop/security/yaml_load.rb +16 -4
- data/lib/rubocop/cop/severity.rb +3 -3
- data/lib/rubocop/cop/style/access_modifier_declarations.rb +238 -8
- data/lib/rubocop/cop/style/accessor_grouping.rb +91 -29
- data/lib/rubocop/cop/style/alias.rb +26 -22
- data/lib/rubocop/cop/style/ambiguous_endless_method_definition.rb +79 -0
- data/lib/rubocop/cop/style/and_or.rb +29 -14
- data/lib/rubocop/cop/style/arguments_forwarding.rb +564 -0
- data/lib/rubocop/cop/style/array_coercion.rb +24 -4
- data/lib/rubocop/cop/style/array_first_last.rb +80 -0
- data/lib/rubocop/cop/style/array_intersect.rb +161 -0
- data/lib/rubocop/cop/style/array_join.rb +2 -1
- data/lib/rubocop/cop/style/ascii_comments.rb +4 -8
- data/lib/rubocop/cop/style/attr.rb +13 -4
- data/lib/rubocop/cop/style/auto_resource_cleanup.rb +22 -18
- data/lib/rubocop/cop/style/bare_percent_literals.rb +1 -1
- data/lib/rubocop/cop/style/begin_block.rb +1 -2
- data/lib/rubocop/cop/style/bisected_attr_accessor/macro.rb +60 -0
- data/lib/rubocop/cop/style/bisected_attr_accessor.rb +61 -77
- data/lib/rubocop/cop/style/bitwise_predicate.rb +100 -0
- data/lib/rubocop/cop/style/block_comments.rb +4 -4
- data/lib/rubocop/cop/style/block_delimiters.rb +144 -23
- data/lib/rubocop/cop/style/case_equality.rb +49 -21
- data/lib/rubocop/cop/style/case_like_if.rb +56 -31
- data/lib/rubocop/cop/style/character_literal.rb +20 -16
- data/lib/rubocop/cop/style/class_and_module_children.rb +97 -26
- data/lib/rubocop/cop/style/class_check.rb +2 -1
- data/lib/rubocop/cop/style/class_equality_comparison.rb +83 -13
- data/lib/rubocop/cop/style/class_methods.rb +2 -4
- data/lib/rubocop/cop/style/class_methods_definitions.rb +3 -2
- data/lib/rubocop/cop/style/class_vars.rb +4 -4
- data/lib/rubocop/cop/style/collection_compact.rb +143 -0
- data/lib/rubocop/cop/style/collection_methods.rb +27 -7
- data/lib/rubocop/cop/style/collection_querying.rb +167 -0
- data/lib/rubocop/cop/style/colon_method_call.rb +4 -5
- data/lib/rubocop/cop/style/colon_method_definition.rb +1 -1
- data/lib/rubocop/cop/style/combinable_defined.rb +115 -0
- data/lib/rubocop/cop/style/combinable_loops.rb +52 -12
- data/lib/rubocop/cop/style/command_literal.rb +6 -11
- data/lib/rubocop/cop/style/comment_annotation.rb +59 -32
- data/lib/rubocop/cop/style/commented_keyword.rb +65 -22
- data/lib/rubocop/cop/style/comparable_between.rb +78 -0
- data/lib/rubocop/cop/style/comparable_clamp.rb +125 -0
- data/lib/rubocop/cop/style/concat_array_literals.rb +95 -0
- data/lib/rubocop/cop/style/conditional_assignment.rb +88 -76
- data/lib/rubocop/cop/style/constant_visibility.rb +28 -9
- data/lib/rubocop/cop/style/copyright.rb +39 -29
- data/lib/rubocop/cop/style/data_inheritance.rb +82 -0
- data/lib/rubocop/cop/style/date_time.rb +16 -10
- data/lib/rubocop/cop/style/def_with_parentheses.rb +30 -15
- data/lib/rubocop/cop/style/dig_chain.rb +89 -0
- data/lib/rubocop/cop/style/dir.rb +5 -1
- data/lib/rubocop/cop/style/dir_empty.rb +54 -0
- data/lib/rubocop/cop/style/disable_cops_within_source_code_directive.rb +49 -9
- data/lib/rubocop/cop/style/document_dynamic_eval_definition.rb +169 -0
- data/lib/rubocop/cop/style/documentation.rb +95 -30
- data/lib/rubocop/cop/style/documentation_method.rb +31 -4
- data/lib/rubocop/cop/style/double_cop_disable_directive.rb +1 -7
- data/lib/rubocop/cop/style/double_negation.rb +97 -11
- data/lib/rubocop/cop/style/each_for_simple_loop.rb +45 -14
- data/lib/rubocop/cop/style/each_with_object.rb +42 -11
- data/lib/rubocop/cop/style/empty_block_parameter.rb +3 -3
- data/lib/rubocop/cop/style/empty_case_condition.rb +21 -12
- data/lib/rubocop/cop/style/empty_else.rb +52 -18
- data/lib/rubocop/cop/style/empty_heredoc.rb +60 -0
- data/lib/rubocop/cop/style/empty_lambda_parameter.rb +3 -3
- data/lib/rubocop/cop/style/empty_literal.rb +62 -33
- data/lib/rubocop/cop/style/empty_method.rb +19 -8
- data/lib/rubocop/cop/style/empty_string_inside_interpolation.rb +100 -0
- data/lib/rubocop/cop/style/encoding.rb +27 -16
- data/lib/rubocop/cop/style/end_block.rb +2 -3
- data/lib/rubocop/cop/style/endless_method.rb +233 -0
- data/lib/rubocop/cop/style/env_home.rb +56 -0
- data/lib/rubocop/cop/style/eval_with_location.rb +144 -63
- data/lib/rubocop/cop/style/even_odd.rb +2 -1
- data/lib/rubocop/cop/style/exact_regexp_match.rb +69 -0
- data/lib/rubocop/cop/style/expand_path_arguments.rb +7 -11
- data/lib/rubocop/cop/style/explicit_block_argument.rb +78 -18
- data/lib/rubocop/cop/style/exponential_notation.rb +12 -12
- data/lib/rubocop/cop/style/fetch_env_var.rb +159 -0
- data/lib/rubocop/cop/style/file_empty.rb +71 -0
- data/lib/rubocop/cop/style/file_null.rb +89 -0
- data/lib/rubocop/cop/style/file_read.rb +109 -0
- data/lib/rubocop/cop/style/file_touch.rb +75 -0
- data/lib/rubocop/cop/style/file_write.rb +133 -0
- data/lib/rubocop/cop/style/float_division.rb +68 -6
- data/lib/rubocop/cop/style/for.rb +13 -3
- data/lib/rubocop/cop/style/format_string.rb +44 -16
- data/lib/rubocop/cop/style/format_string_token.rb +163 -26
- data/lib/rubocop/cop/style/frozen_string_literal_comment.rb +27 -18
- data/lib/rubocop/cop/style/global_std_stream.rb +16 -2
- data/lib/rubocop/cop/style/global_vars.rb +2 -4
- data/lib/rubocop/cop/style/guard_clause.rb +206 -32
- data/lib/rubocop/cop/style/hash_as_last_array_item.rb +12 -0
- data/lib/rubocop/cop/style/hash_conversion.rb +151 -0
- data/lib/rubocop/cop/style/hash_each_methods.rb +147 -12
- data/lib/rubocop/cop/style/hash_except.rb +80 -0
- data/lib/rubocop/cop/style/hash_fetch_chain.rb +104 -0
- data/lib/rubocop/cop/style/hash_like_case.rb +6 -11
- data/lib/rubocop/cop/style/hash_slice.rb +80 -0
- data/lib/rubocop/cop/style/hash_syntax.rb +117 -33
- data/lib/rubocop/cop/style/hash_transform_keys.rb +19 -15
- data/lib/rubocop/cop/style/hash_transform_values.rb +19 -14
- data/lib/rubocop/cop/style/identical_conditional_branches.rb +153 -10
- data/lib/rubocop/cop/style/if_inside_else.rb +67 -2
- data/lib/rubocop/cop/style/if_unless_modifier.rb +188 -29
- data/lib/rubocop/cop/style/if_unless_modifier_of_if_unless.rb +4 -7
- data/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb +163 -0
- data/lib/rubocop/cop/style/if_with_semicolon.rb +96 -7
- data/lib/rubocop/cop/style/implicit_runtime_error.rb +4 -3
- data/lib/rubocop/cop/style/in_pattern_then.rb +60 -0
- data/lib/rubocop/cop/style/infinite_loop.rb +9 -10
- data/lib/rubocop/cop/style/inline_comment.rb +1 -1
- data/lib/rubocop/cop/style/inverse_methods.rb +41 -28
- data/lib/rubocop/cop/style/invertible_unless_condition.rb +160 -0
- data/lib/rubocop/cop/style/ip_addresses.rb +5 -6
- data/lib/rubocop/cop/style/it_assignment.rb +93 -0
- data/lib/rubocop/cop/style/it_block_parameter.rb +121 -0
- data/lib/rubocop/cop/style/keyword_arguments_merging.rb +67 -0
- data/lib/rubocop/cop/style/keyword_parameters_order.rb +34 -6
- data/lib/rubocop/cop/style/lambda.rb +8 -9
- data/lib/rubocop/cop/style/lambda_call.rb +27 -24
- data/lib/rubocop/cop/style/line_end_concatenation.rb +31 -16
- data/lib/rubocop/cop/style/magic_comment_format.rb +307 -0
- data/lib/rubocop/cop/style/map_compact_with_conditional_block.rb +168 -0
- data/lib/rubocop/cop/style/map_into_array.rb +236 -0
- data/lib/rubocop/cop/style/map_to_hash.rb +90 -0
- data/lib/rubocop/cop/style/map_to_set.rb +63 -0
- data/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb +138 -53
- data/lib/rubocop/cop/style/method_call_with_args_parentheses/require_parentheses.rb +11 -11
- data/lib/rubocop/cop/style/method_call_with_args_parentheses.rb +109 -36
- data/lib/rubocop/cop/style/method_call_without_args_parentheses.rb +62 -18
- data/lib/rubocop/cop/style/method_called_on_do_end_block.rb +7 -7
- data/lib/rubocop/cop/style/method_def_parentheses.rb +37 -14
- data/lib/rubocop/cop/style/min_max.rb +6 -6
- data/lib/rubocop/cop/style/min_max_comparison.rb +91 -0
- data/lib/rubocop/cop/style/missing_else.rb +48 -33
- data/lib/rubocop/cop/style/missing_respond_to_missing.rb +37 -8
- data/lib/rubocop/cop/style/mixin_grouping.rb +10 -20
- data/lib/rubocop/cop/style/mixin_usage.rb +4 -3
- data/lib/rubocop/cop/style/module_function.rb +41 -18
- data/lib/rubocop/cop/style/multiline_block_chain.rb +7 -5
- data/lib/rubocop/cop/style/multiline_if_modifier.rb +4 -6
- data/lib/rubocop/cop/style/multiline_if_then.rb +1 -1
- data/lib/rubocop/cop/style/multiline_in_pattern_then.rb +60 -0
- data/lib/rubocop/cop/style/multiline_memoization.rb +5 -5
- data/lib/rubocop/cop/style/multiline_method_signature.rb +37 -3
- data/lib/rubocop/cop/style/multiline_ternary_operator.rb +54 -12
- data/lib/rubocop/cop/style/multiline_when_then.rb +8 -21
- data/lib/rubocop/cop/style/multiple_comparison.rb +104 -32
- data/lib/rubocop/cop/style/mutable_constant.rb +99 -28
- data/lib/rubocop/cop/style/negated_if.rb +1 -2
- data/lib/rubocop/cop/style/negated_if_else_condition.rb +137 -0
- data/lib/rubocop/cop/style/negated_unless.rb +1 -2
- data/lib/rubocop/cop/style/nested_file_dirname.rb +66 -0
- data/lib/rubocop/cop/style/nested_modifier.rb +5 -9
- data/lib/rubocop/cop/style/nested_parenthesized_calls.rb +17 -4
- data/lib/rubocop/cop/style/nested_ternary_operator.rb +23 -19
- data/lib/rubocop/cop/style/next.rb +51 -14
- data/lib/rubocop/cop/style/nil_comparison.rb +9 -1
- data/lib/rubocop/cop/style/nil_lambda.rb +70 -0
- data/lib/rubocop/cop/style/non_nil_check.rb +32 -18
- data/lib/rubocop/cop/style/not.rb +5 -5
- data/lib/rubocop/cop/style/numbered_parameters.rb +46 -0
- data/lib/rubocop/cop/style/numbered_parameters_limit.rb +58 -0
- data/lib/rubocop/cop/style/numeric_literal_prefix.rb +2 -2
- data/lib/rubocop/cop/style/numeric_literals.rb +44 -29
- data/lib/rubocop/cop/style/numeric_predicate.rb +73 -20
- data/lib/rubocop/cop/style/object_then.rb +76 -0
- data/lib/rubocop/cop/style/one_line_conditional.rb +46 -46
- data/lib/rubocop/cop/style/open_struct_use.rb +69 -0
- data/lib/rubocop/cop/style/operator_method_call.rb +91 -0
- data/lib/rubocop/cop/style/option_hash.rb +3 -4
- data/lib/rubocop/cop/style/optional_arguments.rb +7 -6
- data/lib/rubocop/cop/style/optional_boolean_parameter.rb +16 -5
- data/lib/rubocop/cop/style/or_assignment.rb +8 -13
- data/lib/rubocop/cop/style/parallel_assignment.rb +81 -66
- data/lib/rubocop/cop/style/parentheses_around_condition.rb +22 -3
- data/lib/rubocop/cop/style/percent_literal_delimiters.rb +6 -9
- data/lib/rubocop/cop/style/percent_q_literals.rb +6 -7
- data/lib/rubocop/cop/style/perl_backrefs.rb +101 -10
- data/lib/rubocop/cop/style/preferred_hash_methods.rb +11 -9
- data/lib/rubocop/cop/style/proc.rb +6 -3
- data/lib/rubocop/cop/style/quoted_symbols.rb +122 -0
- data/lib/rubocop/cop/style/raise_args.rb +57 -30
- data/lib/rubocop/cop/style/random_with_offset.rb +12 -12
- data/lib/rubocop/cop/style/redundant_argument.rb +129 -0
- data/lib/rubocop/cop/style/redundant_array_constructor.rb +77 -0
- data/lib/rubocop/cop/style/redundant_array_flatten.rb +50 -0
- data/lib/rubocop/cop/style/redundant_assignment.rb +14 -7
- data/lib/rubocop/cop/style/redundant_begin.rb +96 -8
- data/lib/rubocop/cop/style/redundant_capital_w.rb +3 -5
- data/lib/rubocop/cop/style/redundant_condition.rb +235 -32
- data/lib/rubocop/cop/style/redundant_conditional.rb +6 -19
- data/lib/rubocop/cop/style/redundant_constant_base.rb +85 -0
- data/lib/rubocop/cop/style/redundant_current_directory_in_path.rb +50 -0
- data/lib/rubocop/cop/style/redundant_double_splat_hash_braces.rb +129 -0
- data/lib/rubocop/cop/style/redundant_each.rb +119 -0
- data/lib/rubocop/cop/style/redundant_exception.rb +36 -17
- data/lib/rubocop/cop/style/redundant_fetch_block.rb +17 -17
- data/lib/rubocop/cop/style/redundant_file_extension_in_require.rb +15 -5
- data/lib/rubocop/cop/style/redundant_filter_chain.rb +118 -0
- data/lib/rubocop/cop/style/redundant_format.rb +262 -0
- data/lib/rubocop/cop/style/redundant_freeze.rb +12 -8
- data/lib/rubocop/cop/style/redundant_heredoc_delimiter_quotes.rb +58 -0
- data/lib/rubocop/cop/style/redundant_initialize.rb +165 -0
- data/lib/rubocop/cop/style/redundant_interpolation.rb +42 -8
- data/lib/rubocop/cop/style/redundant_interpolation_unfreeze.rb +46 -0
- data/lib/rubocop/cop/style/redundant_line_continuation.rb +236 -0
- data/lib/rubocop/cop/style/redundant_parentheses.rb +184 -66
- data/lib/rubocop/cop/style/redundant_percent_q.rb +6 -8
- data/lib/rubocop/cop/style/redundant_regexp_argument.rb +107 -0
- data/lib/rubocop/cop/style/redundant_regexp_character_class.rb +27 -6
- data/lib/rubocop/cop/style/redundant_regexp_constructor.rb +46 -0
- data/lib/rubocop/cop/style/redundant_regexp_escape.rb +24 -9
- data/lib/rubocop/cop/style/redundant_return.rb +28 -8
- data/lib/rubocop/cop/style/redundant_self.rb +70 -21
- data/lib/rubocop/cop/style/redundant_self_assignment.rb +27 -37
- data/lib/rubocop/cop/style/redundant_self_assignment_branch.rb +90 -0
- data/lib/rubocop/cop/style/redundant_sort.rb +81 -34
- data/lib/rubocop/cop/style/redundant_sort_by.rb +41 -8
- data/lib/rubocop/cop/style/redundant_string_escape.rb +185 -0
- data/lib/rubocop/cop/style/regexp_literal.rb +25 -11
- data/lib/rubocop/cop/style/require_order.rb +139 -0
- data/lib/rubocop/cop/style/rescue_modifier.rb +39 -20
- data/lib/rubocop/cop/style/rescue_standard_error.rb +19 -21
- data/lib/rubocop/cop/style/return_nil.rb +16 -6
- data/lib/rubocop/cop/style/return_nil_in_predicate_method_definition.rb +137 -0
- data/lib/rubocop/cop/style/safe_navigation.rb +222 -89
- data/lib/rubocop/cop/style/safe_navigation_chain_length.rb +52 -0
- data/lib/rubocop/cop/style/sample.rb +10 -8
- data/lib/rubocop/cop/style/select_by_regexp.rb +169 -0
- data/lib/rubocop/cop/style/self_assignment.rb +15 -21
- data/lib/rubocop/cop/style/semicolon.rb +101 -27
- data/lib/rubocop/cop/style/send.rb +6 -7
- data/lib/rubocop/cop/style/send_with_literal_method_name.rb +105 -0
- data/lib/rubocop/cop/style/signal_exception.rb +17 -17
- data/lib/rubocop/cop/style/single_argument_dig.rb +26 -8
- data/lib/rubocop/cop/style/single_line_block_params.rb +38 -16
- data/lib/rubocop/cop/style/single_line_do_end_block.rb +78 -0
- data/lib/rubocop/cop/style/single_line_methods.rb +78 -15
- data/lib/rubocop/cop/style/slicing_with_range.rb +119 -10
- data/lib/rubocop/cop/style/sole_nested_conditional.rb +178 -7
- data/lib/rubocop/cop/style/special_global_vars.rb +97 -40
- data/lib/rubocop/cop/style/stabby_lambda_parentheses.rb +2 -3
- data/lib/rubocop/cop/style/static_class.rb +128 -0
- data/lib/rubocop/cop/style/stderr_puts.rb +4 -7
- data/lib/rubocop/cop/style/string_chars.rb +42 -0
- data/lib/rubocop/cop/style/string_concatenation.rb +96 -24
- data/lib/rubocop/cop/style/string_hash_keys.rb +11 -2
- data/lib/rubocop/cop/style/string_literals.rb +21 -21
- data/lib/rubocop/cop/style/string_literals_in_interpolation.rb +35 -8
- data/lib/rubocop/cop/style/string_methods.rb +2 -2
- data/lib/rubocop/cop/style/strip.rb +9 -5
- data/lib/rubocop/cop/style/struct_inheritance.rb +27 -5
- data/lib/rubocop/cop/style/super_arguments.rb +221 -0
- data/lib/rubocop/cop/style/super_with_args_parentheses.rb +35 -0
- data/lib/rubocop/cop/style/swap_values.rb +101 -0
- data/lib/rubocop/cop/style/symbol_array.rb +47 -22
- data/lib/rubocop/cop/style/symbol_literal.rb +2 -4
- data/lib/rubocop/cop/style/symbol_proc.rb +198 -22
- data/lib/rubocop/cop/style/ternary_parentheses.rb +49 -29
- data/lib/rubocop/cop/style/top_level_method_definition.rb +86 -0
- data/lib/rubocop/cop/style/trailing_body_on_class.rb +2 -1
- data/lib/rubocop/cop/style/trailing_body_on_method_definition.rb +7 -3
- data/lib/rubocop/cop/style/trailing_body_on_module.rb +1 -1
- data/lib/rubocop/cop/style/trailing_comma_in_arguments.rb +16 -7
- data/lib/rubocop/cop/style/trailing_comma_in_array_literal.rb +48 -7
- data/lib/rubocop/cop/style/trailing_comma_in_block_args.rb +24 -9
- data/lib/rubocop/cop/style/trailing_comma_in_hash_literal.rb +49 -7
- data/lib/rubocop/cop/style/trailing_method_end_statement.rb +5 -11
- data/lib/rubocop/cop/style/trailing_underscore_variable.rb +12 -16
- data/lib/rubocop/cop/style/trivial_accessors.rb +82 -16
- data/lib/rubocop/cop/style/unless_else.rb +6 -3
- data/lib/rubocop/cop/style/unless_logical_operators.rb +106 -0
- data/lib/rubocop/cop/style/unpack_first.rb +16 -15
- data/lib/rubocop/cop/style/variable_interpolation.rb +2 -3
- data/lib/rubocop/cop/style/when_then.rb +5 -3
- data/lib/rubocop/cop/style/while_until_do.rb +0 -2
- data/lib/rubocop/cop/style/while_until_modifier.rb +11 -7
- data/lib/rubocop/cop/style/word_array.rb +79 -8
- data/lib/rubocop/cop/style/yaml_file_read.rb +66 -0
- data/lib/rubocop/cop/style/yoda_condition.rb +52 -29
- data/lib/rubocop/cop/style/yoda_expression.rb +92 -0
- data/lib/rubocop/cop/style/zero_length_predicate.rb +77 -38
- data/lib/rubocop/cop/team.rb +94 -61
- data/lib/rubocop/cop/util.rb +100 -24
- data/lib/rubocop/cop/utils/format_string.rb +11 -8
- data/lib/rubocop/cop/variable_force/assignment.rb +66 -7
- data/lib/rubocop/cop/variable_force/branch.rb +19 -5
- data/lib/rubocop/cop/variable_force/reference.rb +1 -3
- data/lib/rubocop/cop/variable_force/scope.rb +8 -12
- data/lib/rubocop/cop/variable_force/variable.rb +20 -9
- data/lib/rubocop/cop/variable_force/variable_table.rb +9 -7
- data/lib/rubocop/cop/variable_force.rb +63 -66
- data/lib/rubocop/cops_documentation_generator.rb +197 -75
- data/lib/rubocop/core_ext/string.rb +2 -6
- data/lib/rubocop/directive_comment.rb +158 -10
- data/lib/rubocop/ext/comment.rb +18 -0
- data/lib/rubocop/ext/processed_source.rb +2 -0
- data/lib/rubocop/ext/range.rb +15 -0
- data/lib/rubocop/ext/regexp_node.rb +18 -11
- data/lib/rubocop/ext/regexp_parser.rb +78 -0
- data/lib/rubocop/feature_loader.rb +94 -0
- data/lib/rubocop/file_finder.rb +12 -12
- data/lib/rubocop/file_patterns.rb +43 -0
- data/lib/rubocop/formatter/clang_style_formatter.rb +8 -10
- data/lib/rubocop/formatter/disabled_config_formatter.rb +92 -32
- data/lib/rubocop/formatter/emacs_style_formatter.rb +2 -0
- data/lib/rubocop/formatter/formatter_set.rb +29 -20
- data/lib/rubocop/formatter/fuubar_style_formatter.rb +1 -1
- data/lib/rubocop/formatter/github_actions_formatter.rb +57 -0
- data/lib/rubocop/formatter/html_formatter.rb +50 -38
- data/lib/rubocop/formatter/json_formatter.rb +5 -7
- data/lib/rubocop/formatter/junit_formatter.rb +85 -26
- data/lib/rubocop/formatter/markdown_formatter.rb +79 -0
- data/lib/rubocop/formatter/offense_count_formatter.rb +28 -9
- data/lib/rubocop/formatter/pacman_formatter.rb +2 -1
- data/lib/rubocop/formatter/progress_formatter.rb +1 -3
- data/lib/rubocop/formatter/simple_text_formatter.rb +13 -9
- data/lib/rubocop/formatter/tap_formatter.rb +10 -10
- data/lib/rubocop/formatter/worst_offenders_formatter.rb +8 -6
- data/lib/rubocop/formatter.rb +34 -0
- data/lib/rubocop/lockfile.rb +91 -0
- data/lib/rubocop/lsp/diagnostic.rb +189 -0
- data/lib/rubocop/lsp/logger.rb +22 -0
- data/lib/rubocop/lsp/routes.rb +227 -0
- data/lib/rubocop/lsp/runtime.rb +69 -0
- data/lib/rubocop/lsp/server.rb +70 -0
- data/lib/rubocop/lsp/severity.rb +27 -0
- data/lib/rubocop/lsp/stdin_runner.rb +85 -0
- data/lib/rubocop/lsp.rb +36 -0
- data/lib/rubocop/magic_comment.rb +115 -21
- data/lib/rubocop/name_similarity.rb +1 -1
- data/lib/rubocop/options.rb +348 -197
- data/lib/rubocop/path_util.rb +62 -25
- data/lib/rubocop/pending_cops_reporter.rb +56 -0
- data/lib/rubocop/plugin/configuration_integrator.rb +143 -0
- data/lib/rubocop/plugin/load_error.rb +26 -0
- data/lib/rubocop/plugin/loader.rb +100 -0
- data/lib/rubocop/plugin/not_supported_error.rb +29 -0
- data/lib/rubocop/plugin.rb +46 -0
- data/lib/rubocop/rake_task.rb +42 -11
- data/lib/rubocop/remote_config.rb +20 -13
- data/lib/rubocop/result_cache.rb +60 -57
- data/lib/rubocop/rspec/cop_helper.rb +45 -8
- data/lib/rubocop/rspec/expect_offense.rb +80 -45
- data/lib/rubocop/rspec/parallel_formatter.rb +90 -0
- data/lib/rubocop/rspec/shared_contexts.rb +164 -33
- data/lib/rubocop/rspec/support.rb +24 -3
- data/lib/rubocop/runner.rb +168 -52
- data/lib/rubocop/server/cache.rb +208 -0
- data/lib/rubocop/server/cli.rb +147 -0
- data/lib/rubocop/server/client_command/base.rb +54 -0
- data/lib/rubocop/server/client_command/exec.rb +65 -0
- data/lib/rubocop/server/client_command/restart.rb +25 -0
- data/lib/rubocop/server/client_command/start.rb +58 -0
- data/lib/rubocop/server/client_command/status.rb +28 -0
- data/lib/rubocop/server/client_command/stop.rb +31 -0
- data/lib/rubocop/server/client_command.rb +26 -0
- data/lib/rubocop/server/core.rb +116 -0
- data/lib/rubocop/server/errors.rb +23 -0
- data/lib/rubocop/server/helper.rb +34 -0
- data/lib/rubocop/server/server_command/base.rb +50 -0
- data/lib/rubocop/server/server_command/exec.rb +33 -0
- data/lib/rubocop/server/server_command/stop.rb +24 -0
- data/lib/rubocop/server/server_command.rb +21 -0
- data/lib/rubocop/server/socket_reader.rb +69 -0
- data/lib/rubocop/server.rb +53 -0
- data/lib/rubocop/string_interpreter.rb +7 -7
- data/lib/rubocop/target_finder.rb +113 -93
- data/lib/rubocop/target_ruby.rb +156 -19
- data/lib/rubocop/util.rb +16 -0
- data/lib/rubocop/version.rb +139 -8
- data/lib/rubocop/yaml_duplication_checker.rb +20 -26
- data/lib/rubocop.rb +219 -39
- data/lib/ruby_lsp/rubocop/addon.rb +75 -0
- data/lib/ruby_lsp/rubocop/runtime_adapter.rb +65 -0
- metadata +352 -66
- data/bin/console +0 -10
- data/bin/rubocop-profile +0 -32
- data/bin/setup +0 -7
- data/lib/rubocop/cop/mixin/ignored_methods.rb +0 -19
- data/lib/rubocop/cop/mixin/ignored_pattern.rb +0 -29
- data/lib/rubocop/cop/naming/predicate_name.rb +0 -104
- data/lib/rubocop/rspec/host_environment_simulation_helper.rb +0 -28
data/config/default.yml
CHANGED
@@ -30,6 +30,7 @@ AllCops:
|
|
30
30
|
- '**/*.rbx'
|
31
31
|
- '**/*.ru'
|
32
32
|
- '**/*.ruby'
|
33
|
+
- '**/*.schema'
|
33
34
|
- '**/*.spec'
|
34
35
|
- '**/*.thor'
|
35
36
|
- '**/*.watchr'
|
@@ -55,6 +56,7 @@ AllCops:
|
|
55
56
|
- '**/Puppetfile'
|
56
57
|
- '**/Rakefile'
|
57
58
|
- '**/rakefile'
|
59
|
+
- '**/Schemafile'
|
58
60
|
- '**/Snapfile'
|
59
61
|
- '**/Steepfile'
|
60
62
|
- '**/Thorfile'
|
@@ -78,6 +80,10 @@ AllCops:
|
|
78
80
|
# When specifying style guide URLs, any paths and/or fragments will be
|
79
81
|
# evaluated relative to the base URL.
|
80
82
|
StyleGuideBaseURL: https://rubystyle.guide
|
83
|
+
# Documentation URLs will be constructed using the base URL.
|
84
|
+
DocumentationBaseURL: https://docs.rubocop.org/rubocop
|
85
|
+
# Documentation URLs will end with this extension.
|
86
|
+
DocumentationExtension: .html
|
81
87
|
# Extra details are not displayed in offense messages by default. Change
|
82
88
|
# behavior by overriding ExtraDetails, or by giving the
|
83
89
|
# `-E/--extra-details` option.
|
@@ -130,22 +136,64 @@ AllCops:
|
|
130
136
|
# What MRI version of the Ruby interpreter is the inspected code intended to
|
131
137
|
# run on? (If there is more than one, set this to the lowest version.)
|
132
138
|
# If a value is specified for TargetRubyVersion then it is used. Acceptable
|
133
|
-
# values are
|
139
|
+
# values are specified as a float (i.e. 3.0); the teeny version of Ruby
|
134
140
|
# should not be included. If the project specifies a Ruby version in the
|
135
|
-
# .ruby-version
|
136
|
-
# the desired version of Ruby by inspecting the
|
137
|
-
#
|
138
|
-
#
|
139
|
-
# from the lock file.) If the
|
140
|
-
#
|
141
|
+
# .tool-versions or .ruby-version files, Gemfile or gems.rb file, RuboCop will
|
142
|
+
# try to determine the desired version of Ruby by inspecting the
|
143
|
+
# .tool-versions file first, then .ruby-version, followed by the Gemfile.lock
|
144
|
+
# or gems.locked file. (Although the Ruby version is specified in the Gemfile
|
145
|
+
# or gems.rb file, RuboCop reads the final value from the lock file.) If the
|
146
|
+
# Ruby version is still unresolved, RuboCop will use the oldest officially
|
147
|
+
# supported Ruby version (currently Ruby 2.7).
|
141
148
|
TargetRubyVersion: ~
|
149
|
+
# RuboCop choses the parser engine automatically but you can also specify it yourself.
|
150
|
+
# These options are available:
|
151
|
+
# - `default`
|
152
|
+
# - `parser_whitequark` ... https://github.com/whitequark/parser
|
153
|
+
# - `parser_prism` ... https://github.com/ruby/prism (`Prism::Translation::Parser`)
|
154
|
+
# Not every parser engine can handle every `TargetRubyVersion`. `parser_whitequark`
|
155
|
+
# only works with versions 3.4 and below, `parser_prism` with versions 3.3 and above.
|
156
|
+
ParserEngine: default
|
157
|
+
# Determines if a notification for extension libraries should be shown when
|
158
|
+
# rubocop is run. Keys are the name of the extension, and values are an array
|
159
|
+
# of gems in the Gemfile that the extension is suggested for, if not already
|
160
|
+
# included.
|
161
|
+
SuggestExtensions:
|
162
|
+
rubocop-rails: [rails]
|
163
|
+
rubocop-rspec: [rspec, rspec-rails]
|
164
|
+
rubocop-minitest: [minitest]
|
165
|
+
rubocop-sequel: [sequel]
|
166
|
+
rubocop-rake: [rake]
|
167
|
+
rubocop-graphql: [graphql]
|
168
|
+
rubocop-capybara: [capybara]
|
169
|
+
rubocop-factory_bot: [factory_bot, factory_bot_rails]
|
170
|
+
rubocop-rspec_rails: [rspec-rails]
|
171
|
+
# Enable/Disable checking the methods extended by Active Support.
|
172
|
+
ActiveSupportExtensionsEnabled: false
|
173
|
+
# Future version of Ruby will freeze string literals by default.
|
174
|
+
# This allows to opt in early, for example when enabled through RUBYOPT.
|
175
|
+
# For now this will behave as if set to false but in future ruby versions
|
176
|
+
# (likely 4.0) it will be true by default.
|
177
|
+
StringLiteralsFrozenByDefault: ~
|
142
178
|
|
143
179
|
#################### Bundler ###############################
|
144
180
|
|
145
181
|
Bundler/DuplicatedGem:
|
146
182
|
Description: 'Checks for duplicate gem entries in Gemfile.'
|
147
183
|
Enabled: true
|
184
|
+
Severity: warning
|
148
185
|
VersionAdded: '0.46'
|
186
|
+
VersionChanged: '1.40'
|
187
|
+
Include:
|
188
|
+
- '**/*.gemfile'
|
189
|
+
- '**/Gemfile'
|
190
|
+
- '**/gems.rb'
|
191
|
+
|
192
|
+
Bundler/DuplicatedGroup:
|
193
|
+
Description: 'Checks for duplicate group entries in Gemfile.'
|
194
|
+
Enabled: true
|
195
|
+
Severity: warning
|
196
|
+
VersionAdded: '1.56'
|
149
197
|
Include:
|
150
198
|
- '**/*.gemfile'
|
151
199
|
- '**/Gemfile'
|
@@ -163,13 +211,44 @@ Bundler/GemComment:
|
|
163
211
|
IgnoredGems: []
|
164
212
|
OnlyFor: []
|
165
213
|
|
214
|
+
Bundler/GemFilename:
|
215
|
+
Description: 'Enforces the filename for managing gems.'
|
216
|
+
Enabled: true
|
217
|
+
VersionAdded: '1.20'
|
218
|
+
EnforcedStyle: 'Gemfile'
|
219
|
+
SupportedStyles:
|
220
|
+
- 'Gemfile'
|
221
|
+
- 'gems.rb'
|
222
|
+
Include:
|
223
|
+
- '**/Gemfile'
|
224
|
+
- '**/gems.rb'
|
225
|
+
- '**/Gemfile.lock'
|
226
|
+
- '**/gems.locked'
|
227
|
+
|
228
|
+
Bundler/GemVersion:
|
229
|
+
Description: 'Requires or forbids specifying gem versions.'
|
230
|
+
Enabled: false
|
231
|
+
VersionAdded: '1.14'
|
232
|
+
EnforcedStyle: 'required'
|
233
|
+
SupportedStyles:
|
234
|
+
- 'required'
|
235
|
+
- 'forbidden'
|
236
|
+
Include:
|
237
|
+
- '**/*.gemfile'
|
238
|
+
- '**/Gemfile'
|
239
|
+
- '**/gems.rb'
|
240
|
+
AllowedGems: []
|
241
|
+
|
166
242
|
Bundler/InsecureProtocolSource:
|
167
243
|
Description: >-
|
168
244
|
The source `:gemcutter`, `:rubygems` and `:rubyforge` are deprecated
|
169
245
|
because HTTP requests are insecure. Please change your source to
|
170
246
|
'https://rubygems.org' if possible, or 'http://rubygems.org' if not.
|
171
247
|
Enabled: true
|
248
|
+
Severity: warning
|
172
249
|
VersionAdded: '0.50'
|
250
|
+
VersionChanged: '1.40'
|
251
|
+
AllowHttpProtocol: true
|
173
252
|
Include:
|
174
253
|
- '**/*.gemfile'
|
175
254
|
- '**/Gemfile'
|
@@ -192,10 +271,65 @@ Bundler/OrderedGems:
|
|
192
271
|
|
193
272
|
#################### Gemspec ###############################
|
194
273
|
|
274
|
+
Gemspec/AddRuntimeDependency:
|
275
|
+
Description: 'Prefer `add_dependency` over `add_runtime_dependency`.'
|
276
|
+
StyleGuide: '#add_dependency_vs_add_runtime_dependency'
|
277
|
+
References:
|
278
|
+
- https://github.com/rubygems/rubygems/issues/7799#issuecomment-2192720316
|
279
|
+
Enabled: pending
|
280
|
+
VersionAdded: '1.65'
|
281
|
+
Include:
|
282
|
+
- '**/*.gemspec'
|
283
|
+
|
284
|
+
Gemspec/AttributeAssignment:
|
285
|
+
Description: 'Use consistent style for Gemspec attributes assignment.'
|
286
|
+
Enabled: pending
|
287
|
+
VersionAdded: '1.77'
|
288
|
+
Include:
|
289
|
+
- '**/*.gemspec'
|
290
|
+
|
291
|
+
Gemspec/DependencyVersion:
|
292
|
+
Description: 'Requires or forbids specifying gem dependency versions.'
|
293
|
+
Enabled: false
|
294
|
+
VersionAdded: '1.29'
|
295
|
+
EnforcedStyle: 'required'
|
296
|
+
SupportedStyles:
|
297
|
+
- 'required'
|
298
|
+
- 'forbidden'
|
299
|
+
Include:
|
300
|
+
- '**/*.gemspec'
|
301
|
+
AllowedGems: []
|
302
|
+
|
303
|
+
Gemspec/DeprecatedAttributeAssignment:
|
304
|
+
Description: Checks that deprecated attribute assignments are not set in a gemspec file.
|
305
|
+
Enabled: pending
|
306
|
+
Severity: warning
|
307
|
+
VersionAdded: '1.30'
|
308
|
+
VersionChanged: '1.40'
|
309
|
+
Include:
|
310
|
+
- '**/*.gemspec'
|
311
|
+
|
312
|
+
Gemspec/DevelopmentDependencies:
|
313
|
+
Description: Checks that development dependencies are specified in Gemfile rather than gemspec.
|
314
|
+
Enabled: pending
|
315
|
+
VersionAdded: '1.44'
|
316
|
+
EnforcedStyle: Gemfile
|
317
|
+
SupportedStyles:
|
318
|
+
- Gemfile
|
319
|
+
- gems.rb
|
320
|
+
- gemspec
|
321
|
+
AllowedGems: []
|
322
|
+
Include:
|
323
|
+
- '**/*.gemspec'
|
324
|
+
- '**/Gemfile'
|
325
|
+
- '**/gems.rb'
|
326
|
+
|
195
327
|
Gemspec/DuplicatedAssignment:
|
196
328
|
Description: 'An attribute assignment method calls should be listed only once in a gemspec.'
|
197
329
|
Enabled: true
|
330
|
+
Severity: warning
|
198
331
|
VersionAdded: '0.52'
|
332
|
+
VersionChanged: '1.40'
|
199
333
|
Include:
|
200
334
|
- '**/*.gemspec'
|
201
335
|
|
@@ -211,11 +345,23 @@ Gemspec/OrderedDependencies:
|
|
211
345
|
Include:
|
212
346
|
- '**/*.gemspec'
|
213
347
|
|
348
|
+
Gemspec/RequireMFA:
|
349
|
+
Description: 'Checks that the gemspec has metadata to require Multi-Factor Authentication from RubyGems.'
|
350
|
+
Enabled: pending
|
351
|
+
Severity: warning
|
352
|
+
VersionAdded: '1.23'
|
353
|
+
VersionChanged: '1.40'
|
354
|
+
References:
|
355
|
+
- https://guides.rubygems.org/mfa-requirement-opt-in/
|
356
|
+
Include:
|
357
|
+
- '**/*.gemspec'
|
358
|
+
|
214
359
|
Gemspec/RequiredRubyVersion:
|
215
360
|
Description: 'Checks that `required_ruby_version` of gemspec is specified and equal to `TargetRubyVersion` of .rubocop.yml.'
|
216
361
|
Enabled: true
|
362
|
+
Severity: warning
|
217
363
|
VersionAdded: '0.52'
|
218
|
-
VersionChanged: '
|
364
|
+
VersionChanged: '1.40'
|
219
365
|
Include:
|
220
366
|
- '**/*.gemspec'
|
221
367
|
|
@@ -223,14 +369,16 @@ Gemspec/RubyVersionGlobalsUsage:
|
|
223
369
|
Description: Checks usage of RUBY_VERSION in gemspec.
|
224
370
|
StyleGuide: '#no-ruby-version-in-the-gemspec'
|
225
371
|
Enabled: true
|
372
|
+
Severity: warning
|
226
373
|
VersionAdded: '0.72'
|
374
|
+
VersionChanged: '1.40'
|
227
375
|
Include:
|
228
376
|
- '**/*.gemspec'
|
229
377
|
|
230
378
|
#################### Layout ###########################
|
231
379
|
|
232
380
|
Layout/AccessModifierIndentation:
|
233
|
-
Description:
|
381
|
+
Description: Checks indentation of private/protected visibility modifiers.
|
234
382
|
StyleGuide: '#indent-public-private-protected'
|
235
383
|
Enabled: true
|
236
384
|
VersionAdded: '0.49'
|
@@ -238,8 +386,8 @@ Layout/AccessModifierIndentation:
|
|
238
386
|
SupportedStyles:
|
239
387
|
- outdent
|
240
388
|
- indent
|
241
|
-
# By default
|
242
|
-
#
|
389
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
390
|
+
# but it can be overridden by setting this parameter.
|
243
391
|
IndentationWidth: ~
|
244
392
|
|
245
393
|
Layout/ArgumentAlignment:
|
@@ -267,8 +415,8 @@ Layout/ArgumentAlignment:
|
|
267
415
|
SupportedStyles:
|
268
416
|
- with_first_argument
|
269
417
|
- with_fixed_indentation
|
270
|
-
# By default
|
271
|
-
#
|
418
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
419
|
+
# but it can be overridden by setting this parameter.
|
272
420
|
IndentationWidth: ~
|
273
421
|
|
274
422
|
Layout/ArrayAlignment:
|
@@ -296,8 +444,8 @@ Layout/ArrayAlignment:
|
|
296
444
|
SupportedStyles:
|
297
445
|
- with_first_element
|
298
446
|
- with_fixed_indentation
|
299
|
-
# By default
|
300
|
-
#
|
447
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
448
|
+
# but it can be overridden by setting this parameter.
|
301
449
|
IndentationWidth: ~
|
302
450
|
|
303
451
|
Layout/AssignmentIndentation:
|
@@ -306,14 +454,14 @@ Layout/AssignmentIndentation:
|
|
306
454
|
right-hand-side of a multi-line assignment.
|
307
455
|
Enabled: true
|
308
456
|
VersionAdded: '0.49'
|
309
|
-
VersionChanged: '
|
310
|
-
# By default
|
311
|
-
#
|
457
|
+
VersionChanged: '1.45'
|
458
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
459
|
+
# but it can be overridden by setting this parameter.
|
312
460
|
IndentationWidth: ~
|
313
461
|
|
314
462
|
Layout/BeginEndAlignment:
|
315
463
|
Description: 'Align ends corresponding to begins correctly.'
|
316
|
-
Enabled:
|
464
|
+
Enabled: true
|
317
465
|
VersionAdded: '0.91'
|
318
466
|
# The value `start_of_line` means that `end` should be aligned the start of the line
|
319
467
|
# where the `begin` keyword is.
|
@@ -345,38 +493,41 @@ Layout/BlockEndNewline:
|
|
345
493
|
VersionAdded: '0.49'
|
346
494
|
|
347
495
|
Layout/CaseIndentation:
|
348
|
-
Description: 'Indentation of when in a case/when/[else/]end.'
|
496
|
+
Description: 'Indentation of when in a case/(when|in)/[else/]end.'
|
349
497
|
StyleGuide: '#indent-when-to-case'
|
350
498
|
Enabled: true
|
351
499
|
VersionAdded: '0.49'
|
500
|
+
VersionChanged: '1.16'
|
352
501
|
EnforcedStyle: case
|
353
502
|
SupportedStyles:
|
354
503
|
- case
|
355
504
|
- end
|
356
505
|
IndentOneStep: false
|
357
|
-
# By default
|
358
|
-
#
|
359
|
-
# This only matters if `IndentOneStep` is `true
|
506
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
507
|
+
# but it can be overridden by setting this parameter.
|
508
|
+
# This only matters if `IndentOneStep` is `true`.
|
360
509
|
IndentationWidth: ~
|
361
510
|
|
362
511
|
Layout/ClassStructure:
|
363
512
|
Description: 'Enforces a configured order of definitions within a class body.'
|
364
513
|
StyleGuide: '#consistent-classes'
|
365
514
|
Enabled: false
|
515
|
+
SafeAutoCorrect: false
|
366
516
|
VersionAdded: '0.52'
|
517
|
+
VersionChanged: '1.53'
|
367
518
|
Categories:
|
368
519
|
module_inclusion:
|
369
520
|
- include
|
370
521
|
- prepend
|
371
522
|
- extend
|
372
523
|
ExpectedOrder:
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
524
|
+
- module_inclusion
|
525
|
+
- constants
|
526
|
+
- public_class_methods
|
527
|
+
- initializer
|
528
|
+
- public_methods
|
529
|
+
- protected_methods
|
530
|
+
- private_methods
|
380
531
|
|
381
532
|
Layout/ClosingHeredocIndentation:
|
382
533
|
Description: 'Checks the indentation of here document closings.'
|
@@ -391,7 +542,11 @@ Layout/ClosingParenthesisIndentation:
|
|
391
542
|
Layout/CommentIndentation:
|
392
543
|
Description: 'Indentation of comments.'
|
393
544
|
Enabled: true
|
545
|
+
# When true, allows comments to have extra indentation if that aligns them
|
546
|
+
# with a comment on the preceding line.
|
547
|
+
AllowForAlignment: false
|
394
548
|
VersionAdded: '0.49'
|
549
|
+
VersionChanged: '1.24'
|
395
550
|
|
396
551
|
Layout/ConditionPosition:
|
397
552
|
Description: >-
|
@@ -434,7 +589,9 @@ Layout/ElseAlignment:
|
|
434
589
|
Layout/EmptyComment:
|
435
590
|
Description: 'Checks empty comment.'
|
436
591
|
Enabled: true
|
592
|
+
AutoCorrect: contextual
|
437
593
|
VersionAdded: '0.53'
|
594
|
+
VersionChanged: '1.61'
|
438
595
|
AllowBorderComment: true
|
439
596
|
AllowMarginComment: true
|
440
597
|
|
@@ -455,17 +612,23 @@ Layout/EmptyLineAfterMultilineCondition:
|
|
455
612
|
# This is disabled, because this style is not very common in practice.
|
456
613
|
Enabled: false
|
457
614
|
VersionAdded: '0.90'
|
458
|
-
|
615
|
+
References:
|
459
616
|
- https://github.com/airbnb/ruby#multiline-if-newline
|
460
617
|
|
461
618
|
Layout/EmptyLineBetweenDefs:
|
462
|
-
Description: 'Use empty lines between defs.'
|
619
|
+
Description: 'Use empty lines between class/module/method defs.'
|
463
620
|
StyleGuide: '#empty-lines-between-methods'
|
464
621
|
Enabled: true
|
465
622
|
VersionAdded: '0.49'
|
466
|
-
|
467
|
-
|
468
|
-
|
623
|
+
VersionChanged: '1.23'
|
624
|
+
EmptyLineBetweenMethodDefs: true
|
625
|
+
EmptyLineBetweenClassDefs: true
|
626
|
+
EmptyLineBetweenModuleDefs: true
|
627
|
+
# `DefLikeMacros` takes the name of any macro that you want to treat like a def.
|
628
|
+
DefLikeMacros: []
|
629
|
+
# `AllowAdjacentOneLineDefs` means that single line method definitions don't
|
630
|
+
# need an empty line between them. `true` by default.
|
631
|
+
AllowAdjacentOneLineDefs: true
|
469
632
|
# Can be array to specify minimum and maximum number of empty lines, e.g. [1, 2]
|
470
633
|
NumberOfEmptyLines: 1
|
471
634
|
|
@@ -475,6 +638,12 @@ Layout/EmptyLines:
|
|
475
638
|
Enabled: true
|
476
639
|
VersionAdded: '0.49'
|
477
640
|
|
641
|
+
Layout/EmptyLinesAfterModuleInclusion:
|
642
|
+
Description: 'Keeps track of empty lines after module inclusion methods.'
|
643
|
+
StyleGuide: '#empty-lines-after-module-inclusion'
|
644
|
+
Enabled: pending
|
645
|
+
VersionAdded: '1.79'
|
646
|
+
|
478
647
|
Layout/EmptyLinesAroundAccessModifier:
|
479
648
|
Description: "Keep blank lines around access modifiers."
|
480
649
|
StyleGuide: '#empty-lines-around-access-modifier'
|
@@ -484,7 +653,7 @@ Layout/EmptyLinesAroundAccessModifier:
|
|
484
653
|
SupportedStyles:
|
485
654
|
- around
|
486
655
|
- only_before
|
487
|
-
|
656
|
+
References:
|
488
657
|
# A reference to `EnforcedStyle: only_before`.
|
489
658
|
- https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions
|
490
659
|
|
@@ -496,7 +665,7 @@ Layout/EmptyLinesAroundArguments:
|
|
496
665
|
Layout/EmptyLinesAroundAttributeAccessor:
|
497
666
|
Description: "Keep blank lines around attribute accessors."
|
498
667
|
StyleGuide: '#empty-lines-around-attribute-accessor'
|
499
|
-
Enabled:
|
668
|
+
Enabled: true
|
500
669
|
VersionAdded: '0.83'
|
501
670
|
VersionChanged: '0.84'
|
502
671
|
AllowAliasSyntax: true
|
@@ -629,8 +798,8 @@ Layout/FirstArgumentIndentation:
|
|
629
798
|
# Same as `special_for_inner_method_call` except that the special rule only
|
630
799
|
# applies if the outer method call encloses its arguments in parentheses.
|
631
800
|
- special_for_inner_method_call_in_parentheses
|
632
|
-
# By default
|
633
|
-
#
|
801
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
802
|
+
# but it can be overridden by setting this parameter.
|
634
803
|
IndentationWidth: ~
|
635
804
|
|
636
805
|
Layout/FirstArrayElementIndentation:
|
@@ -656,8 +825,8 @@ Layout/FirstArrayElementIndentation:
|
|
656
825
|
- special_inside_parentheses
|
657
826
|
- consistent
|
658
827
|
- align_brackets
|
659
|
-
# By default
|
660
|
-
#
|
828
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
829
|
+
# but it can be overridden by setting this parameter.
|
661
830
|
IndentationWidth: ~
|
662
831
|
|
663
832
|
Layout/FirstArrayElementLineBreak:
|
@@ -666,6 +835,7 @@ Layout/FirstArrayElementLineBreak:
|
|
666
835
|
multi-line array.
|
667
836
|
Enabled: false
|
668
837
|
VersionAdded: '0.49'
|
838
|
+
AllowMultilineFinalElement: false
|
669
839
|
|
670
840
|
Layout/FirstHashElementIndentation:
|
671
841
|
Description: 'Checks the indentation of the first key in a hash literal.'
|
@@ -688,8 +858,8 @@ Layout/FirstHashElementIndentation:
|
|
688
858
|
- special_inside_parentheses
|
689
859
|
- consistent
|
690
860
|
- align_braces
|
691
|
-
# By default
|
692
|
-
#
|
861
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
862
|
+
# but it can be overridden by setting this parameter.
|
693
863
|
IndentationWidth: ~
|
694
864
|
|
695
865
|
Layout/FirstHashElementLineBreak:
|
@@ -698,6 +868,7 @@ Layout/FirstHashElementLineBreak:
|
|
698
868
|
multi-line hash.
|
699
869
|
Enabled: false
|
700
870
|
VersionAdded: '0.49'
|
871
|
+
AllowMultilineFinalElement: false
|
701
872
|
|
702
873
|
Layout/FirstMethodArgumentLineBreak:
|
703
874
|
Description: >-
|
@@ -705,6 +876,8 @@ Layout/FirstMethodArgumentLineBreak:
|
|
705
876
|
multi-line method call.
|
706
877
|
Enabled: false
|
707
878
|
VersionAdded: '0.49'
|
879
|
+
AllowMultilineFinalElement: false
|
880
|
+
AllowedMethods: []
|
708
881
|
|
709
882
|
Layout/FirstMethodParameterLineBreak:
|
710
883
|
Description: >-
|
@@ -712,6 +885,7 @@ Layout/FirstMethodParameterLineBreak:
|
|
712
885
|
multi-line method parameter definition.
|
713
886
|
Enabled: false
|
714
887
|
VersionAdded: '0.49'
|
888
|
+
AllowMultilineFinalElement: false
|
715
889
|
|
716
890
|
Layout/FirstParameterIndentation:
|
717
891
|
Description: >-
|
@@ -724,8 +898,8 @@ Layout/FirstParameterIndentation:
|
|
724
898
|
SupportedStyles:
|
725
899
|
- consistent
|
726
900
|
- align_parentheses
|
727
|
-
# By default
|
728
|
-
#
|
901
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
902
|
+
# but it can be overridden by setting this parameter.
|
729
903
|
IndentationWidth: ~
|
730
904
|
|
731
905
|
Layout/HashAlignment:
|
@@ -735,7 +909,7 @@ Layout/HashAlignment:
|
|
735
909
|
Enabled: true
|
736
910
|
AllowMultipleStyles: true
|
737
911
|
VersionAdded: '0.49'
|
738
|
-
VersionChanged: '
|
912
|
+
VersionChanged: '1.16'
|
739
913
|
# Alignment of entries using hash rocket as separator. Valid values are:
|
740
914
|
#
|
741
915
|
# key - left alignment of keys
|
@@ -815,7 +989,7 @@ Layout/HeredocArgumentClosingParenthesis:
|
|
815
989
|
VersionAdded: '0.68'
|
816
990
|
|
817
991
|
Layout/HeredocIndentation:
|
818
|
-
Description: '
|
992
|
+
Description: 'Checks the indentation of the here document bodies.'
|
819
993
|
StyleGuide: '#squiggly-heredocs'
|
820
994
|
Enabled: true
|
821
995
|
VersionAdded: '0.49'
|
@@ -836,7 +1010,7 @@ Layout/IndentationConsistency:
|
|
836
1010
|
SupportedStyles:
|
837
1011
|
- normal
|
838
1012
|
- indented_internal_methods
|
839
|
-
|
1013
|
+
References:
|
840
1014
|
# A reference to `EnforcedStyle: indented_internal_methods`.
|
841
1015
|
- https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions
|
842
1016
|
|
@@ -846,9 +1020,9 @@ Layout/IndentationStyle:
|
|
846
1020
|
Enabled: true
|
847
1021
|
VersionAdded: '0.49'
|
848
1022
|
VersionChanged: '0.82'
|
849
|
-
# By default
|
850
|
-
#
|
851
|
-
# It is used during
|
1023
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
1024
|
+
# but it can be overridden by setting this parameter.
|
1025
|
+
# It is used during autocorrection to determine how many spaces should
|
852
1026
|
# replace each tab.
|
853
1027
|
IndentationWidth: ~
|
854
1028
|
EnforcedStyle: spaces
|
@@ -863,7 +1037,7 @@ Layout/IndentationWidth:
|
|
863
1037
|
VersionAdded: '0.49'
|
864
1038
|
# Number of spaces for each indentation level.
|
865
1039
|
Width: 2
|
866
|
-
|
1040
|
+
AllowedPatterns: []
|
867
1041
|
|
868
1042
|
Layout/InitialIndentation:
|
869
1043
|
Description: >-
|
@@ -879,35 +1053,74 @@ Layout/LeadingCommentSpace:
|
|
879
1053
|
VersionChanged: '0.73'
|
880
1054
|
AllowDoxygenCommentStyle: false
|
881
1055
|
AllowGemfileRubyComment: false
|
1056
|
+
AllowRBSInlineAnnotation: false
|
1057
|
+
AllowSteepAnnotation: false
|
882
1058
|
|
883
1059
|
Layout/LeadingEmptyLines:
|
884
|
-
Description:
|
1060
|
+
Description: Checks for unnecessary blank lines at the beginning of a file.
|
885
1061
|
Enabled: true
|
886
1062
|
VersionAdded: '0.57'
|
887
1063
|
VersionChanged: '0.77'
|
888
1064
|
|
1065
|
+
Layout/LineContinuationLeadingSpace:
|
1066
|
+
Description: >-
|
1067
|
+
Use trailing spaces instead of leading spaces in strings
|
1068
|
+
broken over multiple lines (by a backslash).
|
1069
|
+
Enabled: pending
|
1070
|
+
VersionAdded: '1.31'
|
1071
|
+
VersionChanged: '1.45'
|
1072
|
+
EnforcedStyle: trailing
|
1073
|
+
SupportedStyles:
|
1074
|
+
- leading
|
1075
|
+
- trailing
|
1076
|
+
|
1077
|
+
Layout/LineContinuationSpacing:
|
1078
|
+
Description: 'Checks the spacing in front of backslash in line continuations.'
|
1079
|
+
Enabled: pending
|
1080
|
+
VersionAdded: '1.31'
|
1081
|
+
EnforcedStyle: space
|
1082
|
+
SupportedStyles:
|
1083
|
+
- space
|
1084
|
+
- no_space
|
1085
|
+
|
1086
|
+
Layout/LineEndStringConcatenationIndentation:
|
1087
|
+
Description: >-
|
1088
|
+
Checks the indentation of the next line after a line that
|
1089
|
+
ends with a string literal and a backslash.
|
1090
|
+
Enabled: pending
|
1091
|
+
VersionAdded: '1.18'
|
1092
|
+
EnforcedStyle: aligned
|
1093
|
+
SupportedStyles:
|
1094
|
+
- aligned
|
1095
|
+
- indented
|
1096
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
1097
|
+
# but it can be overridden by setting this parameter.
|
1098
|
+
IndentationWidth: ~
|
1099
|
+
|
889
1100
|
Layout/LineLength:
|
890
1101
|
Description: 'Checks that line length does not exceed the configured limit.'
|
891
1102
|
StyleGuide: '#max-line-length'
|
892
1103
|
Enabled: true
|
893
1104
|
VersionAdded: '0.25'
|
894
|
-
VersionChanged: '
|
895
|
-
AutoCorrect: false
|
1105
|
+
VersionChanged: '1.69'
|
896
1106
|
Max: 120
|
1107
|
+
AllowHeredoc: true
|
897
1108
|
# To make it possible to copy or click on URIs in the code, we allow lines
|
898
1109
|
# containing a URI to be longer than Max.
|
899
|
-
AllowHeredoc: true
|
900
1110
|
AllowURI: true
|
1111
|
+
AllowQualifiedName: true
|
901
1112
|
URISchemes:
|
902
1113
|
- http
|
903
1114
|
- https
|
904
1115
|
# The IgnoreCopDirectives option causes the LineLength rule to ignore cop
|
905
1116
|
# directives like '# rubocop: enable ...' when calculating a line's length.
|
906
1117
|
IgnoreCopDirectives: true
|
907
|
-
# The
|
1118
|
+
# The AllowedPatterns option is a list of !ruby/regexp and/or string
|
908
1119
|
# elements. Strings will be converted to Regexp objects. A line that matches
|
909
1120
|
# any regular expression listed in this option will be ignored by LineLength.
|
910
|
-
|
1121
|
+
AllowedPatterns: []
|
1122
|
+
# If SplitStrings is true, long strings will be split using continuations
|
1123
|
+
SplitStrings: false
|
911
1124
|
|
912
1125
|
Layout/MultilineArrayBraceLayout:
|
913
1126
|
Description: >-
|
@@ -931,9 +1144,10 @@ Layout/MultilineArrayLineBreaks:
|
|
931
1144
|
starts on a separate line.
|
932
1145
|
Enabled: false
|
933
1146
|
VersionAdded: '0.67'
|
1147
|
+
AllowMultilineFinalElement: false
|
934
1148
|
|
935
1149
|
Layout/MultilineAssignmentLayout:
|
936
|
-
Description: '
|
1150
|
+
Description: 'Checks for a newline after the assignment operator in multi-line assignments.'
|
937
1151
|
StyleGuide: '#indent-conditional-assignment'
|
938
1152
|
Enabled: false
|
939
1153
|
VersionAdded: '0.49'
|
@@ -981,6 +1195,7 @@ Layout/MultilineHashKeyLineBreaks:
|
|
981
1195
|
starts on a separate line.
|
982
1196
|
Enabled: false
|
983
1197
|
VersionAdded: '0.67'
|
1198
|
+
AllowMultilineFinalElement: false
|
984
1199
|
|
985
1200
|
Layout/MultilineMethodArgumentLineBreaks:
|
986
1201
|
Description: >-
|
@@ -988,6 +1203,7 @@ Layout/MultilineMethodArgumentLineBreaks:
|
|
988
1203
|
starts on a separate line.
|
989
1204
|
Enabled: false
|
990
1205
|
VersionAdded: '0.67'
|
1206
|
+
AllowMultilineFinalElement: false
|
991
1207
|
|
992
1208
|
Layout/MultilineMethodCallBraceLayout:
|
993
1209
|
Description: >-
|
@@ -1016,8 +1232,8 @@ Layout/MultilineMethodCallIndentation:
|
|
1016
1232
|
- aligned
|
1017
1233
|
- indented
|
1018
1234
|
- indented_relative_to_receiver
|
1019
|
-
# By default
|
1020
|
-
#
|
1235
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
1236
|
+
# but it can be overridden by setting this parameter.
|
1021
1237
|
IndentationWidth: ~
|
1022
1238
|
|
1023
1239
|
Layout/MultilineMethodDefinitionBraceLayout:
|
@@ -1036,6 +1252,14 @@ Layout/MultilineMethodDefinitionBraceLayout:
|
|
1036
1252
|
- new_line
|
1037
1253
|
- same_line
|
1038
1254
|
|
1255
|
+
Layout/MultilineMethodParameterLineBreaks:
|
1256
|
+
Description: >-
|
1257
|
+
Checks that each parameter in a multi-line method definition
|
1258
|
+
starts on a separate line.
|
1259
|
+
Enabled: false
|
1260
|
+
VersionAdded: '1.32'
|
1261
|
+
AllowMultilineFinalElement: false
|
1262
|
+
|
1039
1263
|
Layout/MultilineOperationIndentation:
|
1040
1264
|
Description: >-
|
1041
1265
|
Checks indentation of binary operations that span more than
|
@@ -1046,8 +1270,8 @@ Layout/MultilineOperationIndentation:
|
|
1046
1270
|
SupportedStyles:
|
1047
1271
|
- aligned
|
1048
1272
|
- indented
|
1049
|
-
# By default
|
1050
|
-
#
|
1273
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
1274
|
+
# but it can be overridden by setting this parameter.
|
1051
1275
|
IndentationWidth: ~
|
1052
1276
|
|
1053
1277
|
Layout/ParameterAlignment:
|
@@ -1075,15 +1299,28 @@ Layout/ParameterAlignment:
|
|
1075
1299
|
SupportedStyles:
|
1076
1300
|
- with_first_parameter
|
1077
1301
|
- with_fixed_indentation
|
1078
|
-
# By default
|
1079
|
-
#
|
1302
|
+
# By default the indentation width from `Layout/IndentationWidth` is used,
|
1303
|
+
# but it can be overridden by setting this parameter.
|
1080
1304
|
IndentationWidth: ~
|
1081
1305
|
|
1306
|
+
Layout/RedundantLineBreak:
|
1307
|
+
Description: >-
|
1308
|
+
Do not break up an expression into multiple lines when it fits
|
1309
|
+
on a single line.
|
1310
|
+
Enabled: false
|
1311
|
+
InspectBlocks: false
|
1312
|
+
VersionAdded: '1.13'
|
1313
|
+
|
1082
1314
|
Layout/RescueEnsureAlignment:
|
1083
1315
|
Description: 'Align rescues and ensures correctly.'
|
1084
1316
|
Enabled: true
|
1085
1317
|
VersionAdded: '0.49'
|
1086
1318
|
|
1319
|
+
Layout/SingleLineBlockChain:
|
1320
|
+
Description: 'Put method call on a separate line if chained to a single line block.'
|
1321
|
+
Enabled: false
|
1322
|
+
VersionAdded: '1.14'
|
1323
|
+
|
1087
1324
|
Layout/SpaceAfterColon:
|
1088
1325
|
Description: 'Use spaces after colons.'
|
1089
1326
|
StyleGuide: '#spaces-operators'
|
@@ -1145,7 +1382,7 @@ Layout/SpaceAroundKeyword:
|
|
1145
1382
|
|
1146
1383
|
Layout/SpaceAroundMethodCallOperator:
|
1147
1384
|
Description: 'Checks method call operators to not have spaces around them.'
|
1148
|
-
Enabled:
|
1385
|
+
Enabled: true
|
1149
1386
|
VersionAdded: '0.82'
|
1150
1387
|
|
1151
1388
|
Layout/SpaceAroundOperators:
|
@@ -1161,6 +1398,10 @@ Layout/SpaceAroundOperators:
|
|
1161
1398
|
SupportedStylesForExponentOperator:
|
1162
1399
|
- space
|
1163
1400
|
- no_space
|
1401
|
+
EnforcedStyleForRationalLiterals: no_space
|
1402
|
+
SupportedStylesForRationalLiterals:
|
1403
|
+
- space
|
1404
|
+
- no_space
|
1164
1405
|
|
1165
1406
|
Layout/SpaceBeforeBlockBraces:
|
1166
1407
|
Description: >-
|
@@ -1176,7 +1417,13 @@ Layout/SpaceBeforeBlockBraces:
|
|
1176
1417
|
SupportedStylesForEmptyBraces:
|
1177
1418
|
- space
|
1178
1419
|
- no_space
|
1179
|
-
VersionChanged: '0.52
|
1420
|
+
VersionChanged: '0.52'
|
1421
|
+
|
1422
|
+
Layout/SpaceBeforeBrackets:
|
1423
|
+
Description: 'Checks for receiver with a space before the opening brackets.'
|
1424
|
+
StyleGuide: '#space-in-brackets-access'
|
1425
|
+
Enabled: pending
|
1426
|
+
VersionAdded: '1.7'
|
1180
1427
|
|
1181
1428
|
Layout/SpaceBeforeComma:
|
1182
1429
|
Description: 'No spaces before commas.'
|
@@ -1271,16 +1518,16 @@ Layout/SpaceInsideHashLiteralBraces:
|
|
1271
1518
|
- space
|
1272
1519
|
- no_space
|
1273
1520
|
|
1274
|
-
|
1275
1521
|
Layout/SpaceInsideParens:
|
1276
1522
|
Description: 'No spaces after ( or before ).'
|
1277
1523
|
StyleGuide: '#spaces-braces'
|
1278
1524
|
Enabled: true
|
1279
1525
|
VersionAdded: '0.49'
|
1280
|
-
VersionChanged: '
|
1526
|
+
VersionChanged: '1.22'
|
1281
1527
|
EnforcedStyle: no_space
|
1282
1528
|
SupportedStyles:
|
1283
1529
|
- space
|
1530
|
+
- compact
|
1284
1531
|
- no_space
|
1285
1532
|
|
1286
1533
|
Layout/SpaceInsidePercentLiteralDelimiters:
|
@@ -1334,19 +1581,26 @@ Layout/TrailingWhitespace:
|
|
1334
1581
|
StyleGuide: '#no-trailing-whitespace'
|
1335
1582
|
Enabled: true
|
1336
1583
|
VersionAdded: '0.49'
|
1337
|
-
VersionChanged: '0
|
1338
|
-
AllowInHeredoc:
|
1584
|
+
VersionChanged: '1.0'
|
1585
|
+
AllowInHeredoc: false
|
1339
1586
|
|
1340
1587
|
#################### Lint ##################################
|
1341
1588
|
### Warnings
|
1342
1589
|
|
1590
|
+
Lint/AmbiguousAssignment:
|
1591
|
+
Description: 'Checks for mistyped shorthand assignments.'
|
1592
|
+
Enabled: pending
|
1593
|
+
VersionAdded: '1.7'
|
1594
|
+
|
1343
1595
|
Lint/AmbiguousBlockAssociation:
|
1344
1596
|
Description: >-
|
1345
1597
|
Checks for ambiguous block association with method when param passed without
|
1346
1598
|
parentheses.
|
1347
|
-
StyleGuide: '#syntax'
|
1348
1599
|
Enabled: true
|
1349
1600
|
VersionAdded: '0.48'
|
1601
|
+
VersionChanged: '1.13'
|
1602
|
+
AllowedMethods: []
|
1603
|
+
AllowedPatterns: []
|
1350
1604
|
|
1351
1605
|
Lint/AmbiguousOperator:
|
1352
1606
|
Description: >-
|
@@ -1357,6 +1611,20 @@ Lint/AmbiguousOperator:
|
|
1357
1611
|
VersionAdded: '0.17'
|
1358
1612
|
VersionChanged: '0.83'
|
1359
1613
|
|
1614
|
+
Lint/AmbiguousOperatorPrecedence:
|
1615
|
+
Description: >-
|
1616
|
+
Checks for expressions containing multiple binary operations with
|
1617
|
+
ambiguous precedence.
|
1618
|
+
Enabled: pending
|
1619
|
+
VersionAdded: '1.21'
|
1620
|
+
|
1621
|
+
Lint/AmbiguousRange:
|
1622
|
+
Description: Checks for ranges with ambiguous boundaries.
|
1623
|
+
Enabled: pending
|
1624
|
+
VersionAdded: '1.19'
|
1625
|
+
SafeAutoCorrect: false
|
1626
|
+
RequireParenthesesForMethodChains: false
|
1627
|
+
|
1360
1628
|
Lint/AmbiguousRegexpLiteral:
|
1361
1629
|
Description: >-
|
1362
1630
|
Checks for ambiguous regexp literals in the first argument of
|
@@ -1365,11 +1633,19 @@ Lint/AmbiguousRegexpLiteral:
|
|
1365
1633
|
VersionAdded: '0.17'
|
1366
1634
|
VersionChanged: '0.83'
|
1367
1635
|
|
1636
|
+
Lint/ArrayLiteralInRegexp:
|
1637
|
+
Description: 'Checks for an array literal interpolated inside a regexp.'
|
1638
|
+
Enabled: pending
|
1639
|
+
VersionAdded: '1.71'
|
1640
|
+
SafeAutoCorrect: false
|
1641
|
+
|
1368
1642
|
Lint/AssignmentInCondition:
|
1369
1643
|
Description: "Don't use assignment in conditions."
|
1370
1644
|
StyleGuide: '#safe-assignment-in-condition'
|
1371
1645
|
Enabled: true
|
1646
|
+
SafeAutoCorrect: false
|
1372
1647
|
VersionAdded: '0.9'
|
1648
|
+
VersionChanged: '1.45'
|
1373
1649
|
AllowSafeAssignment: true
|
1374
1650
|
|
1375
1651
|
Lint/BigDecimalNew:
|
@@ -1378,17 +1654,18 @@ Lint/BigDecimalNew:
|
|
1378
1654
|
VersionAdded: '0.53'
|
1379
1655
|
|
1380
1656
|
Lint/BinaryOperatorWithIdenticalOperands:
|
1381
|
-
Description: '
|
1382
|
-
Enabled:
|
1657
|
+
Description: 'Checks for places where binary operator has identical operands.'
|
1658
|
+
Enabled: true
|
1383
1659
|
Safe: false
|
1384
1660
|
VersionAdded: '0.89'
|
1661
|
+
VersionChanged: '1.69'
|
1385
1662
|
|
1386
1663
|
Lint/BooleanSymbol:
|
1387
|
-
Description: '
|
1664
|
+
Description: 'Checks for `:true` and `:false` symbols.'
|
1388
1665
|
Enabled: true
|
1389
|
-
|
1666
|
+
SafeAutoCorrect: false
|
1390
1667
|
VersionAdded: '0.50'
|
1391
|
-
VersionChanged: '
|
1668
|
+
VersionChanged: '1.22'
|
1392
1669
|
|
1393
1670
|
Lint/CircularArgumentReference:
|
1394
1671
|
Description: "Default values in optional keyword arguments and optional ordinal arguments should not refer back to the name of the argument."
|
@@ -1398,11 +1675,26 @@ Lint/CircularArgumentReference:
|
|
1398
1675
|
Lint/ConstantDefinitionInBlock:
|
1399
1676
|
Description: 'Do not define constants within a block.'
|
1400
1677
|
StyleGuide: '#no-constant-definition-in-block'
|
1401
|
-
Enabled:
|
1678
|
+
Enabled: true
|
1402
1679
|
VersionAdded: '0.91'
|
1680
|
+
VersionChanged: '1.3'
|
1681
|
+
# `enums` for Typed Enums via T::Enum in Sorbet.
|
1682
|
+
# https://sorbet.org/docs/tenum
|
1683
|
+
AllowedMethods:
|
1684
|
+
- enums
|
1685
|
+
|
1686
|
+
Lint/ConstantOverwrittenInRescue:
|
1687
|
+
Description: 'Checks for overwriting an exception with an exception result by use `rescue =>`.'
|
1688
|
+
Enabled: pending
|
1689
|
+
VersionAdded: '1.31'
|
1690
|
+
|
1691
|
+
Lint/ConstantReassignment:
|
1692
|
+
Description: 'Checks for constant reassignments.'
|
1693
|
+
Enabled: pending
|
1694
|
+
VersionAdded: '1.70'
|
1403
1695
|
|
1404
1696
|
Lint/ConstantResolution:
|
1405
|
-
Description: '
|
1697
|
+
Description: 'Checks that constants are fully qualified with `::`.'
|
1406
1698
|
Enabled: false
|
1407
1699
|
VersionAdded: '0.86'
|
1408
1700
|
# Restrict this cop to only looking at certain names
|
@@ -1410,20 +1702,108 @@ Lint/ConstantResolution:
|
|
1410
1702
|
# Restrict this cop from only looking at certain names
|
1411
1703
|
Ignore: []
|
1412
1704
|
|
1705
|
+
Lint/CopDirectiveSyntax:
|
1706
|
+
Description: 'Checks that `# rubocop:` directives are strictly formatted.'
|
1707
|
+
Enabled: pending
|
1708
|
+
VersionAdded: '1.72'
|
1709
|
+
|
1413
1710
|
Lint/Debugger:
|
1414
|
-
Description: '
|
1711
|
+
Description: 'Checks for debugger calls.'
|
1415
1712
|
Enabled: true
|
1416
1713
|
VersionAdded: '0.14'
|
1417
|
-
VersionChanged: '
|
1714
|
+
VersionChanged: '1.63'
|
1715
|
+
DebuggerMethods:
|
1716
|
+
# Groups are available so that a specific group can be disabled in
|
1717
|
+
# a user's configuration, but are otherwise not significant.
|
1718
|
+
Kernel:
|
1719
|
+
- binding.irb
|
1720
|
+
- Kernel.binding.irb
|
1721
|
+
Byebug:
|
1722
|
+
- byebug
|
1723
|
+
- remote_byebug
|
1724
|
+
- Kernel.byebug
|
1725
|
+
- Kernel.remote_byebug
|
1726
|
+
Capybara:
|
1727
|
+
- page.save_and_open_page
|
1728
|
+
- page.save_and_open_screenshot
|
1729
|
+
- page.save_page
|
1730
|
+
- page.save_screenshot
|
1731
|
+
- save_and_open_page
|
1732
|
+
- save_and_open_screenshot
|
1733
|
+
- save_page
|
1734
|
+
- save_screenshot
|
1735
|
+
debug.rb:
|
1736
|
+
- binding.b
|
1737
|
+
- binding.break
|
1738
|
+
- Kernel.binding.b
|
1739
|
+
- Kernel.binding.break
|
1740
|
+
Pry:
|
1741
|
+
- binding.pry
|
1742
|
+
- binding.remote_pry
|
1743
|
+
- binding.pry_remote
|
1744
|
+
- Kernel.binding.pry
|
1745
|
+
- Kernel.binding.remote_pry
|
1746
|
+
- Kernel.binding.pry_remote
|
1747
|
+
- Pry.rescue
|
1748
|
+
- pry
|
1749
|
+
Rails:
|
1750
|
+
- debugger
|
1751
|
+
- Kernel.debugger
|
1752
|
+
RubyJard:
|
1753
|
+
- jard
|
1754
|
+
WebConsole:
|
1755
|
+
- binding.console
|
1756
|
+
DebuggerRequires:
|
1757
|
+
debug.rb:
|
1758
|
+
- debug/open
|
1759
|
+
- debug/start
|
1418
1760
|
|
1419
1761
|
Lint/DeprecatedClassMethods:
|
1420
|
-
Description: '
|
1762
|
+
Description: 'Checks for deprecated class method calls.'
|
1421
1763
|
Enabled: true
|
1422
1764
|
VersionAdded: '0.19'
|
1423
1765
|
|
1766
|
+
Lint/DeprecatedConstants:
|
1767
|
+
Description: 'Checks for deprecated constants.'
|
1768
|
+
Enabled: pending
|
1769
|
+
VersionAdded: '1.8'
|
1770
|
+
VersionChanged: '1.40'
|
1771
|
+
# You can configure deprecated constants.
|
1772
|
+
# If there is an alternative method, you can set alternative value as `Alternative`.
|
1773
|
+
# And you can set the deprecated version as `DeprecatedVersion`.
|
1774
|
+
# These options can be omitted if they are not needed.
|
1775
|
+
#
|
1776
|
+
# DeprecatedConstants:
|
1777
|
+
# 'DEPRECATED_CONSTANT':
|
1778
|
+
# Alternative: 'alternative_value'
|
1779
|
+
# DeprecatedVersion: 'deprecated_version'
|
1780
|
+
#
|
1781
|
+
DeprecatedConstants:
|
1782
|
+
'NIL':
|
1783
|
+
Alternative: 'nil'
|
1784
|
+
DeprecatedVersion: '2.4'
|
1785
|
+
'TRUE':
|
1786
|
+
Alternative: 'true'
|
1787
|
+
DeprecatedVersion: '2.4'
|
1788
|
+
'FALSE':
|
1789
|
+
Alternative: 'false'
|
1790
|
+
DeprecatedVersion: '2.4'
|
1791
|
+
'Net::HTTPServerException':
|
1792
|
+
Alternative: 'Net::HTTPClientException'
|
1793
|
+
DeprecatedVersion: '2.6'
|
1794
|
+
'Random::DEFAULT':
|
1795
|
+
Alternative: 'Random.new'
|
1796
|
+
DeprecatedVersion: '3.0'
|
1797
|
+
'Struct::Group':
|
1798
|
+
Alternative: 'Etc::Group'
|
1799
|
+
DeprecatedVersion: '3.0'
|
1800
|
+
'Struct::Passwd':
|
1801
|
+
Alternative: 'Etc::Passwd'
|
1802
|
+
DeprecatedVersion: '3.0'
|
1803
|
+
|
1424
1804
|
Lint/DeprecatedOpenSSLConstant:
|
1425
1805
|
Description: "Don't use algorithm constants for `OpenSSL::Cipher` and `OpenSSL::Digest`."
|
1426
|
-
Enabled:
|
1806
|
+
Enabled: true
|
1427
1807
|
VersionAdded: '0.84'
|
1428
1808
|
|
1429
1809
|
Lint/DisjunctiveAssignmentInConstructor:
|
@@ -1433,6 +1813,15 @@ Lint/DisjunctiveAssignmentInConstructor:
|
|
1433
1813
|
VersionAdded: '0.62'
|
1434
1814
|
VersionChanged: '0.88'
|
1435
1815
|
|
1816
|
+
Lint/DuplicateBranch:
|
1817
|
+
Description: Checks that there are no repeated bodies within `if/unless`, `case-when` and `rescue` constructs.
|
1818
|
+
Enabled: pending
|
1819
|
+
VersionAdded: '1.3'
|
1820
|
+
VersionChanged: '1.7'
|
1821
|
+
IgnoreLiteralBranches: false
|
1822
|
+
IgnoreConstantBranches: false
|
1823
|
+
IgnoreDuplicateElseBranch: false
|
1824
|
+
|
1436
1825
|
Lint/DuplicateCaseCondition:
|
1437
1826
|
Description: 'Do not repeat values in case conditionals.'
|
1438
1827
|
Enabled: true
|
@@ -1440,51 +1829,91 @@ Lint/DuplicateCaseCondition:
|
|
1440
1829
|
|
1441
1830
|
Lint/DuplicateElsifCondition:
|
1442
1831
|
Description: 'Do not repeat conditions used in if `elsif`.'
|
1443
|
-
Enabled:
|
1832
|
+
Enabled: true
|
1444
1833
|
VersionAdded: '0.88'
|
1445
1834
|
|
1446
1835
|
Lint/DuplicateHashKey:
|
1447
|
-
Description: '
|
1836
|
+
Description: 'Checks for duplicate keys in hash literals.'
|
1448
1837
|
Enabled: true
|
1449
1838
|
VersionAdded: '0.34'
|
1450
1839
|
VersionChanged: '0.77'
|
1451
1840
|
|
1841
|
+
Lint/DuplicateMagicComment:
|
1842
|
+
Description: 'Checks for duplicated magic comments.'
|
1843
|
+
Enabled: pending
|
1844
|
+
VersionAdded: '1.37'
|
1845
|
+
|
1846
|
+
Lint/DuplicateMatchPattern:
|
1847
|
+
Description: 'Do not repeat patterns in `in` keywords.'
|
1848
|
+
Enabled: pending
|
1849
|
+
VersionAdded: '1.50'
|
1850
|
+
|
1452
1851
|
Lint/DuplicateMethods:
|
1453
|
-
Description: '
|
1852
|
+
Description: 'Checks for duplicate method definitions.'
|
1454
1853
|
Enabled: true
|
1455
1854
|
VersionAdded: '0.29'
|
1456
1855
|
|
1457
|
-
Lint/
|
1458
|
-
Description: '
|
1856
|
+
Lint/DuplicateRegexpCharacterClassElement:
|
1857
|
+
Description: 'Checks for duplicate elements in Regexp character classes.'
|
1459
1858
|
Enabled: pending
|
1859
|
+
VersionAdded: '1.1'
|
1860
|
+
|
1861
|
+
Lint/DuplicateRequire:
|
1862
|
+
Description: 'Checks for duplicate `require`s and `require_relative`s.'
|
1863
|
+
Enabled: true
|
1864
|
+
SafeAutoCorrect: false
|
1460
1865
|
VersionAdded: '0.90'
|
1866
|
+
VersionChanged: '1.28'
|
1461
1867
|
|
1462
1868
|
Lint/DuplicateRescueException:
|
1463
1869
|
Description: 'Checks that there are no repeated exceptions used in `rescue` expressions.'
|
1464
|
-
Enabled:
|
1870
|
+
Enabled: true
|
1465
1871
|
VersionAdded: '0.89'
|
1466
1872
|
|
1873
|
+
Lint/DuplicateSetElement:
|
1874
|
+
Description: 'Checks for duplicate elements in Set.'
|
1875
|
+
Enabled: pending
|
1876
|
+
VersionAdded: '1.67'
|
1877
|
+
|
1467
1878
|
Lint/EachWithObjectArgument:
|
1468
|
-
Description: '
|
1879
|
+
Description: 'Checks for immutable argument given to each_with_object.'
|
1469
1880
|
Enabled: true
|
1470
1881
|
VersionAdded: '0.31'
|
1471
1882
|
|
1472
1883
|
Lint/ElseLayout:
|
1473
|
-
Description: '
|
1884
|
+
Description: 'Checks for odd code arrangement in an else block.'
|
1474
1885
|
Enabled: true
|
1475
1886
|
VersionAdded: '0.17'
|
1887
|
+
VersionChanged: '1.2'
|
1888
|
+
|
1889
|
+
Lint/EmptyBlock:
|
1890
|
+
Description: 'Checks for blocks without a body.'
|
1891
|
+
Enabled: pending
|
1892
|
+
VersionAdded: '1.1'
|
1893
|
+
VersionChanged: '1.15'
|
1894
|
+
AllowComments: true
|
1895
|
+
AllowEmptyLambdas: true
|
1896
|
+
|
1897
|
+
Lint/EmptyClass:
|
1898
|
+
Description: 'Checks for classes and metaclasses without a body.'
|
1899
|
+
Enabled: pending
|
1900
|
+
VersionAdded: '1.3'
|
1901
|
+
AllowComments: false
|
1476
1902
|
|
1477
1903
|
Lint/EmptyConditionalBody:
|
1478
|
-
Description: '
|
1479
|
-
Enabled:
|
1904
|
+
Description: 'Checks for the presence of `if`, `elsif` and `unless` branches without a body.'
|
1905
|
+
Enabled: true
|
1906
|
+
AutoCorrect: contextual
|
1480
1907
|
AllowComments: true
|
1481
1908
|
VersionAdded: '0.89'
|
1909
|
+
VersionChanged: '1.73'
|
1482
1910
|
|
1483
1911
|
Lint/EmptyEnsure:
|
1484
1912
|
Description: 'Checks for empty ensure block.'
|
1485
1913
|
Enabled: true
|
1914
|
+
AutoCorrect: contextual
|
1486
1915
|
VersionAdded: '0.10'
|
1487
|
-
VersionChanged: '
|
1916
|
+
VersionChanged: '1.61'
|
1488
1917
|
|
1489
1918
|
Lint/EmptyExpression:
|
1490
1919
|
Description: 'Checks for empty expressions.'
|
@@ -1493,15 +1922,22 @@ Lint/EmptyExpression:
|
|
1493
1922
|
|
1494
1923
|
Lint/EmptyFile:
|
1495
1924
|
Description: 'Enforces that Ruby source files are not empty.'
|
1496
|
-
Enabled:
|
1925
|
+
Enabled: true
|
1497
1926
|
AllowComments: true
|
1498
1927
|
VersionAdded: '0.90'
|
1499
1928
|
|
1929
|
+
Lint/EmptyInPattern:
|
1930
|
+
Description: 'Checks for the presence of `in` pattern branches without a body.'
|
1931
|
+
Enabled: pending
|
1932
|
+
AllowComments: true
|
1933
|
+
VersionAdded: '1.16'
|
1934
|
+
|
1500
1935
|
Lint/EmptyInterpolation:
|
1501
1936
|
Description: 'Checks for empty string interpolation.'
|
1502
1937
|
Enabled: true
|
1938
|
+
AutoCorrect: contextual
|
1503
1939
|
VersionAdded: '0.20'
|
1504
|
-
VersionChanged: '
|
1940
|
+
VersionChanged: '1.76'
|
1505
1941
|
|
1506
1942
|
Lint/EmptyWhen:
|
1507
1943
|
Description: 'Checks for `when` branches with empty bodies.'
|
@@ -1531,7 +1967,7 @@ Lint/FlipFlop:
|
|
1531
1967
|
Lint/FloatComparison:
|
1532
1968
|
Description: 'Checks for the presence of precise comparison of floating point numbers.'
|
1533
1969
|
StyleGuide: '#float-comparison'
|
1534
|
-
Enabled:
|
1970
|
+
Enabled: true
|
1535
1971
|
VersionAdded: '0.89'
|
1536
1972
|
|
1537
1973
|
Lint/FloatOutOfRange:
|
@@ -1549,10 +1985,15 @@ Lint/FormatParameterMismatch:
|
|
1549
1985
|
Lint/HashCompareByIdentity:
|
1550
1986
|
Description: 'Prefer using `Hash#compare_by_identity` than using `object_id` for keys.'
|
1551
1987
|
StyleGuide: '#identity-comparison'
|
1552
|
-
Enabled:
|
1988
|
+
Enabled: true
|
1553
1989
|
Safe: false
|
1554
1990
|
VersionAdded: '0.93'
|
1555
1991
|
|
1992
|
+
Lint/HashNewWithKeywordArgumentsAsDefault:
|
1993
|
+
Description: 'Checks for the deprecated use of keyword arguments for hash default in `Hash.new`.'
|
1994
|
+
Enabled: pending
|
1995
|
+
VersionAdded: '1.69'
|
1996
|
+
|
1556
1997
|
Lint/HeredocMethodCallPosition:
|
1557
1998
|
Description: >-
|
1558
1999
|
Checks for the ordering of a method call where
|
@@ -1563,7 +2004,7 @@ Lint/HeredocMethodCallPosition:
|
|
1563
2004
|
|
1564
2005
|
Lint/IdentityComparison:
|
1565
2006
|
Description: 'Prefer `equal?` over `==` when comparing `object_id`.'
|
1566
|
-
Enabled:
|
2007
|
+
Enabled: true
|
1567
2008
|
StyleGuide: '#identity-comparison'
|
1568
2009
|
VersionAdded: '0.91'
|
1569
2010
|
|
@@ -1574,6 +2015,13 @@ Lint/ImplicitStringConcatenation:
|
|
1574
2015
|
Enabled: true
|
1575
2016
|
VersionAdded: '0.36'
|
1576
2017
|
|
2018
|
+
Lint/IncompatibleIoSelectWithFiberScheduler:
|
2019
|
+
Description: 'Checks for `IO.select` that is incompatible with Fiber Scheduler.'
|
2020
|
+
Enabled: pending
|
2021
|
+
SafeAutoCorrect: false
|
2022
|
+
VersionAdded: '1.21'
|
2023
|
+
VersionChanged: '1.24'
|
2024
|
+
|
1577
2025
|
Lint/IneffectiveAccessModifier:
|
1578
2026
|
Description: >-
|
1579
2027
|
Checks for attempts to use `private` or `protected` to set
|
@@ -1584,25 +2032,45 @@ Lint/IneffectiveAccessModifier:
|
|
1584
2032
|
Lint/InheritException:
|
1585
2033
|
Description: 'Avoid inheriting from the `Exception` class.'
|
1586
2034
|
Enabled: true
|
2035
|
+
SafeAutoCorrect: false
|
1587
2036
|
VersionAdded: '0.41'
|
2037
|
+
VersionChanged: '1.26'
|
1588
2038
|
# The default base class in favour of `Exception`.
|
1589
|
-
EnforcedStyle:
|
2039
|
+
EnforcedStyle: standard_error
|
1590
2040
|
SupportedStyles:
|
1591
|
-
- runtime_error
|
1592
2041
|
- standard_error
|
2042
|
+
- runtime_error
|
1593
2043
|
|
1594
2044
|
Lint/InterpolationCheck:
|
1595
|
-
Description: '
|
2045
|
+
Description: 'Checks for interpolation in a single quoted string.'
|
1596
2046
|
Enabled: true
|
1597
|
-
|
2047
|
+
SafeAutoCorrect: false
|
1598
2048
|
VersionAdded: '0.50'
|
1599
|
-
VersionChanged: '
|
2049
|
+
VersionChanged: '1.40'
|
2050
|
+
|
2051
|
+
Lint/ItWithoutArgumentsInBlock:
|
2052
|
+
Description: 'Checks uses of `it` calls without arguments in block.'
|
2053
|
+
References:
|
2054
|
+
- 'https://bugs.ruby-lang.org/issues/18980'
|
2055
|
+
Enabled: pending
|
2056
|
+
VersionAdded: '1.59'
|
2057
|
+
|
2058
|
+
Lint/LambdaWithoutLiteralBlock:
|
2059
|
+
Description: 'Checks uses of lambda without a literal block.'
|
2060
|
+
Enabled: pending
|
2061
|
+
VersionAdded: '1.8'
|
1600
2062
|
|
1601
2063
|
Lint/LiteralAsCondition:
|
1602
2064
|
Description: 'Checks of literals used in conditions.'
|
1603
2065
|
Enabled: true
|
2066
|
+
AutoCorrect: contextual
|
1604
2067
|
VersionAdded: '0.51'
|
1605
2068
|
|
2069
|
+
Lint/LiteralAssignmentInCondition:
|
2070
|
+
Description: 'Checks for literal assignments in the conditions.'
|
2071
|
+
Enabled: pending
|
2072
|
+
VersionAdded: '1.58'
|
2073
|
+
|
1606
2074
|
Lint/LiteralInInterpolation:
|
1607
2075
|
Description: 'Checks for literals used in interpolation.'
|
1608
2076
|
Enabled: true
|
@@ -1616,7 +2084,8 @@ Lint/Loop:
|
|
1616
2084
|
StyleGuide: '#loop-with-break'
|
1617
2085
|
Enabled: true
|
1618
2086
|
VersionAdded: '0.9'
|
1619
|
-
VersionChanged: '
|
2087
|
+
VersionChanged: '1.3'
|
2088
|
+
Safe: false
|
1620
2089
|
|
1621
2090
|
Lint/MissingCopEnableDirective:
|
1622
2091
|
Description: 'Checks for a `# rubocop:enable` after `# rubocop:disable`.'
|
@@ -1633,26 +2102,36 @@ Lint/MissingCopEnableDirective:
|
|
1633
2102
|
|
1634
2103
|
Lint/MissingSuper:
|
1635
2104
|
Description: >-
|
1636
|
-
|
1637
|
-
without calls to `super
|
1638
|
-
Enabled:
|
2105
|
+
Checks for the presence of constructors and lifecycle callbacks
|
2106
|
+
without calls to `super`.
|
2107
|
+
Enabled: true
|
2108
|
+
AllowedParentClasses: []
|
1639
2109
|
VersionAdded: '0.89'
|
2110
|
+
VersionChanged: '1.4'
|
2111
|
+
|
2112
|
+
Lint/MixedCaseRange:
|
2113
|
+
Description: 'Checks for mixed-case character ranges since they include likely unintended characters.'
|
2114
|
+
Enabled: pending
|
2115
|
+
SafeAutoCorrect: false
|
2116
|
+
VersionAdded: '1.53'
|
1640
2117
|
|
1641
2118
|
Lint/MixedRegexpCaptureTypes:
|
1642
2119
|
Description: 'Do not mix named captures and numbered captures in a Regexp literal.'
|
1643
|
-
Enabled:
|
2120
|
+
Enabled: true
|
1644
2121
|
VersionAdded: '0.85'
|
1645
2122
|
|
1646
2123
|
Lint/MultipleComparison:
|
1647
2124
|
Description: "Use `&&` operator to compare multiple values."
|
1648
2125
|
Enabled: true
|
1649
2126
|
VersionAdded: '0.47'
|
1650
|
-
VersionChanged: '
|
2127
|
+
VersionChanged: '1.1'
|
1651
2128
|
|
1652
2129
|
Lint/NestedMethodDefinition:
|
1653
2130
|
Description: 'Do not use nested method definitions.'
|
1654
2131
|
StyleGuide: '#no-nested-methods'
|
1655
2132
|
Enabled: true
|
2133
|
+
AllowedMethods: []
|
2134
|
+
AllowedPatterns: []
|
1656
2135
|
VersionAdded: '0.32'
|
1657
2136
|
|
1658
2137
|
Lint/NestedPercentLiteral:
|
@@ -1661,12 +2140,24 @@ Lint/NestedPercentLiteral:
|
|
1661
2140
|
VersionAdded: '0.52'
|
1662
2141
|
|
1663
2142
|
Lint/NextWithoutAccumulator:
|
1664
|
-
Description:
|
2143
|
+
Description: >-
|
1665
2144
|
Do not omit the accumulator when calling `next`
|
1666
2145
|
in a `reduce`/`inject` block.
|
1667
2146
|
Enabled: true
|
1668
2147
|
VersionAdded: '0.36'
|
1669
2148
|
|
2149
|
+
Lint/NoReturnInBeginEndBlocks:
|
2150
|
+
Description: 'Do not `return` inside `begin..end` blocks in assignment contexts.'
|
2151
|
+
Enabled: pending
|
2152
|
+
VersionAdded: '1.2'
|
2153
|
+
|
2154
|
+
Lint/NonAtomicFileOperation:
|
2155
|
+
Description: Checks for non-atomic file operations.
|
2156
|
+
StyleGuide: '#atomic-file-operations'
|
2157
|
+
Enabled: pending
|
2158
|
+
VersionAdded: '1.31'
|
2159
|
+
SafeAutoCorrect: false
|
2160
|
+
|
1670
2161
|
Lint/NonDeterministicRequireOrder:
|
1671
2162
|
Description: 'Always sort arrays returned by Dir.glob when requiring files.'
|
1672
2163
|
Enabled: true
|
@@ -1682,17 +2173,40 @@ Lint/NumberConversion:
|
|
1682
2173
|
Description: 'Checks unsafe usage of number conversion methods.'
|
1683
2174
|
Enabled: false
|
1684
2175
|
VersionAdded: '0.53'
|
1685
|
-
VersionChanged: '
|
2176
|
+
VersionChanged: '1.1'
|
1686
2177
|
SafeAutoCorrect: false
|
2178
|
+
AllowedMethods: []
|
2179
|
+
AllowedPatterns: []
|
2180
|
+
IgnoredClasses:
|
2181
|
+
- Time
|
2182
|
+
- DateTime
|
2183
|
+
|
2184
|
+
Lint/NumberedParameterAssignment:
|
2185
|
+
Description: 'Checks for uses of numbered parameter assignment.'
|
2186
|
+
Enabled: pending
|
2187
|
+
VersionAdded: '1.9'
|
2188
|
+
|
2189
|
+
Lint/NumericOperationWithConstantResult:
|
2190
|
+
Description: 'Checks for numeric operations with constant results.'
|
2191
|
+
Enabled: pending
|
2192
|
+
VersionAdded: '1.69'
|
2193
|
+
|
2194
|
+
Lint/OrAssignmentToConstant:
|
2195
|
+
Description: 'Checks unintended or-assignment to constant.'
|
2196
|
+
Enabled: pending
|
2197
|
+
Safe: false
|
2198
|
+
VersionAdded: '1.9'
|
1687
2199
|
|
1688
2200
|
Lint/OrderedMagicComments:
|
1689
2201
|
Description: 'Checks the proper ordering of magic comments and whether a magic comment is not placed before a shebang.'
|
1690
2202
|
Enabled: true
|
2203
|
+
SafeAutoCorrect: false
|
1691
2204
|
VersionAdded: '0.53'
|
2205
|
+
VersionChanged: '1.37'
|
1692
2206
|
|
1693
2207
|
Lint/OutOfRangeRegexpRef:
|
1694
2208
|
Description: 'Checks for out of range reference for Regexp because it always returns nil.'
|
1695
|
-
Enabled:
|
2209
|
+
Enabled: true
|
1696
2210
|
Safe: false
|
1697
2211
|
VersionAdded: '0.89'
|
1698
2212
|
|
@@ -1721,7 +2235,7 @@ Lint/PercentSymbolArray:
|
|
1721
2235
|
Lint/RaiseException:
|
1722
2236
|
Description: Checks for `raise` or `fail` statements which are raising `Exception` class.
|
1723
2237
|
StyleGuide: '#raise-exception'
|
1724
|
-
Enabled:
|
2238
|
+
Enabled: true
|
1725
2239
|
Safe: false
|
1726
2240
|
VersionAdded: '0.81'
|
1727
2241
|
VersionChanged: '0.86'
|
@@ -1748,15 +2262,29 @@ Lint/RedundantCopEnableDirective:
|
|
1748
2262
|
Enabled: true
|
1749
2263
|
VersionAdded: '0.76'
|
1750
2264
|
|
2265
|
+
Lint/RedundantDirGlobSort:
|
2266
|
+
Description: 'Checks for redundant `sort` method to `Dir.glob` and `Dir[]`.'
|
2267
|
+
Enabled: pending
|
2268
|
+
VersionAdded: '1.8'
|
2269
|
+
VersionChanged: '1.26'
|
2270
|
+
SafeAutoCorrect: false
|
2271
|
+
|
2272
|
+
Lint/RedundantRegexpQuantifiers:
|
2273
|
+
Description: 'Checks for redundant quantifiers in Regexps.'
|
2274
|
+
Enabled: pending
|
2275
|
+
VersionAdded: '1.53'
|
2276
|
+
|
1751
2277
|
Lint/RedundantRequireStatement:
|
1752
2278
|
Description: 'Checks for unnecessary `require` statement.'
|
1753
2279
|
Enabled: true
|
1754
2280
|
VersionAdded: '0.76'
|
2281
|
+
VersionChanged: '1.73'
|
1755
2282
|
|
1756
2283
|
Lint/RedundantSafeNavigation:
|
1757
2284
|
Description: 'Checks for redundant safe navigation calls.'
|
1758
|
-
Enabled:
|
2285
|
+
Enabled: true
|
1759
2286
|
VersionAdded: '0.93'
|
2287
|
+
VersionChanged: '1.79'
|
1760
2288
|
AllowedMethods:
|
1761
2289
|
- instance_of?
|
1762
2290
|
- kind_of?
|
@@ -1764,12 +2292,20 @@ Lint/RedundantSafeNavigation:
|
|
1764
2292
|
- eql?
|
1765
2293
|
- respond_to?
|
1766
2294
|
- equal?
|
2295
|
+
InferNonNilReceiver: false
|
2296
|
+
AdditionalNilMethods:
|
2297
|
+
- present?
|
2298
|
+
- blank?
|
2299
|
+
- try
|
2300
|
+
- try!
|
1767
2301
|
Safe: false
|
1768
2302
|
|
1769
2303
|
Lint/RedundantSplatExpansion:
|
1770
2304
|
Description: 'Checks for splat unnecessarily being called on literals.'
|
1771
2305
|
Enabled: true
|
1772
2306
|
VersionAdded: '0.76'
|
2307
|
+
VersionChanged: '1.7'
|
2308
|
+
AllowPercentLiteralArrayArgument: true
|
1773
2309
|
|
1774
2310
|
Lint/RedundantStringCoercion:
|
1775
2311
|
Description: 'Checks for Object#to_s usage in string interpolation.'
|
@@ -1778,6 +2314,11 @@ Lint/RedundantStringCoercion:
|
|
1778
2314
|
VersionAdded: '0.19'
|
1779
2315
|
VersionChanged: '0.77'
|
1780
2316
|
|
2317
|
+
Lint/RedundantTypeConversion:
|
2318
|
+
Description: 'Checks for redundantly converting a literal to the same type.'
|
2319
|
+
Enabled: pending
|
2320
|
+
VersionAdded: '1.72'
|
2321
|
+
|
1781
2322
|
Lint/RedundantWithIndex:
|
1782
2323
|
Description: 'Checks for redundant `with_index`.'
|
1783
2324
|
Enabled: true
|
@@ -1788,6 +2329,12 @@ Lint/RedundantWithObject:
|
|
1788
2329
|
Enabled: true
|
1789
2330
|
VersionAdded: '0.51'
|
1790
2331
|
|
2332
|
+
Lint/RefinementImportMethods:
|
2333
|
+
Description: 'Use `Refinement#import_methods` when using `include` or `prepend` in `refine` block.'
|
2334
|
+
Enabled: pending
|
2335
|
+
SafeAutoCorrect: false
|
2336
|
+
VersionAdded: '1.27'
|
2337
|
+
|
1791
2338
|
Lint/RegexpAsCondition:
|
1792
2339
|
Description: >-
|
1793
2340
|
Do not use regexp literal as a condition.
|
@@ -1803,12 +2350,22 @@ Lint/RequireParentheses:
|
|
1803
2350
|
Enabled: true
|
1804
2351
|
VersionAdded: '0.18'
|
1805
2352
|
|
2353
|
+
Lint/RequireRangeParentheses:
|
2354
|
+
Description: 'Checks that a range literal is enclosed in parentheses when the end of the range is at a line break.'
|
2355
|
+
Enabled: pending
|
2356
|
+
VersionAdded: '1.32'
|
2357
|
+
|
2358
|
+
Lint/RequireRelativeSelfPath:
|
2359
|
+
Description: 'Checks for uses a file requiring itself with `require_relative`.'
|
2360
|
+
Enabled: pending
|
2361
|
+
VersionAdded: '1.22'
|
2362
|
+
|
1806
2363
|
Lint/RescueException:
|
1807
2364
|
Description: 'Avoid rescuing the Exception class.'
|
1808
2365
|
StyleGuide: '#no-blind-rescues'
|
1809
2366
|
Enabled: true
|
1810
2367
|
VersionAdded: '0.9'
|
1811
|
-
VersionChanged: '0.27
|
2368
|
+
VersionChanged: '0.27'
|
1812
2369
|
|
1813
2370
|
Lint/RescueType:
|
1814
2371
|
Description: 'Avoid rescuing from non constants that could result in a `TypeError`.'
|
@@ -1835,9 +2392,9 @@ Lint/SafeNavigationChain:
|
|
1835
2392
|
|
1836
2393
|
Lint/SafeNavigationConsistency:
|
1837
2394
|
Description: >-
|
1838
|
-
Check to make sure that if safe navigation is used
|
1839
|
-
|
1840
|
-
for all method calls on
|
2395
|
+
Check to make sure that if safe navigation is used in an `&&` or `||` condition,
|
2396
|
+
consistent and appropriate safe navigation, without excess or deficiency,
|
2397
|
+
is used for all method calls on the same object.
|
1841
2398
|
Enabled: true
|
1842
2399
|
VersionAdded: '0.55'
|
1843
2400
|
VersionChanged: '0.77'
|
@@ -1862,8 +2419,9 @@ Lint/ScriptPermission:
|
|
1862
2419
|
|
1863
2420
|
Lint/SelfAssignment:
|
1864
2421
|
Description: 'Checks for self-assignments.'
|
1865
|
-
Enabled:
|
2422
|
+
Enabled: true
|
1866
2423
|
VersionAdded: '0.89'
|
2424
|
+
AllowRBSInlineAnnotation: false
|
1867
2425
|
|
1868
2426
|
Lint/SendWithMixinArgument:
|
1869
2427
|
Description: 'Checks for `send` method when using mixin.'
|
@@ -1876,7 +2434,6 @@ Lint/ShadowedArgument:
|
|
1876
2434
|
VersionAdded: '0.52'
|
1877
2435
|
IgnoreImplicitReferences: false
|
1878
2436
|
|
1879
|
-
|
1880
2437
|
Lint/ShadowedException:
|
1881
2438
|
Description: >-
|
1882
2439
|
Avoid rescuing a higher level exception
|
@@ -1888,12 +2445,19 @@ Lint/ShadowingOuterLocalVariable:
|
|
1888
2445
|
Description: >-
|
1889
2446
|
Do not use the same name as outer local variable
|
1890
2447
|
for block arguments or block local variables.
|
1891
|
-
Enabled:
|
2448
|
+
Enabled: false
|
1892
2449
|
VersionAdded: '0.9'
|
2450
|
+
VersionChanged: '1.76'
|
2451
|
+
|
2452
|
+
Lint/SharedMutableDefault:
|
2453
|
+
Description: 'Checks for mutable literals used as default arguments during Hash initialization.'
|
2454
|
+
StyleGuide: '#no-mutable-defaults'
|
2455
|
+
Enabled: pending
|
2456
|
+
VersionAdded: '1.70'
|
1893
2457
|
|
1894
2458
|
Lint/StructNewOverride:
|
1895
2459
|
Description: 'Disallow overriding the `Struct` built-in methods via `Struct.new`.'
|
1896
|
-
Enabled:
|
2460
|
+
Enabled: true
|
1897
2461
|
VersionAdded: '0.81'
|
1898
2462
|
|
1899
2463
|
Lint/SuppressedException:
|
@@ -1901,14 +2465,35 @@ Lint/SuppressedException:
|
|
1901
2465
|
StyleGuide: '#dont-hide-exceptions'
|
1902
2466
|
Enabled: true
|
1903
2467
|
AllowComments: true
|
2468
|
+
AllowNil: true
|
1904
2469
|
VersionAdded: '0.9'
|
1905
|
-
VersionChanged: '
|
2470
|
+
VersionChanged: '1.12'
|
1906
2471
|
|
1907
|
-
Lint/
|
1908
|
-
Description: 'Checks
|
1909
|
-
Enabled:
|
1910
|
-
|
2472
|
+
Lint/SuppressedExceptionInNumberConversion:
|
2473
|
+
Description: 'Checks for cases where exceptions unrelated to the numeric constructors may be unintentionally swallowed.'
|
2474
|
+
Enabled: pending
|
2475
|
+
SafeAutoCorrect: false
|
2476
|
+
VersionAdded: '1.72'
|
2477
|
+
|
2478
|
+
Lint/SymbolConversion:
|
2479
|
+
Description: 'Checks for unnecessary symbol conversions.'
|
2480
|
+
Enabled: pending
|
2481
|
+
VersionAdded: '1.9'
|
2482
|
+
VersionChanged: '1.16'
|
2483
|
+
EnforcedStyle: strict
|
2484
|
+
SupportedStyles:
|
2485
|
+
- strict
|
2486
|
+
- consistent
|
1911
2487
|
|
2488
|
+
Lint/Syntax:
|
2489
|
+
Description: 'Checks for syntax errors.'
|
2490
|
+
Enabled: true
|
2491
|
+
VersionAdded: '0.9'
|
2492
|
+
|
2493
|
+
Lint/ToEnumArguments:
|
2494
|
+
Description: 'Ensures that `to_enum`/`enum_for`, called for the current method, has correct arguments.'
|
2495
|
+
Enabled: pending
|
2496
|
+
VersionAdded: '1.1'
|
1912
2497
|
|
1913
2498
|
Lint/ToJSON:
|
1914
2499
|
Description: 'Ensure #to_json includes an optional argument.'
|
@@ -1916,14 +2501,24 @@ Lint/ToJSON:
|
|
1916
2501
|
VersionAdded: '0.66'
|
1917
2502
|
|
1918
2503
|
Lint/TopLevelReturnWithArgument:
|
1919
|
-
Description: '
|
1920
|
-
Enabled:
|
2504
|
+
Description: 'Detects top level return statements with argument.'
|
2505
|
+
Enabled: true
|
1921
2506
|
VersionAdded: '0.89'
|
2507
|
+
# These codes are `eval`-ed in method and their return values may be used.
|
2508
|
+
Exclude:
|
2509
|
+
- '**/*.jb'
|
1922
2510
|
|
1923
2511
|
Lint/TrailingCommaInAttributeDeclaration:
|
1924
|
-
Description: '
|
1925
|
-
Enabled:
|
2512
|
+
Description: 'Checks for trailing commas in attribute declarations.'
|
2513
|
+
Enabled: true
|
2514
|
+
AutoCorrect: contextual
|
1926
2515
|
VersionAdded: '0.90'
|
2516
|
+
VersionChanged: '1.61'
|
2517
|
+
|
2518
|
+
Lint/TripleQuotes:
|
2519
|
+
Description: 'Checks for useless triple quote constructs.'
|
2520
|
+
Enabled: pending
|
2521
|
+
VersionAdded: '1.9'
|
1927
2522
|
|
1928
2523
|
Lint/UnderscorePrefixedVariableName:
|
1929
2524
|
Description: 'Do not use prefix `_` for a variable that is used.'
|
@@ -1931,27 +2526,61 @@ Lint/UnderscorePrefixedVariableName:
|
|
1931
2526
|
VersionAdded: '0.21'
|
1932
2527
|
AllowKeywordBlockArguments: false
|
1933
2528
|
|
2529
|
+
Lint/UnescapedBracketInRegexp:
|
2530
|
+
Description: 'Checks for unescaped literal `]` in Regexp.'
|
2531
|
+
Enabled: pending
|
2532
|
+
VersionAdded: '1.68'
|
2533
|
+
|
2534
|
+
Lint/UnexpectedBlockArity:
|
2535
|
+
Description: 'Looks for blocks that have fewer arguments that the calling method expects.'
|
2536
|
+
Enabled: pending
|
2537
|
+
Safe: false
|
2538
|
+
VersionAdded: '1.5'
|
2539
|
+
Methods:
|
2540
|
+
chunk_while: 2
|
2541
|
+
each_with_index: 2
|
2542
|
+
each_with_object: 2
|
2543
|
+
inject: 2
|
2544
|
+
max: 2
|
2545
|
+
min: 2
|
2546
|
+
minmax: 2
|
2547
|
+
reduce: 2
|
2548
|
+
slice_when: 2
|
2549
|
+
sort: 2
|
2550
|
+
|
1934
2551
|
Lint/UnifiedInteger:
|
1935
2552
|
Description: 'Use Integer instead of Fixnum or Bignum.'
|
1936
2553
|
Enabled: true
|
1937
2554
|
VersionAdded: '0.43'
|
1938
2555
|
|
2556
|
+
Lint/UnmodifiedReduceAccumulator:
|
2557
|
+
Description: Checks for `reduce` or `inject` blocks that do not update the accumulator each iteration.
|
2558
|
+
Enabled: pending
|
2559
|
+
VersionAdded: '1.1'
|
2560
|
+
VersionChanged: '1.5'
|
2561
|
+
|
1939
2562
|
Lint/UnreachableCode:
|
1940
2563
|
Description: 'Unreachable code.'
|
1941
2564
|
Enabled: true
|
1942
2565
|
VersionAdded: '0.9'
|
1943
2566
|
|
1944
2567
|
Lint/UnreachableLoop:
|
1945
|
-
Description: '
|
1946
|
-
Enabled:
|
2568
|
+
Description: 'Checks for loops that will have at most one iteration.'
|
2569
|
+
Enabled: true
|
1947
2570
|
VersionAdded: '0.89'
|
2571
|
+
VersionChanged: '1.7'
|
2572
|
+
AllowedPatterns:
|
2573
|
+
# RSpec uses `times` in its message expectations
|
2574
|
+
# eg. `exactly(2).times`
|
2575
|
+
- !ruby/regexp /(exactly|at_least|at_most)\(\d+\)\.times/
|
1948
2576
|
|
1949
2577
|
Lint/UnusedBlockArgument:
|
1950
2578
|
Description: 'Checks for unused block arguments.'
|
1951
2579
|
StyleGuide: '#underscore-unused-vars'
|
1952
2580
|
Enabled: true
|
2581
|
+
AutoCorrect: contextual
|
1953
2582
|
VersionAdded: '0.21'
|
1954
|
-
VersionChanged: '
|
2583
|
+
VersionChanged: '1.61'
|
1955
2584
|
IgnoreEmptyBlocks: true
|
1956
2585
|
AllowUnusedKeywordArguments: false
|
1957
2586
|
|
@@ -1959,11 +2588,14 @@ Lint/UnusedMethodArgument:
|
|
1959
2588
|
Description: 'Checks for unused method arguments.'
|
1960
2589
|
StyleGuide: '#underscore-unused-vars'
|
1961
2590
|
Enabled: true
|
2591
|
+
AutoCorrect: contextual
|
1962
2592
|
VersionAdded: '0.21'
|
1963
|
-
VersionChanged: '
|
2593
|
+
VersionChanged: '1.69'
|
1964
2594
|
AllowUnusedKeywordArguments: false
|
1965
2595
|
IgnoreEmptyMethods: true
|
1966
2596
|
IgnoreNotImplementedMethods: true
|
2597
|
+
NotImplementedExceptions:
|
2598
|
+
- NotImplementedError
|
1967
2599
|
|
1968
2600
|
Lint/UriEscapeUnescape:
|
1969
2601
|
Description: >-
|
@@ -1984,8 +2616,9 @@ Lint/UriRegexp:
|
|
1984
2616
|
Lint/UselessAccessModifier:
|
1985
2617
|
Description: 'Checks for useless access modifiers.'
|
1986
2618
|
Enabled: true
|
2619
|
+
AutoCorrect: contextual
|
1987
2620
|
VersionAdded: '0.20'
|
1988
|
-
VersionChanged: '
|
2621
|
+
VersionChanged: '1.61'
|
1989
2622
|
ContextCreatingMethods: []
|
1990
2623
|
MethodCreatingMethods: []
|
1991
2624
|
|
@@ -1993,37 +2626,82 @@ Lint/UselessAssignment:
|
|
1993
2626
|
Description: 'Checks for useless assignment to a local variable.'
|
1994
2627
|
StyleGuide: '#underscore-unused-vars'
|
1995
2628
|
Enabled: true
|
2629
|
+
AutoCorrect: contextual
|
1996
2630
|
VersionAdded: '0.11'
|
2631
|
+
VersionChanged: '1.66'
|
2632
|
+
|
2633
|
+
Lint/UselessConstantScoping:
|
2634
|
+
Description: 'Checks for useless constant scoping.'
|
2635
|
+
Enabled: pending
|
2636
|
+
VersionAdded: '1.72'
|
2637
|
+
|
2638
|
+
Lint/UselessDefaultValueArgument:
|
2639
|
+
Description: 'Checks for usage of `fetch` or `Array.new` with default value argument and block.'
|
2640
|
+
Enabled: pending
|
2641
|
+
VersionAdded: '1.76'
|
2642
|
+
Safe: false
|
2643
|
+
AllowedReceivers: []
|
2644
|
+
|
2645
|
+
Lint/UselessDefined:
|
2646
|
+
Description: 'Checks for calls to `defined?` with strings and symbols. The result of such a call will always be truthy.'
|
2647
|
+
Enabled: pending
|
2648
|
+
VersionAdded: '1.69'
|
1997
2649
|
|
1998
2650
|
Lint/UselessElseWithoutRescue:
|
1999
2651
|
Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
|
2000
2652
|
Enabled: true
|
2001
2653
|
VersionAdded: '0.17'
|
2654
|
+
VersionChanged: '1.31'
|
2002
2655
|
|
2003
2656
|
Lint/UselessMethodDefinition:
|
2004
2657
|
Description: 'Checks for useless method definitions.'
|
2005
|
-
Enabled:
|
2658
|
+
Enabled: true
|
2659
|
+
AutoCorrect: contextual
|
2006
2660
|
VersionAdded: '0.90'
|
2661
|
+
VersionChanged: '1.61'
|
2007
2662
|
Safe: false
|
2008
|
-
|
2663
|
+
|
2664
|
+
Lint/UselessNumericOperation:
|
2665
|
+
Description: 'Checks for useless numeric operations.'
|
2666
|
+
Enabled: pending
|
2667
|
+
VersionAdded: '1.66'
|
2668
|
+
|
2669
|
+
Lint/UselessOr:
|
2670
|
+
Description: 'Checks for useless OR expressions.'
|
2671
|
+
Enabled: pending
|
2672
|
+
VersionAdded: '1.76'
|
2673
|
+
|
2674
|
+
Lint/UselessRescue:
|
2675
|
+
Description: 'Checks for useless `rescue`s.'
|
2676
|
+
Enabled: pending
|
2677
|
+
VersionAdded: '1.43'
|
2678
|
+
|
2679
|
+
Lint/UselessRuby2Keywords:
|
2680
|
+
Description: 'Finds unnecessary uses of `ruby2_keywords`.'
|
2681
|
+
Enabled: pending
|
2682
|
+
VersionAdded: '1.23'
|
2009
2683
|
|
2010
2684
|
Lint/UselessSetterCall:
|
2011
2685
|
Description: 'Checks for useless setter call to a local variable.'
|
2012
2686
|
Enabled: true
|
2013
|
-
VersionAdded: '0.13'
|
2014
|
-
VersionChanged: '0.80'
|
2015
2687
|
Safe: false
|
2688
|
+
VersionAdded: '0.13'
|
2689
|
+
VersionChanged: '1.2'
|
2016
2690
|
|
2017
2691
|
Lint/UselessTimes:
|
2018
2692
|
Description: 'Checks for useless `Integer#times` calls.'
|
2019
|
-
Enabled:
|
2020
|
-
VersionAdded: '0.91'
|
2693
|
+
Enabled: true
|
2021
2694
|
Safe: false
|
2695
|
+
AutoCorrect: contextual
|
2696
|
+
VersionAdded: '0.91'
|
2697
|
+
VersionChanged: '1.61'
|
2022
2698
|
|
2023
2699
|
Lint/Void:
|
2024
2700
|
Description: 'Possible use of operator/literal/variable in void context.'
|
2025
2701
|
Enabled: true
|
2702
|
+
AutoCorrect: contextual
|
2026
2703
|
VersionAdded: '0.9'
|
2704
|
+
VersionChanged: '1.61'
|
2027
2705
|
CheckForMethodsWithNoSideEffects: false
|
2028
2706
|
|
2029
2707
|
#################### Metrics ###############################
|
@@ -2032,29 +2710,32 @@ Metrics/AbcSize:
|
|
2032
2710
|
Description: >-
|
2033
2711
|
A calculated magnitude based on number of assignments,
|
2034
2712
|
branches, and conditions.
|
2035
|
-
|
2036
|
-
-
|
2713
|
+
References:
|
2714
|
+
- https://wiki.c2.com/?AbcMetric
|
2037
2715
|
- https://en.wikipedia.org/wiki/ABC_Software_Metric
|
2038
2716
|
Enabled: true
|
2039
2717
|
VersionAdded: '0.27'
|
2040
|
-
VersionChanged: '
|
2718
|
+
VersionChanged: '1.5'
|
2041
2719
|
# The ABC size is a calculated magnitude, so this number can be an Integer or
|
2042
2720
|
# a Float.
|
2043
|
-
|
2721
|
+
AllowedMethods: []
|
2722
|
+
AllowedPatterns: []
|
2723
|
+
CountRepeatedAttributes: true
|
2044
2724
|
Max: 17
|
2045
2725
|
|
2046
2726
|
Metrics/BlockLength:
|
2047
2727
|
Description: 'Avoid long blocks with many lines.'
|
2048
2728
|
Enabled: true
|
2049
2729
|
VersionAdded: '0.44'
|
2050
|
-
VersionChanged: '
|
2730
|
+
VersionChanged: '1.5'
|
2051
2731
|
CountComments: false # count full line comments?
|
2052
2732
|
Max: 25
|
2053
2733
|
CountAsOne: []
|
2054
|
-
|
2734
|
+
AllowedMethods:
|
2055
2735
|
# By default, exclude the `#refine` method, as it tends to have larger
|
2056
2736
|
# associated blocks.
|
2057
2737
|
- refine
|
2738
|
+
AllowedPatterns: []
|
2058
2739
|
Exclude:
|
2059
2740
|
- '**/*.gemspec'
|
2060
2741
|
|
@@ -2063,8 +2744,9 @@ Metrics/BlockNesting:
|
|
2063
2744
|
StyleGuide: '#three-is-the-number-thou-shalt-count'
|
2064
2745
|
Enabled: true
|
2065
2746
|
VersionAdded: '0.25'
|
2066
|
-
VersionChanged: '
|
2747
|
+
VersionChanged: '1.65'
|
2067
2748
|
CountBlocks: false
|
2749
|
+
CountModifierForms: false
|
2068
2750
|
Max: 3
|
2069
2751
|
|
2070
2752
|
Metrics/ClassLength:
|
@@ -2076,6 +2758,12 @@ Metrics/ClassLength:
|
|
2076
2758
|
Max: 100
|
2077
2759
|
CountAsOne: []
|
2078
2760
|
|
2761
|
+
Metrics/CollectionLiteralLength:
|
2762
|
+
Description: 'Checks for `Array` or `Hash` literals with many entries.'
|
2763
|
+
Enabled: pending
|
2764
|
+
VersionAdded: '1.47'
|
2765
|
+
LengthThreshold: 250
|
2766
|
+
|
2079
2767
|
# Avoid complex methods.
|
2080
2768
|
Metrics/CyclomaticComplexity:
|
2081
2769
|
Description: >-
|
@@ -2084,7 +2772,8 @@ Metrics/CyclomaticComplexity:
|
|
2084
2772
|
Enabled: true
|
2085
2773
|
VersionAdded: '0.25'
|
2086
2774
|
VersionChanged: '0.81'
|
2087
|
-
|
2775
|
+
AllowedMethods: []
|
2776
|
+
AllowedPatterns: []
|
2088
2777
|
Max: 7
|
2089
2778
|
|
2090
2779
|
Metrics/MethodLength:
|
@@ -2092,11 +2781,12 @@ Metrics/MethodLength:
|
|
2092
2781
|
StyleGuide: '#short-methods'
|
2093
2782
|
Enabled: true
|
2094
2783
|
VersionAdded: '0.25'
|
2095
|
-
VersionChanged: '
|
2784
|
+
VersionChanged: '1.5'
|
2096
2785
|
CountComments: false # count full line comments?
|
2097
2786
|
Max: 10
|
2098
2787
|
CountAsOne: []
|
2099
|
-
|
2788
|
+
AllowedMethods: []
|
2789
|
+
AllowedPatterns: []
|
2100
2790
|
|
2101
2791
|
Metrics/ModuleLength:
|
2102
2792
|
Description: 'Avoid modules longer than 100 lines of code.'
|
@@ -2112,8 +2802,10 @@ Metrics/ParameterLists:
|
|
2112
2802
|
StyleGuide: '#too-many-params'
|
2113
2803
|
Enabled: true
|
2114
2804
|
VersionAdded: '0.25'
|
2805
|
+
VersionChanged: '1.5'
|
2115
2806
|
Max: 5
|
2116
2807
|
CountKeywordArgs: true
|
2808
|
+
MaxOptionalParameters: 3
|
2117
2809
|
|
2118
2810
|
Metrics/PerceivedComplexity:
|
2119
2811
|
Description: >-
|
@@ -2122,7 +2814,8 @@ Metrics/PerceivedComplexity:
|
|
2122
2814
|
Enabled: true
|
2123
2815
|
VersionAdded: '0.25'
|
2124
2816
|
VersionChanged: '0.81'
|
2125
|
-
|
2817
|
+
AllowedMethods: []
|
2818
|
+
AllowedPatterns: []
|
2126
2819
|
Max: 8
|
2127
2820
|
|
2128
2821
|
################## Migration #############################
|
@@ -2137,7 +2830,7 @@ Migration/DepartmentName:
|
|
2137
2830
|
#################### Naming ##############################
|
2138
2831
|
|
2139
2832
|
Naming/AccessorMethodName:
|
2140
|
-
Description:
|
2833
|
+
Description: Checks the naming of accessor methods for get_/set_.
|
2141
2834
|
StyleGuide: '#accessor_mutator_method_names'
|
2142
2835
|
Enabled: true
|
2143
2836
|
VersionAdded: '0.50'
|
@@ -2155,6 +2848,18 @@ Naming/BinaryOperatorParameterName:
|
|
2155
2848
|
StyleGuide: '#other-arg'
|
2156
2849
|
Enabled: true
|
2157
2850
|
VersionAdded: '0.50'
|
2851
|
+
VersionChanged: '1.2'
|
2852
|
+
|
2853
|
+
Naming/BlockForwarding:
|
2854
|
+
Description: 'Use anonymous block forwarding.'
|
2855
|
+
StyleGuide: '#block-forwarding'
|
2856
|
+
Enabled: pending
|
2857
|
+
VersionAdded: '1.24'
|
2858
|
+
EnforcedStyle: anonymous
|
2859
|
+
SupportedStyles:
|
2860
|
+
- anonymous
|
2861
|
+
- explicit
|
2862
|
+
BlockForwardingName: block
|
2158
2863
|
|
2159
2864
|
Naming/BlockParameterName:
|
2160
2865
|
Description: >-
|
@@ -2193,9 +2898,11 @@ Naming/FileName:
|
|
2193
2898
|
StyleGuide: '#snake-case-files'
|
2194
2899
|
Enabled: true
|
2195
2900
|
VersionAdded: '0.50'
|
2901
|
+
VersionChanged: '1.23'
|
2196
2902
|
# Camel case file names listed in `AllCops:Include` and all file names listed
|
2197
2903
|
# in `AllCops:Exclude` are excluded by default. Add extra excludes here.
|
2198
|
-
Exclude:
|
2904
|
+
Exclude:
|
2905
|
+
- Rakefile.rb
|
2199
2906
|
# When `true`, requires that each source file should define a class or module
|
2200
2907
|
# with a name which matches the file name (converted to ... case).
|
2201
2908
|
# It further expects it to be nested inside modules which match the names
|
@@ -2205,6 +2912,13 @@ Naming/FileName:
|
|
2205
2912
|
# whether each source file's class or module name matches the file name --
|
2206
2913
|
# not whether the nested module hierarchy matches the subdirectory path.
|
2207
2914
|
CheckDefinitionPathHierarchy: true
|
2915
|
+
# paths that are considered root directories, for example "lib" in most ruby projects
|
2916
|
+
# or "app/models" in rails projects
|
2917
|
+
CheckDefinitionPathHierarchyRoots:
|
2918
|
+
- lib
|
2919
|
+
- spec
|
2920
|
+
- test
|
2921
|
+
- src
|
2208
2922
|
# If non-`nil`, expect all source file names to match the following regex.
|
2209
2923
|
# Only the file name itself is matched, not the entire file path.
|
2210
2924
|
# Use anchors as necessary if you want to match the entire name rather than
|
@@ -2261,6 +2975,7 @@ Naming/HeredocDelimiterCase:
|
|
2261
2975
|
StyleGuide: '#heredoc-delimiters'
|
2262
2976
|
Enabled: true
|
2263
2977
|
VersionAdded: '0.50'
|
2978
|
+
VersionChanged: '1.2'
|
2264
2979
|
EnforcedStyle: uppercase
|
2265
2980
|
SupportedStyles:
|
2266
2981
|
- lowercase
|
@@ -2272,36 +2987,69 @@ Naming/HeredocDelimiterNaming:
|
|
2272
2987
|
Enabled: true
|
2273
2988
|
VersionAdded: '0.50'
|
2274
2989
|
ForbiddenDelimiters:
|
2275
|
-
- !ruby/regexp '/(^|\s)(EO[A-Z]{1}|END)(\s|$)/'
|
2990
|
+
- !ruby/regexp '/(^|\s)(EO[A-Z]{1}|END)(\s|$)/i'
|
2991
|
+
|
2992
|
+
Naming/InclusiveLanguage:
|
2993
|
+
Description: 'Recommend the use of inclusive language instead of problematic terms.'
|
2994
|
+
Enabled: false
|
2995
|
+
VersionAdded: '1.18'
|
2996
|
+
VersionChanged: '1.49'
|
2997
|
+
CheckIdentifiers: true
|
2998
|
+
CheckConstants: true
|
2999
|
+
CheckVariables: true
|
3000
|
+
CheckStrings: false
|
3001
|
+
CheckSymbols: true
|
3002
|
+
CheckComments: true
|
3003
|
+
CheckFilepaths: true
|
3004
|
+
FlaggedTerms:
|
3005
|
+
whitelist:
|
3006
|
+
Regex: !ruby/regexp '/white[-_\s]?list/'
|
3007
|
+
Suggestions:
|
3008
|
+
- allowlist
|
3009
|
+
- permit
|
3010
|
+
blacklist:
|
3011
|
+
Regex: !ruby/regexp '/black[-_\s]?list/'
|
3012
|
+
Suggestions:
|
3013
|
+
- denylist
|
3014
|
+
- block
|
3015
|
+
slave:
|
3016
|
+
WholeWord: true
|
3017
|
+
Suggestions: ['replica', 'secondary', 'follower']
|
2276
3018
|
|
2277
3019
|
Naming/MemoizedInstanceVariableName:
|
2278
3020
|
Description: >-
|
2279
3021
|
Memoized method name should match memo instance variable name.
|
2280
3022
|
Enabled: true
|
2281
3023
|
VersionAdded: '0.53'
|
2282
|
-
VersionChanged: '
|
3024
|
+
VersionChanged: '1.2'
|
2283
3025
|
EnforcedStyleForLeadingUnderscores: disallowed
|
2284
3026
|
SupportedStylesForLeadingUnderscores:
|
2285
3027
|
- disallowed
|
2286
3028
|
- required
|
2287
3029
|
- optional
|
3030
|
+
Safe: false
|
2288
3031
|
|
2289
3032
|
Naming/MethodName:
|
2290
3033
|
Description: 'Use the configured style when naming methods.'
|
2291
3034
|
StyleGuide: '#snake-case-symbols-methods-vars'
|
2292
3035
|
Enabled: true
|
2293
3036
|
VersionAdded: '0.50'
|
3037
|
+
VersionChanged: '1.75'
|
2294
3038
|
EnforcedStyle: snake_case
|
2295
3039
|
SupportedStyles:
|
2296
3040
|
- snake_case
|
2297
3041
|
- camelCase
|
2298
3042
|
# Method names matching patterns are always allowed.
|
2299
3043
|
#
|
2300
|
-
#
|
3044
|
+
# AllowedPatterns:
|
2301
3045
|
# - '\A\s*onSelectionBulkChange\s*'
|
2302
3046
|
# - '\A\s*onSelectionCleared\s*'
|
2303
3047
|
#
|
2304
|
-
|
3048
|
+
AllowedPatterns: []
|
3049
|
+
ForbiddenIdentifiers:
|
3050
|
+
- __id__
|
3051
|
+
- __send__
|
3052
|
+
ForbiddenPatterns: []
|
2305
3053
|
|
2306
3054
|
Naming/MethodParameterName:
|
2307
3055
|
Description: >-
|
@@ -2315,10 +3063,13 @@ Naming/MethodParameterName:
|
|
2315
3063
|
AllowNamesEndingInNumbers: true
|
2316
3064
|
# Allowed names that will not register an offense
|
2317
3065
|
AllowedNames:
|
3066
|
+
- as
|
2318
3067
|
- at
|
2319
3068
|
- by
|
3069
|
+
- cc
|
2320
3070
|
- db
|
2321
3071
|
- id
|
3072
|
+
- if
|
2322
3073
|
- in
|
2323
3074
|
- io
|
2324
3075
|
- ip
|
@@ -2330,22 +3081,42 @@ Naming/MethodParameterName:
|
|
2330
3081
|
# Forbidden names that will register an offense
|
2331
3082
|
ForbiddenNames: []
|
2332
3083
|
|
2333
|
-
Naming/
|
2334
|
-
Description: '
|
3084
|
+
Naming/PredicateMethod:
|
3085
|
+
Description: 'Checks that predicate methods end with `?` and non-predicate methods do not.'
|
3086
|
+
Enabled: pending
|
3087
|
+
VersionAdded: '1.76'
|
3088
|
+
VersionChanged: '1.78'
|
3089
|
+
# In `aggressive` mode, the cop will register an offense for predicate methods that
|
3090
|
+
# may return a non-boolean value.
|
3091
|
+
# In `conservative` mode, the cop will *not* register an offense for predicate methods
|
3092
|
+
# that may return a non-boolean value.
|
3093
|
+
Mode: conservative
|
3094
|
+
AllowedMethods:
|
3095
|
+
- call
|
3096
|
+
AllowedPatterns: []
|
3097
|
+
AllowBangMethods: false
|
3098
|
+
# Methods that are known to not return a boolean value, despite ending in `?`.
|
3099
|
+
WaywardPredicates:
|
3100
|
+
- nonzero?
|
3101
|
+
|
3102
|
+
Naming/PredicatePrefix:
|
3103
|
+
Description: 'Predicate method names should not be prefixed and end with a `?`.'
|
2335
3104
|
StyleGuide: '#bool-methods-qmark'
|
2336
3105
|
Enabled: true
|
2337
3106
|
VersionAdded: '0.50'
|
2338
|
-
VersionChanged: '
|
3107
|
+
VersionChanged: '1.75'
|
2339
3108
|
# Predicate name prefixes.
|
2340
3109
|
NamePrefix:
|
2341
3110
|
- is_
|
2342
3111
|
- has_
|
2343
3112
|
- have_
|
3113
|
+
- does_
|
2344
3114
|
# Predicate name prefixes that should be removed.
|
2345
3115
|
ForbiddenPrefixes:
|
2346
3116
|
- is_
|
2347
3117
|
- has_
|
2348
3118
|
- have_
|
3119
|
+
- does_
|
2349
3120
|
# Predicate names which, despite having a forbidden prefix, or no `?`,
|
2350
3121
|
# should still be accepted
|
2351
3122
|
AllowedMethods:
|
@@ -2354,6 +3125,8 @@ Naming/PredicateName:
|
|
2354
3125
|
MethodDefinitionMacros:
|
2355
3126
|
- define_method
|
2356
3127
|
- define_singleton_method
|
3128
|
+
# Use Sorbet's T::Boolean return type to detect predicate methods.
|
3129
|
+
UseSorbetSigs: false
|
2357
3130
|
# Exclude Rspec specs because there is a strong convention to write spec
|
2358
3131
|
# helpers in the form of `have_something` or `be_something`.
|
2359
3132
|
Exclude:
|
@@ -2371,60 +3144,98 @@ Naming/VariableName:
|
|
2371
3144
|
StyleGuide: '#snake-case-symbols-methods-vars'
|
2372
3145
|
Enabled: true
|
2373
3146
|
VersionAdded: '0.50'
|
3147
|
+
VersionChanged: '1.73'
|
2374
3148
|
EnforcedStyle: snake_case
|
2375
3149
|
SupportedStyles:
|
2376
3150
|
- snake_case
|
2377
3151
|
- camelCase
|
3152
|
+
AllowedIdentifiers: []
|
3153
|
+
AllowedPatterns: []
|
3154
|
+
ForbiddenIdentifiers: []
|
3155
|
+
ForbiddenPatterns: []
|
2378
3156
|
|
2379
3157
|
Naming/VariableNumber:
|
2380
|
-
Description: 'Use the configured style when numbering variables.'
|
3158
|
+
Description: 'Use the configured style when numbering symbols, methods and variables.'
|
3159
|
+
StyleGuide: '#snake-case-symbols-methods-vars-with-numbers'
|
2381
3160
|
Enabled: true
|
2382
3161
|
VersionAdded: '0.50'
|
3162
|
+
VersionChanged: '1.4'
|
2383
3163
|
EnforcedStyle: normalcase
|
2384
3164
|
SupportedStyles:
|
2385
3165
|
- snake_case
|
2386
3166
|
- normalcase
|
2387
3167
|
- non_integer
|
3168
|
+
CheckMethodNames: true
|
3169
|
+
CheckSymbols: true
|
3170
|
+
AllowedIdentifiers:
|
3171
|
+
- TLS1_1 # OpenSSL::SSL::TLS1_1_VERSION
|
3172
|
+
- TLS1_2 # OpenSSL::SSL::TLS1_2_VERSION
|
3173
|
+
- capture3 # Open3.capture3
|
3174
|
+
- iso8601 # Time#iso8601
|
3175
|
+
- rfc1123_date # CGI.rfc1123_date
|
3176
|
+
- rfc822 # Time#rfc822
|
3177
|
+
- rfc2822 # Time#rfc2822
|
3178
|
+
- rfc3339 # DateTime.rfc3339
|
3179
|
+
- x86_64 # Allowed by default as an underscore separated CPU architecture name
|
3180
|
+
AllowedPatterns: []
|
2388
3181
|
|
2389
3182
|
#################### Security ##############################
|
2390
3183
|
|
3184
|
+
Security/CompoundHash:
|
3185
|
+
Description: 'When overwriting Object#hash to combine values, prefer delegating to Array#hash over writing a custom implementation.'
|
3186
|
+
Enabled: pending
|
3187
|
+
Safe: false
|
3188
|
+
VersionAdded: '1.28'
|
3189
|
+
VersionChanged: '1.51'
|
3190
|
+
|
2391
3191
|
Security/Eval:
|
2392
3192
|
Description: 'The use of eval represents a serious security risk.'
|
2393
3193
|
Enabled: true
|
2394
3194
|
VersionAdded: '0.47'
|
2395
3195
|
|
3196
|
+
Security/IoMethods:
|
3197
|
+
Description: >-
|
3198
|
+
Checks for the first argument to `IO.read`, `IO.binread`, `IO.write`, `IO.binwrite`,
|
3199
|
+
`IO.foreach`, and `IO.readlines`.
|
3200
|
+
Enabled: pending
|
3201
|
+
Safe: false
|
3202
|
+
VersionAdded: '1.22'
|
3203
|
+
|
2396
3204
|
Security/JSONLoad:
|
2397
3205
|
Description: >-
|
2398
3206
|
Prefer usage of `JSON.parse` over `JSON.load` due to potential
|
2399
3207
|
security issues. See reference for more information.
|
2400
|
-
|
3208
|
+
References:
|
3209
|
+
- 'https://ruby-doc.org/stdlib-2.7.0/libdoc/json/rdoc/JSON.html#method-i-load'
|
2401
3210
|
Enabled: true
|
2402
3211
|
VersionAdded: '0.43'
|
2403
|
-
VersionChanged: '
|
3212
|
+
VersionChanged: '1.22'
|
2404
3213
|
# Autocorrect here will change to a method that may cause crashes depending
|
2405
3214
|
# on the value of the argument.
|
2406
|
-
AutoCorrect: false
|
2407
3215
|
SafeAutoCorrect: false
|
2408
3216
|
|
2409
3217
|
Security/MarshalLoad:
|
2410
3218
|
Description: >-
|
2411
3219
|
Avoid using of `Marshal.load` or `Marshal.restore` due to potential
|
2412
3220
|
security issues. See reference for more information.
|
2413
|
-
|
3221
|
+
References:
|
3222
|
+
- 'https://ruby-doc.org/core-2.7.0/Marshal.html#module-Marshal-label-Security+considerations'
|
2414
3223
|
Enabled: true
|
2415
3224
|
VersionAdded: '0.47'
|
2416
3225
|
|
2417
3226
|
Security/Open:
|
2418
|
-
Description: 'The use of Kernel#open
|
3227
|
+
Description: 'The use of `Kernel#open` and `URI.open` represent a serious security risk.'
|
2419
3228
|
Enabled: true
|
2420
3229
|
VersionAdded: '0.53'
|
3230
|
+
VersionChanged: '1.0'
|
2421
3231
|
Safe: false
|
2422
3232
|
|
2423
3233
|
Security/YAMLLoad:
|
2424
3234
|
Description: >-
|
2425
3235
|
Prefer usage of `YAML.safe_load` over `YAML.load` due to potential
|
2426
3236
|
security issues. See reference for more information.
|
2427
|
-
|
3237
|
+
References:
|
3238
|
+
- 'https://ruby-doc.org/stdlib-2.7.0/libdoc/yaml/rdoc/YAML.html#module-YAML-label-Security'
|
2428
3239
|
Enabled: true
|
2429
3240
|
VersionAdded: '0.47'
|
2430
3241
|
SafeAutoCorrect: false
|
@@ -2435,16 +3246,19 @@ Style/AccessModifierDeclarations:
|
|
2435
3246
|
Description: 'Checks style of how access modifiers are used.'
|
2436
3247
|
Enabled: true
|
2437
3248
|
VersionAdded: '0.57'
|
2438
|
-
VersionChanged: '
|
3249
|
+
VersionChanged: '1.70'
|
2439
3250
|
EnforcedStyle: group
|
2440
3251
|
SupportedStyles:
|
2441
3252
|
- inline
|
2442
3253
|
- group
|
2443
3254
|
AllowModifiersOnSymbols: true
|
3255
|
+
AllowModifiersOnAttrs: true
|
3256
|
+
AllowModifiersOnAliasMethod: true
|
3257
|
+
SafeAutoCorrect: false
|
2444
3258
|
|
2445
3259
|
Style/AccessorGrouping:
|
2446
3260
|
Description: 'Checks for grouping of accessors in `class` and `module` bodies.'
|
2447
|
-
Enabled:
|
3261
|
+
Enabled: true
|
2448
3262
|
VersionAdded: '0.87'
|
2449
3263
|
EnforcedStyle: grouped
|
2450
3264
|
SupportedStyles:
|
@@ -2464,12 +3278,19 @@ Style/Alias:
|
|
2464
3278
|
- prefer_alias
|
2465
3279
|
- prefer_alias_method
|
2466
3280
|
|
3281
|
+
Style/AmbiguousEndlessMethodDefinition:
|
3282
|
+
Description: 'Checks for endless methods inside operators of lower precedence.'
|
3283
|
+
StyleGuide: '#ambiguous-endless-method-defintions'
|
3284
|
+
Enabled: pending
|
3285
|
+
VersionAdded: '1.68'
|
3286
|
+
|
2467
3287
|
Style/AndOr:
|
2468
3288
|
Description: 'Use &&/|| instead of and/or.'
|
2469
3289
|
StyleGuide: '#no-and-or-or'
|
2470
3290
|
Enabled: true
|
3291
|
+
SafeAutoCorrect: false
|
2471
3292
|
VersionAdded: '0.9'
|
2472
|
-
VersionChanged: '
|
3293
|
+
VersionChanged: '1.21'
|
2473
3294
|
# Whether `and` and `or` are banned only in conditionals (conditionals)
|
2474
3295
|
# or completely (always).
|
2475
3296
|
EnforcedStyle: conditionals
|
@@ -2477,6 +3298,26 @@ Style/AndOr:
|
|
2477
3298
|
- always
|
2478
3299
|
- conditionals
|
2479
3300
|
|
3301
|
+
Style/ArgumentsForwarding:
|
3302
|
+
Description: 'Use arguments forwarding.'
|
3303
|
+
StyleGuide: '#arguments-forwarding'
|
3304
|
+
Enabled: pending
|
3305
|
+
AllowOnlyRestArgument: true
|
3306
|
+
UseAnonymousForwarding: true
|
3307
|
+
RedundantRestArgumentNames:
|
3308
|
+
- args
|
3309
|
+
- arguments
|
3310
|
+
RedundantKeywordRestArgumentNames:
|
3311
|
+
- kwargs
|
3312
|
+
- options
|
3313
|
+
- opts
|
3314
|
+
RedundantBlockArgumentNames:
|
3315
|
+
- blk
|
3316
|
+
- block
|
3317
|
+
- proc
|
3318
|
+
VersionAdded: '1.1'
|
3319
|
+
VersionChanged: '1.58'
|
3320
|
+
|
2480
3321
|
Style/ArrayCoercion:
|
2481
3322
|
Description: >-
|
2482
3323
|
Use Array() instead of explicit Array check or [*var], when dealing
|
@@ -2486,6 +3327,20 @@ Style/ArrayCoercion:
|
|
2486
3327
|
Enabled: false
|
2487
3328
|
VersionAdded: '0.88'
|
2488
3329
|
|
3330
|
+
Style/ArrayFirstLast:
|
3331
|
+
Description: 'Use `arr.first` and `arr.last` instead of `arr[0]` and `arr[-1]`.'
|
3332
|
+
References:
|
3333
|
+
- '#first-and-last'
|
3334
|
+
Enabled: false
|
3335
|
+
VersionAdded: '1.58'
|
3336
|
+
Safe: false
|
3337
|
+
|
3338
|
+
Style/ArrayIntersect:
|
3339
|
+
Description: 'Use `array1.intersect?(array2)` instead of `(array1 & array2).any?`.'
|
3340
|
+
Enabled: 'pending'
|
3341
|
+
Safe: false
|
3342
|
+
VersionAdded: '1.40'
|
3343
|
+
|
2489
3344
|
Style/ArrayJoin:
|
2490
3345
|
Description: 'Use Array#join instead of Array#*.'
|
2491
3346
|
StyleGuide: '#array-join'
|
@@ -2496,10 +3351,11 @@ Style/ArrayJoin:
|
|
2496
3351
|
Style/AsciiComments:
|
2497
3352
|
Description: 'Use only ascii symbols in comments.'
|
2498
3353
|
StyleGuide: '#english-comments'
|
2499
|
-
Enabled:
|
3354
|
+
Enabled: false
|
2500
3355
|
VersionAdded: '0.9'
|
2501
|
-
VersionChanged: '
|
2502
|
-
AllowedChars:
|
3356
|
+
VersionChanged: '1.21'
|
3357
|
+
AllowedChars:
|
3358
|
+
- ©
|
2503
3359
|
|
2504
3360
|
Style/Attr:
|
2505
3361
|
Description: 'Checks for uses of Module#attr.'
|
@@ -2533,9 +3389,16 @@ Style/BisectedAttrAccessor:
|
|
2533
3389
|
Description: >-
|
2534
3390
|
Checks for places where `attr_reader` and `attr_writer`
|
2535
3391
|
for the same method can be combined into single `attr_accessor`.
|
2536
|
-
Enabled:
|
3392
|
+
Enabled: true
|
2537
3393
|
VersionAdded: '0.87'
|
2538
3394
|
|
3395
|
+
Style/BitwisePredicate:
|
3396
|
+
Description: 'Prefer bitwise predicate methods over direct comparison operations.'
|
3397
|
+
StyleGuide: '#bitwise-predicate-methods'
|
3398
|
+
Enabled: pending
|
3399
|
+
Safe: false
|
3400
|
+
VersionAdded: '1.68'
|
3401
|
+
|
2539
3402
|
Style/BlockComments:
|
2540
3403
|
Description: 'Do not use block comments.'
|
2541
3404
|
StyleGuide: '#no-block-comments'
|
@@ -2566,7 +3429,7 @@ Style/BlockDelimiters:
|
|
2566
3429
|
# This looks at the usage of a block's method to determine its type (e.g. is
|
2567
3430
|
# the result of a `map` assigned to a variable or passed to another
|
2568
3431
|
# method) but exceptions are permitted in the `ProceduralMethods`,
|
2569
|
-
# `FunctionalMethods` and `
|
3432
|
+
# `FunctionalMethods` and `AllowedMethods` sections below.
|
2570
3433
|
- semantic
|
2571
3434
|
# The `braces_for_chaining` style enforces braces around single line blocks
|
2572
3435
|
# and do..end around multi-line blocks, except for multi-line blocks whose
|
@@ -2607,7 +3470,7 @@ Style/BlockDelimiters:
|
|
2607
3470
|
- let!
|
2608
3471
|
- subject
|
2609
3472
|
- watch
|
2610
|
-
|
3473
|
+
AllowedMethods:
|
2611
3474
|
# Methods that can be either procedural or functional and cannot be
|
2612
3475
|
# categorised from their usage alone, e.g.
|
2613
3476
|
#
|
@@ -2624,6 +3487,7 @@ Style/BlockDelimiters:
|
|
2624
3487
|
- lambda
|
2625
3488
|
- proc
|
2626
3489
|
- it
|
3490
|
+
AllowedPatterns: []
|
2627
3491
|
# The AllowBracesOnProceduralOneLiners option is ignored unless the
|
2628
3492
|
# EnforcedStyle is set to `semantic`. If so:
|
2629
3493
|
#
|
@@ -2647,7 +3511,7 @@ Style/BlockDelimiters:
|
|
2647
3511
|
# collection.each do |element| puts element end
|
2648
3512
|
AllowBracesOnProceduralOneLiners: false
|
2649
3513
|
# The BracesRequiredMethods overrides all other configurations except
|
2650
|
-
#
|
3514
|
+
# AllowedMethods. It can be used to enforce that all blocks for specific
|
2651
3515
|
# methods use braces. For example, you can use this to enforce Sorbet
|
2652
3516
|
# signatures use braces even when the rest of your codebase enforces
|
2653
3517
|
# the `line_count_based` style.
|
@@ -2659,7 +3523,7 @@ Style/CaseEquality:
|
|
2659
3523
|
Enabled: true
|
2660
3524
|
VersionAdded: '0.9'
|
2661
3525
|
VersionChanged: '0.89'
|
2662
|
-
# If AllowOnConstant is enabled, the cop will ignore violations when the receiver of
|
3526
|
+
# If `AllowOnConstant` option is enabled, the cop will ignore violations when the receiver of
|
2663
3527
|
# the case equality operator is a constant.
|
2664
3528
|
#
|
2665
3529
|
# # bad
|
@@ -2668,13 +3532,25 @@ Style/CaseEquality:
|
|
2668
3532
|
# # good
|
2669
3533
|
# String === "string"
|
2670
3534
|
AllowOnConstant: false
|
3535
|
+
# If `AllowOnSelfClass` option is enabled, the cop will ignore violations when the receiver of
|
3536
|
+
# the case equality operator is `self.class`.
|
3537
|
+
#
|
3538
|
+
# # bad
|
3539
|
+
# some_class === object
|
3540
|
+
#
|
3541
|
+
# # good
|
3542
|
+
# self.class === object
|
3543
|
+
AllowOnSelfClass: false
|
2671
3544
|
|
2672
3545
|
Style/CaseLikeIf:
|
2673
|
-
Description: '
|
3546
|
+
Description: 'Identifies places where `if-elsif` constructions can be replaced with `case-when`.'
|
2674
3547
|
StyleGuide: '#case-vs-if-else'
|
2675
|
-
Enabled:
|
3548
|
+
Enabled: true
|
2676
3549
|
Safe: false
|
2677
3550
|
VersionAdded: '0.88'
|
3551
|
+
VersionChanged: '1.48'
|
3552
|
+
# `MinBranchesCount` defines the number of branches `if` needs to have to trigger this cop.
|
3553
|
+
MinBranchesCount: 3
|
2678
3554
|
|
2679
3555
|
Style/CharacterLiteral:
|
2680
3556
|
Description: 'Checks for uses of character literals.'
|
@@ -2687,12 +3563,13 @@ Style/ClassAndModuleChildren:
|
|
2687
3563
|
StyleGuide: '#namespace-definition'
|
2688
3564
|
# Moving from compact to nested children requires knowledge of whether the
|
2689
3565
|
# outer parent is a module or a class. Moving from nested to compact requires
|
2690
|
-
# verification that the outer parent is defined elsewhere.
|
3566
|
+
# verification that the outer parent is defined elsewhere. RuboCop does not
|
2691
3567
|
# have the knowledge to perform either operation safely and thus requires
|
2692
3568
|
# manual oversight.
|
2693
3569
|
SafeAutoCorrect: false
|
2694
3570
|
Enabled: true
|
2695
3571
|
VersionAdded: '0.19'
|
3572
|
+
VersionChanged: '1.74'
|
2696
3573
|
#
|
2697
3574
|
# Basically there are two different styles:
|
2698
3575
|
#
|
@@ -2708,7 +3585,21 @@ Style/ClassAndModuleChildren:
|
|
2708
3585
|
#
|
2709
3586
|
# The compact style is only forced, for classes or modules with one child.
|
2710
3587
|
EnforcedStyle: nested
|
2711
|
-
SupportedStyles:
|
3588
|
+
SupportedStyles: &supported_styles
|
3589
|
+
- nested
|
3590
|
+
- compact
|
3591
|
+
# Configure classes separately, if desired. If not set, or set to `nil`,
|
3592
|
+
# the `EnforcedStyle` value will be used.
|
3593
|
+
EnforcedStyleForClasses: ~
|
3594
|
+
SupportedStylesForClasses:
|
3595
|
+
- ~
|
3596
|
+
- nested
|
3597
|
+
- compact
|
3598
|
+
# Configure modules separately, if desired. If not set, or set to `nil`,
|
3599
|
+
# the `EnforcedStyle` value will be used.
|
3600
|
+
EnforcedStyleForModules: ~
|
3601
|
+
SupportedStylesForModules:
|
3602
|
+
- ~
|
2712
3603
|
- nested
|
2713
3604
|
- compact
|
2714
3605
|
|
@@ -2725,12 +3616,15 @@ Style/ClassCheck:
|
|
2725
3616
|
Style/ClassEqualityComparison:
|
2726
3617
|
Description: 'Enforces the use of `Object#instance_of?` instead of class comparison for equality.'
|
2727
3618
|
StyleGuide: '#instance-of-vs-class-comparison'
|
2728
|
-
Enabled:
|
3619
|
+
Enabled: true
|
3620
|
+
SafeAutoCorrect: false
|
2729
3621
|
VersionAdded: '0.93'
|
2730
|
-
|
3622
|
+
VersionChanged: '1.57'
|
3623
|
+
AllowedMethods:
|
2731
3624
|
- ==
|
2732
3625
|
- equal?
|
2733
3626
|
- eql?
|
3627
|
+
AllowedPatterns: []
|
2734
3628
|
|
2735
3629
|
Style/ClassMethods:
|
2736
3630
|
Description: 'Use self when defining module/class methods.'
|
@@ -2744,7 +3638,7 @@ Style/ClassMethodsDefinitions:
|
|
2744
3638
|
StyleGuide: '#def-self-class-methods'
|
2745
3639
|
Enabled: false
|
2746
3640
|
VersionAdded: '0.89'
|
2747
|
-
EnforcedStyle:
|
3641
|
+
EnforcedStyle: def_self
|
2748
3642
|
SupportedStyles:
|
2749
3643
|
- def_self
|
2750
3644
|
- self_class
|
@@ -2755,13 +3649,21 @@ Style/ClassVars:
|
|
2755
3649
|
Enabled: true
|
2756
3650
|
VersionAdded: '0.13'
|
2757
3651
|
|
3652
|
+
Style/CollectionCompact:
|
3653
|
+
Description: 'Use `{Array,Hash}#{compact,compact!}` instead of custom logic to reject nils.'
|
3654
|
+
Enabled: pending
|
3655
|
+
Safe: false
|
3656
|
+
VersionAdded: '1.2'
|
3657
|
+
VersionChanged: '1.3'
|
3658
|
+
AllowedReceivers: []
|
3659
|
+
|
2758
3660
|
# Align with the style guide.
|
2759
3661
|
Style/CollectionMethods:
|
2760
3662
|
Description: 'Preferred collection methods.'
|
2761
3663
|
StyleGuide: '#map-find-select-reduce-include-size'
|
2762
3664
|
Enabled: false
|
2763
3665
|
VersionAdded: '0.9'
|
2764
|
-
VersionChanged: '
|
3666
|
+
VersionChanged: '1.7'
|
2765
3667
|
Safe: false
|
2766
3668
|
# Mapping from undesired method to desired method
|
2767
3669
|
# e.g. to use `detect` over `find`:
|
@@ -2772,10 +3674,23 @@ Style/CollectionMethods:
|
|
2772
3674
|
PreferredMethods:
|
2773
3675
|
collect: 'map'
|
2774
3676
|
collect!: 'map!'
|
3677
|
+
collect_concat: 'flat_map'
|
2775
3678
|
inject: 'reduce'
|
2776
3679
|
detect: 'find'
|
2777
3680
|
find_all: 'select'
|
2778
3681
|
member?: 'include?'
|
3682
|
+
# Methods in this array accept a final symbol as an implicit block
|
3683
|
+
# eg. `inject(:+)`
|
3684
|
+
MethodsAcceptingSymbol:
|
3685
|
+
- inject
|
3686
|
+
- reduce
|
3687
|
+
|
3688
|
+
Style/CollectionQuerying:
|
3689
|
+
Description: 'Prefer `Enumerable` predicate methods over expressions with `count`.'
|
3690
|
+
StyleGuide: '#collection-querying'
|
3691
|
+
Enabled: pending
|
3692
|
+
VersionAdded: '1.77'
|
3693
|
+
Safe: false
|
2779
3694
|
|
2780
3695
|
Style/ColonMethodCall:
|
2781
3696
|
Description: 'Do not use :: for method call.'
|
@@ -2789,11 +3704,16 @@ Style/ColonMethodDefinition:
|
|
2789
3704
|
Enabled: true
|
2790
3705
|
VersionAdded: '0.52'
|
2791
3706
|
|
3707
|
+
Style/CombinableDefined:
|
3708
|
+
Description: 'Checks successive `defined?` calls that can be combined into a single call.'
|
3709
|
+
Enabled: pending
|
3710
|
+
VersionAdded: '1.68'
|
3711
|
+
|
2792
3712
|
Style/CombinableLoops:
|
2793
3713
|
Description: >-
|
2794
3714
|
Checks for places where multiple consecutive loops over the same data
|
2795
3715
|
can be combined into a single loop.
|
2796
|
-
Enabled:
|
3716
|
+
Enabled: true
|
2797
3717
|
Safe: false
|
2798
3718
|
VersionAdded: '0.90'
|
2799
3719
|
|
@@ -2818,22 +3738,45 @@ Style/CommandLiteral:
|
|
2818
3738
|
Style/CommentAnnotation:
|
2819
3739
|
Description: >-
|
2820
3740
|
Checks formatting of special comments
|
2821
|
-
(TODO, FIXME, OPTIMIZE, HACK, REVIEW).
|
3741
|
+
(TODO, FIXME, OPTIMIZE, HACK, REVIEW, NOTE).
|
2822
3742
|
StyleGuide: '#annotate-keywords'
|
2823
3743
|
Enabled: true
|
2824
3744
|
VersionAdded: '0.10'
|
2825
|
-
VersionChanged: '
|
3745
|
+
VersionChanged: '1.20'
|
2826
3746
|
Keywords:
|
2827
3747
|
- TODO
|
2828
3748
|
- FIXME
|
2829
3749
|
- OPTIMIZE
|
2830
3750
|
- HACK
|
2831
3751
|
- REVIEW
|
3752
|
+
- NOTE
|
3753
|
+
RequireColon: true
|
2832
3754
|
|
2833
3755
|
Style/CommentedKeyword:
|
2834
3756
|
Description: 'Do not place comments on the same line as certain keywords.'
|
2835
3757
|
Enabled: true
|
3758
|
+
SafeAutoCorrect: false
|
2836
3759
|
VersionAdded: '0.51'
|
3760
|
+
VersionChanged: '1.19'
|
3761
|
+
|
3762
|
+
Style/ComparableBetween:
|
3763
|
+
Description: 'Enforces the use of `Comparable#between?` instead of logical comparison.'
|
3764
|
+
Enabled: pending
|
3765
|
+
Safe: false
|
3766
|
+
VersionAdded: '1.74'
|
3767
|
+
VersionChanged: '1.75'
|
3768
|
+
StyleGuide: '#ranges-or-between'
|
3769
|
+
|
3770
|
+
Style/ComparableClamp:
|
3771
|
+
Description: 'Enforces the use of `Comparable#clamp` instead of comparison by minimum and maximum.'
|
3772
|
+
Enabled: pending
|
3773
|
+
VersionAdded: '1.44'
|
3774
|
+
|
3775
|
+
Style/ConcatArrayLiterals:
|
3776
|
+
Description: 'Enforces the use of `Array#push(item)` instead of `Array#concat([item])` to avoid redundant array literals.'
|
3777
|
+
Enabled: pending
|
3778
|
+
Safe: false
|
3779
|
+
VersionAdded: '1.41'
|
2837
3780
|
|
2838
3781
|
Style/ConditionalAssignment:
|
2839
3782
|
Description: >-
|
@@ -2862,6 +3805,8 @@ Style/ConstantVisibility:
|
|
2862
3805
|
visibility declarations.
|
2863
3806
|
Enabled: false
|
2864
3807
|
VersionAdded: '0.66'
|
3808
|
+
VersionChanged: '1.10'
|
3809
|
+
IgnoreModules: false
|
2865
3810
|
|
2866
3811
|
# Checks that you have put a copyright in a comment before any code.
|
2867
3812
|
#
|
@@ -2888,9 +3833,17 @@ Style/Copyright:
|
|
2888
3833
|
Notice: '^Copyright (\(c\) )?2[0-9]{3} .+'
|
2889
3834
|
AutocorrectNotice: ''
|
2890
3835
|
|
3836
|
+
Style/DataInheritance:
|
3837
|
+
Description: 'Checks for inheritance from Data.define.'
|
3838
|
+
StyleGuide: '#no-extend-data-define'
|
3839
|
+
Enabled: pending
|
3840
|
+
SafeAutoCorrect: false
|
3841
|
+
VersionAdded: '1.49'
|
3842
|
+
VersionChanged: '1.51'
|
3843
|
+
|
2891
3844
|
Style/DateTime:
|
2892
3845
|
Description: 'Use Time over DateTime.'
|
2893
|
-
StyleGuide: '#date
|
3846
|
+
StyleGuide: '#date-time'
|
2894
3847
|
Enabled: false
|
2895
3848
|
VersionAdded: '0.51'
|
2896
3849
|
VersionChanged: '0.92'
|
@@ -2904,6 +3857,12 @@ Style/DefWithParentheses:
|
|
2904
3857
|
VersionAdded: '0.9'
|
2905
3858
|
VersionChanged: '0.12'
|
2906
3859
|
|
3860
|
+
Style/DigChain:
|
3861
|
+
Description: 'Use `dig` with multiple parameters instead of chaining multiple calls.'
|
3862
|
+
Enabled: pending
|
3863
|
+
Safe: false
|
3864
|
+
VersionAdded: '1.69'
|
3865
|
+
|
2907
3866
|
Style/Dir:
|
2908
3867
|
Description: >-
|
2909
3868
|
Use the `__dir__` method to retrieve the canonicalized
|
@@ -2911,16 +3870,34 @@ Style/Dir:
|
|
2911
3870
|
Enabled: true
|
2912
3871
|
VersionAdded: '0.50'
|
2913
3872
|
|
3873
|
+
Style/DirEmpty:
|
3874
|
+
Description: >-
|
3875
|
+
Prefer to use `Dir.empty?('path/to/dir')` when checking if a directory is empty.
|
3876
|
+
Enabled: pending
|
3877
|
+
VersionAdded: '1.48'
|
3878
|
+
|
2914
3879
|
Style/DisableCopsWithinSourceCodeDirective:
|
2915
3880
|
Description: >-
|
2916
3881
|
Forbids disabling/enabling cops within source code.
|
2917
3882
|
Enabled: false
|
2918
3883
|
VersionAdded: '0.82'
|
3884
|
+
VersionChanged: '1.9'
|
3885
|
+
AllowedCops: []
|
3886
|
+
|
3887
|
+
Style/DocumentDynamicEvalDefinition:
|
3888
|
+
Description: >-
|
3889
|
+
When using `class_eval` (or other `eval`) with string interpolation,
|
3890
|
+
add a comment block showing its appearance if interpolated.
|
3891
|
+
StyleGuide: '#eval-comment-docs'
|
3892
|
+
Enabled: pending
|
3893
|
+
VersionAdded: '1.1'
|
3894
|
+
VersionChanged: '1.3'
|
2919
3895
|
|
2920
3896
|
Style/Documentation:
|
2921
3897
|
Description: 'Document classes and non-namespace modules.'
|
2922
3898
|
Enabled: true
|
2923
3899
|
VersionAdded: '0.9'
|
3900
|
+
AllowedConstants: []
|
2924
3901
|
Exclude:
|
2925
3902
|
- 'spec/**/*'
|
2926
3903
|
- 'test/**/*'
|
@@ -2929,6 +3906,7 @@ Style/DocumentationMethod:
|
|
2929
3906
|
Description: 'Checks for missing documentation comment for public methods.'
|
2930
3907
|
Enabled: false
|
2931
3908
|
VersionAdded: '0.43'
|
3909
|
+
AllowedMethods: []
|
2932
3910
|
Exclude:
|
2933
3911
|
- 'spec/**/*'
|
2934
3912
|
- 'test/**/*'
|
@@ -2944,7 +3922,7 @@ Style/DoubleNegation:
|
|
2944
3922
|
StyleGuide: '#no-bang-bang'
|
2945
3923
|
Enabled: true
|
2946
3924
|
VersionAdded: '0.19'
|
2947
|
-
VersionChanged: '
|
3925
|
+
VersionChanged: '1.2'
|
2948
3926
|
EnforcedStyle: allowed_in_returns
|
2949
3927
|
SafeAutoCorrect: false
|
2950
3928
|
SupportedStyles:
|
@@ -2977,8 +3955,9 @@ Style/EmptyCaseCondition:
|
|
2977
3955
|
Style/EmptyElse:
|
2978
3956
|
Description: 'Avoid empty else-clauses.'
|
2979
3957
|
Enabled: true
|
3958
|
+
AutoCorrect: contextual
|
2980
3959
|
VersionAdded: '0.28'
|
2981
|
-
VersionChanged: '
|
3960
|
+
VersionChanged: '1.61'
|
2982
3961
|
EnforcedStyle: both
|
2983
3962
|
# empty - warn only on empty `else`
|
2984
3963
|
# nil - warn on `else` with nil in it
|
@@ -2987,6 +3966,14 @@ Style/EmptyElse:
|
|
2987
3966
|
- empty
|
2988
3967
|
- nil
|
2989
3968
|
- both
|
3969
|
+
AllowComments: false
|
3970
|
+
|
3971
|
+
Style/EmptyHeredoc:
|
3972
|
+
Description: 'Checks for using empty heredoc to reduce redundancy.'
|
3973
|
+
Enabled: pending
|
3974
|
+
AutoCorrect: contextual
|
3975
|
+
VersionAdded: '1.32'
|
3976
|
+
VersionChanged: '1.61'
|
2990
3977
|
|
2991
3978
|
Style/EmptyLambdaParameter:
|
2992
3979
|
Description: 'Omit parens for empty lambda parameters.'
|
@@ -3004,12 +3991,24 @@ Style/EmptyMethod:
|
|
3004
3991
|
Description: 'Checks the formatting of empty method definitions.'
|
3005
3992
|
StyleGuide: '#no-single-line-methods'
|
3006
3993
|
Enabled: true
|
3994
|
+
AutoCorrect: contextual
|
3007
3995
|
VersionAdded: '0.46'
|
3996
|
+
VersionChanged: '1.61'
|
3008
3997
|
EnforcedStyle: compact
|
3009
3998
|
SupportedStyles:
|
3010
3999
|
- compact
|
3011
4000
|
- expanded
|
3012
4001
|
|
4002
|
+
Style/EmptyStringInsideInterpolation:
|
4003
|
+
Description: 'Checks for empty strings being assigned inside string interpolation.'
|
4004
|
+
StyleGuide: '#empty-strings-in-interpolation'
|
4005
|
+
Enabled: pending
|
4006
|
+
EnforcedStyle: trailing_conditional
|
4007
|
+
SupportedStyles:
|
4008
|
+
- trailing_conditional
|
4009
|
+
- ternary
|
4010
|
+
VersionAdded: '1.76'
|
4011
|
+
|
3013
4012
|
Style/Encoding:
|
3014
4013
|
Description: 'Use UTF-8 as the source file encoding.'
|
3015
4014
|
StyleGuide: '#utf-8'
|
@@ -3024,6 +4023,25 @@ Style/EndBlock:
|
|
3024
4023
|
VersionAdded: '0.9'
|
3025
4024
|
VersionChanged: '0.81'
|
3026
4025
|
|
4026
|
+
Style/EndlessMethod:
|
4027
|
+
Description: 'Avoid the use of multi-lined endless method definitions.'
|
4028
|
+
StyleGuide: '#endless-methods'
|
4029
|
+
Enabled: pending
|
4030
|
+
VersionAdded: '1.8'
|
4031
|
+
EnforcedStyle: allow_single_line
|
4032
|
+
SupportedStyles:
|
4033
|
+
- allow_single_line
|
4034
|
+
- allow_always
|
4035
|
+
- disallow
|
4036
|
+
- require_single_line
|
4037
|
+
- require_always
|
4038
|
+
|
4039
|
+
Style/EnvHome:
|
4040
|
+
Description: "Checks for consistent usage of `ENV['HOME']`."
|
4041
|
+
Enabled: pending
|
4042
|
+
Safe: false
|
4043
|
+
VersionAdded: '1.29'
|
4044
|
+
|
3027
4045
|
Style/EvalWithLocation:
|
3028
4046
|
Description: 'Pass `__FILE__` and `__LINE__` to `eval` method, as they are used by backtraces.'
|
3029
4047
|
Enabled: true
|
@@ -3036,6 +4054,11 @@ Style/EvenOdd:
|
|
3036
4054
|
VersionAdded: '0.12'
|
3037
4055
|
VersionChanged: '0.29'
|
3038
4056
|
|
4057
|
+
Style/ExactRegexpMatch:
|
4058
|
+
Description: 'Checks for exact regexp match inside Regexp literals.'
|
4059
|
+
Enabled: pending
|
4060
|
+
VersionAdded: '1.51'
|
4061
|
+
|
3039
4062
|
Style/ExpandPathArguments:
|
3040
4063
|
Description: "Use `expand_path(__dir__)` instead of `expand_path('..', __FILE__)`."
|
3041
4064
|
Enabled: true
|
@@ -3046,15 +4069,14 @@ Style/ExplicitBlockArgument:
|
|
3046
4069
|
Consider using explicit block argument to avoid writing block literal
|
3047
4070
|
that just passes its arguments to another block.
|
3048
4071
|
StyleGuide: '#block-argument'
|
3049
|
-
Enabled:
|
3050
|
-
# May change the yielding arity.
|
3051
|
-
Safe: false
|
4072
|
+
Enabled: true
|
3052
4073
|
VersionAdded: '0.89'
|
4074
|
+
VersionChanged: '1.8'
|
3053
4075
|
|
3054
4076
|
Style/ExponentialNotation:
|
3055
4077
|
Description: 'When using exponential notation, favor a mantissa between 1 (inclusive) and 10 (exclusive).'
|
3056
4078
|
StyleGuide: '#exponential-notation'
|
3057
|
-
Enabled:
|
4079
|
+
Enabled: true
|
3058
4080
|
VersionAdded: '0.82'
|
3059
4081
|
EnforcedStyle: scientific
|
3060
4082
|
SupportedStyles:
|
@@ -3062,12 +4084,59 @@ Style/ExponentialNotation:
|
|
3062
4084
|
- engineering
|
3063
4085
|
- integral
|
3064
4086
|
|
4087
|
+
Style/FetchEnvVar:
|
4088
|
+
Description: >-
|
4089
|
+
Suggests `ENV.fetch` for the replacement of `ENV[]`.
|
4090
|
+
References:
|
4091
|
+
- https://rubystyle.guide/#hash-fetch-defaults
|
4092
|
+
Enabled: pending
|
4093
|
+
VersionAdded: '1.28'
|
4094
|
+
# Environment variables to be excluded from the inspection.
|
4095
|
+
AllowedVars: []
|
4096
|
+
# When `true`, autocorrects `ENV["key"]` to `ENV.fetch("key", nil)`.
|
4097
|
+
# When `false`, autocorrects `ENV["key"]` to `ENV.fetch("key")`.
|
4098
|
+
DefaultToNil: true
|
4099
|
+
|
4100
|
+
Style/FileEmpty:
|
4101
|
+
Description: >-
|
4102
|
+
Prefer to use `File.empty?('path/to/file')` when checking if a file is empty.
|
4103
|
+
Enabled: pending
|
4104
|
+
Safe: false
|
4105
|
+
VersionAdded: '1.48'
|
4106
|
+
|
4107
|
+
Style/FileNull:
|
4108
|
+
Description: 'Use `File::NULL` instead of hardcoding "dev/null".'
|
4109
|
+
Enabled: pending
|
4110
|
+
SafeAutoCorrect: false
|
4111
|
+
VersionAdded: '1.69'
|
4112
|
+
|
4113
|
+
Style/FileRead:
|
4114
|
+
Description: 'Favor `File.(bin)read` convenience methods.'
|
4115
|
+
StyleGuide: '#file-read'
|
4116
|
+
Enabled: pending
|
4117
|
+
VersionAdded: '1.24'
|
4118
|
+
|
4119
|
+
Style/FileTouch:
|
4120
|
+
Description: 'Favor `FileUtils.touch` for touching files.'
|
4121
|
+
Enabled: pending
|
4122
|
+
VersionAdded: '1.69'
|
4123
|
+
SafeAutoCorrect: false
|
4124
|
+
|
4125
|
+
Style/FileWrite:
|
4126
|
+
Description: 'Favor `File.(bin)write` convenience methods.'
|
4127
|
+
StyleGuide: '#file-write'
|
4128
|
+
Enabled: pending
|
4129
|
+
VersionAdded: '1.24'
|
4130
|
+
|
3065
4131
|
Style/FloatDivision:
|
3066
4132
|
Description: 'For performing float division, coerce one side only.'
|
3067
4133
|
StyleGuide: '#float-division'
|
3068
|
-
|
4134
|
+
References:
|
4135
|
+
- 'https://blog.rubystyle.guide/ruby/2019/06/21/float-division.html'
|
3069
4136
|
Enabled: true
|
3070
4137
|
VersionAdded: '0.72'
|
4138
|
+
VersionChanged: '1.9'
|
4139
|
+
Safe: false
|
3071
4140
|
EnforcedStyle: single_coerce
|
3072
4141
|
SupportedStyles:
|
3073
4142
|
- left_coerce
|
@@ -3079,8 +4148,9 @@ Style/For:
|
|
3079
4148
|
Description: 'Checks use of for or each in multiline loops.'
|
3080
4149
|
StyleGuide: '#no-for-loops'
|
3081
4150
|
Enabled: true
|
4151
|
+
SafeAutoCorrect: false
|
3082
4152
|
VersionAdded: '0.13'
|
3083
|
-
VersionChanged: '
|
4153
|
+
VersionChanged: '1.26'
|
3084
4154
|
EnforcedStyle: each
|
3085
4155
|
SupportedStyles:
|
3086
4156
|
- each
|
@@ -3109,8 +4179,20 @@ Style/FormatStringToken:
|
|
3109
4179
|
# Prefer simple looking "template" style tokens like `%{name}`, `%{age}`
|
3110
4180
|
- template
|
3111
4181
|
- unannotated
|
4182
|
+
# `MaxUnannotatedPlaceholdersAllowed` defines the number of `unannotated`
|
4183
|
+
# style token in a format string to be allowed when enforced style is not
|
4184
|
+
# `unannotated`.
|
4185
|
+
MaxUnannotatedPlaceholdersAllowed: 1
|
4186
|
+
# The mode the cop operates in. Two values are allowed:
|
4187
|
+
# * aggressive (default): all strings are considered
|
4188
|
+
# * conservative:
|
4189
|
+
# only register offenses for strings given to `printf`, `sprintf`,
|
4190
|
+
# format` and `%` methods. Other strings are not considered.
|
4191
|
+
Mode: aggressive
|
3112
4192
|
VersionAdded: '0.49'
|
3113
|
-
VersionChanged: '
|
4193
|
+
VersionChanged: '1.74'
|
4194
|
+
AllowedMethods: []
|
4195
|
+
AllowedPatterns: []
|
3114
4196
|
|
3115
4197
|
Style/FrozenStringLiteralComment:
|
3116
4198
|
Description: >-
|
@@ -3133,62 +4215,102 @@ Style/FrozenStringLiteralComment:
|
|
3133
4215
|
# exist in a file.
|
3134
4216
|
- never
|
3135
4217
|
SafeAutoCorrect: false
|
4218
|
+
Exclude:
|
4219
|
+
# Prevent the Ruby warning: `'frozen_string_literal' is ignored after any tokens` when using Active Admin.
|
4220
|
+
- '**/*.arb'
|
3136
4221
|
|
3137
4222
|
Style/GlobalStdStream:
|
3138
4223
|
Description: 'Enforces the use of `$stdout/$stderr/$stdin` instead of `STDOUT/STDERR/STDIN`.'
|
3139
4224
|
StyleGuide: '#global-stdout'
|
3140
|
-
Enabled:
|
4225
|
+
Enabled: true
|
3141
4226
|
VersionAdded: '0.89'
|
3142
4227
|
SafeAutoCorrect: false
|
3143
4228
|
|
3144
4229
|
Style/GlobalVars:
|
3145
4230
|
Description: 'Do not introduce global variables.'
|
3146
4231
|
StyleGuide: '#instance-vars'
|
3147
|
-
|
4232
|
+
References:
|
4233
|
+
- 'https://www.zenspider.com/ruby/quickref.html'
|
3148
4234
|
Enabled: true
|
3149
4235
|
VersionAdded: '0.13'
|
3150
4236
|
# Built-in global variables are allowed by default.
|
3151
4237
|
AllowedVariables: []
|
3152
4238
|
|
3153
4239
|
Style/GuardClause:
|
3154
|
-
Description: '
|
4240
|
+
Description: 'Checks for conditionals that can be replaced with guard clauses.'
|
3155
4241
|
StyleGuide: '#no-nested-conditionals'
|
3156
4242
|
Enabled: true
|
3157
4243
|
VersionAdded: '0.20'
|
3158
|
-
VersionChanged: '
|
4244
|
+
VersionChanged: '1.31'
|
3159
4245
|
# `MinBodyLength` defines the number of lines of the a body of an `if` or `unless`
|
3160
4246
|
# needs to have to trigger this cop
|
3161
4247
|
MinBodyLength: 1
|
4248
|
+
AllowConsecutiveConditionals: false
|
3162
4249
|
|
3163
4250
|
Style/HashAsLastArrayItem:
|
3164
4251
|
Description: >-
|
3165
4252
|
Checks for presence or absence of braces around hash literal as a last
|
3166
4253
|
array item depending on configuration.
|
3167
4254
|
StyleGuide: '#hash-literal-as-last-array-item'
|
3168
|
-
Enabled:
|
4255
|
+
Enabled: true
|
3169
4256
|
VersionAdded: '0.88'
|
3170
4257
|
EnforcedStyle: braces
|
3171
4258
|
SupportedStyles:
|
3172
4259
|
- braces
|
3173
4260
|
- no_braces
|
3174
4261
|
|
4262
|
+
Style/HashConversion:
|
4263
|
+
Description: 'Avoid Hash[] in favor of ary.to_h or literal hashes.'
|
4264
|
+
StyleGuide: '#avoid-hash-constructor'
|
4265
|
+
Enabled: pending
|
4266
|
+
SafeAutoCorrect: false
|
4267
|
+
VersionAdded: '1.10'
|
4268
|
+
VersionChanged: '1.55'
|
4269
|
+
AllowSplatArgument: true
|
4270
|
+
|
3175
4271
|
Style/HashEachMethods:
|
3176
4272
|
Description: 'Use Hash#each_key and Hash#each_value.'
|
3177
4273
|
StyleGuide: '#hash-each'
|
3178
|
-
Enabled:
|
4274
|
+
Enabled: true
|
4275
|
+
Safe: false
|
3179
4276
|
VersionAdded: '0.80'
|
4277
|
+
VersionChanged: '1.16'
|
4278
|
+
AllowedReceivers:
|
4279
|
+
- Thread.current
|
4280
|
+
|
4281
|
+
Style/HashExcept:
|
4282
|
+
Description: >-
|
4283
|
+
Checks for usages of `Hash#reject`, `Hash#select`, and `Hash#filter` methods
|
4284
|
+
that can be replaced with `Hash#except` method.
|
4285
|
+
Enabled: pending
|
3180
4286
|
Safe: false
|
4287
|
+
VersionAdded: '1.7'
|
4288
|
+
VersionChanged: '1.39'
|
4289
|
+
|
4290
|
+
Style/HashFetchChain:
|
4291
|
+
Description: 'Use `Hash#dig` instead of chained `fetch` calls.'
|
4292
|
+
Enabled: pending
|
4293
|
+
Safe: false
|
4294
|
+
VersionAdded: '1.75'
|
3181
4295
|
|
3182
4296
|
Style/HashLikeCase:
|
3183
4297
|
Description: >-
|
3184
4298
|
Checks for places where `case-when` represents a simple 1:1
|
3185
4299
|
mapping and can be replaced with a hash lookup.
|
3186
|
-
Enabled:
|
4300
|
+
Enabled: true
|
3187
4301
|
VersionAdded: '0.88'
|
3188
4302
|
# `MinBranchesCount` defines the number of branches `case` needs to have
|
3189
4303
|
# to trigger this cop
|
3190
4304
|
MinBranchesCount: 3
|
3191
4305
|
|
4306
|
+
Style/HashSlice:
|
4307
|
+
Description: >-
|
4308
|
+
Checks for usages of `Hash#reject`, `Hash#select`, and `Hash#filter` methods
|
4309
|
+
that can be replaced with `Hash#slice` method.
|
4310
|
+
Enabled: pending
|
4311
|
+
Safe: false
|
4312
|
+
VersionAdded: '1.71'
|
4313
|
+
|
3192
4314
|
Style/HashSyntax:
|
3193
4315
|
Description: >-
|
3194
4316
|
Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
|
@@ -3196,7 +4318,7 @@ Style/HashSyntax:
|
|
3196
4318
|
StyleGuide: '#hash-literals'
|
3197
4319
|
Enabled: true
|
3198
4320
|
VersionAdded: '0.9'
|
3199
|
-
VersionChanged: '
|
4321
|
+
VersionChanged: '1.67'
|
3200
4322
|
EnforcedStyle: ruby19
|
3201
4323
|
SupportedStyles:
|
3202
4324
|
# checks for 1.9 syntax (e.g. {a: 1}) for all symbol keys
|
@@ -3207,6 +4329,19 @@ Style/HashSyntax:
|
|
3207
4329
|
- no_mixed_keys
|
3208
4330
|
# enforces both ruby19 and no_mixed_keys styles
|
3209
4331
|
- ruby19_no_mixed_keys
|
4332
|
+
# Force hashes that have a hash value omission
|
4333
|
+
EnforcedShorthandSyntax: either
|
4334
|
+
SupportedShorthandSyntax:
|
4335
|
+
# forces use of the 3.1 syntax (e.g. {foo:}) when the hash key and value are the same.
|
4336
|
+
- always
|
4337
|
+
# forces use of explicit hash literal value.
|
4338
|
+
- never
|
4339
|
+
# accepts both shorthand and explicit use of hash literal value.
|
4340
|
+
- either
|
4341
|
+
# forces use of the 3.1 syntax only if all values can be omitted in the hash.
|
4342
|
+
- consistent
|
4343
|
+
# allow either (implicit or explicit) syntax but enforce consistency within a single hash
|
4344
|
+
- either_consistent
|
3210
4345
|
# Force hashes that have a symbol value to use hash rockets
|
3211
4346
|
UseHashRocketsWithSymbolValues: false
|
3212
4347
|
# Do not suggest { a?: 1 } over { :a? => 1 } in ruby19 style
|
@@ -3214,14 +4349,14 @@ Style/HashSyntax:
|
|
3214
4349
|
|
3215
4350
|
Style/HashTransformKeys:
|
3216
4351
|
Description: 'Prefer `transform_keys` over `each_with_object`, `map`, or `to_h`.'
|
3217
|
-
Enabled:
|
4352
|
+
Enabled: true
|
3218
4353
|
VersionAdded: '0.80'
|
3219
4354
|
VersionChanged: '0.90'
|
3220
4355
|
Safe: false
|
3221
4356
|
|
3222
4357
|
Style/HashTransformValues:
|
3223
4358
|
Description: 'Prefer `transform_values` over `each_with_object`, `map`, or `to_h`.'
|
3224
|
-
Enabled:
|
4359
|
+
Enabled: true
|
3225
4360
|
VersionAdded: '0.80'
|
3226
4361
|
VersionChanged: '0.90'
|
3227
4362
|
Safe: false
|
@@ -3232,13 +4367,16 @@ Style/IdenticalConditionalBranches:
|
|
3232
4367
|
line at the end of each branch, which can validly be moved
|
3233
4368
|
out of the conditional.
|
3234
4369
|
Enabled: true
|
4370
|
+
SafeAutoCorrect: false
|
3235
4371
|
VersionAdded: '0.36'
|
4372
|
+
VersionChanged: '1.19'
|
3236
4373
|
|
3237
4374
|
Style/IfInsideElse:
|
3238
4375
|
Description: 'Finds if nodes inside else, which can be converted to elsif.'
|
3239
4376
|
Enabled: true
|
3240
4377
|
AllowIfModifier: false
|
3241
4378
|
VersionAdded: '0.36'
|
4379
|
+
VersionChanged: '1.3'
|
3242
4380
|
|
3243
4381
|
Style/IfUnlessModifier:
|
3244
4382
|
Description: >-
|
@@ -3256,6 +4394,14 @@ Style/IfUnlessModifierOfIfUnless:
|
|
3256
4394
|
VersionAdded: '0.39'
|
3257
4395
|
VersionChanged: '0.87'
|
3258
4396
|
|
4397
|
+
Style/IfWithBooleanLiteralBranches:
|
4398
|
+
Description: 'Checks for redundant `if` with boolean literal branches.'
|
4399
|
+
Enabled: pending
|
4400
|
+
VersionAdded: '1.9'
|
4401
|
+
SafeAutoCorrect: false
|
4402
|
+
AllowedMethods:
|
4403
|
+
- nonzero?
|
4404
|
+
|
3259
4405
|
Style/IfWithSemicolon:
|
3260
4406
|
Description: 'Do not use if x; .... Use the ternary operator instead.'
|
3261
4407
|
StyleGuide: '#no-semicolon-ifs'
|
@@ -3270,13 +4416,21 @@ Style/ImplicitRuntimeError:
|
|
3270
4416
|
Enabled: false
|
3271
4417
|
VersionAdded: '0.41'
|
3272
4418
|
|
4419
|
+
Style/InPatternThen:
|
4420
|
+
Description: 'Checks for `in;` uses in `case` expressions.'
|
4421
|
+
StyleGuide: '#no-in-pattern-semicolons'
|
4422
|
+
Enabled: pending
|
4423
|
+
VersionAdded: '1.16'
|
4424
|
+
|
3273
4425
|
Style/InfiniteLoop:
|
3274
|
-
Description:
|
4426
|
+
Description: >-
|
4427
|
+
Use Kernel#loop for infinite loops.
|
4428
|
+
This cop is unsafe if the body may raise a `StopIteration` exception.
|
4429
|
+
Safe: false
|
3275
4430
|
StyleGuide: '#infinite-loop'
|
3276
4431
|
Enabled: true
|
3277
4432
|
VersionAdded: '0.26'
|
3278
4433
|
VersionChanged: '0.61'
|
3279
|
-
SafeAutoCorrect: true
|
3280
4434
|
|
3281
4435
|
Style/InlineComment:
|
3282
4436
|
Description: 'Avoid trailing inline comments.'
|
@@ -3300,16 +4454,35 @@ Style/InverseMethods:
|
|
3300
4454
|
:=~: :!~
|
3301
4455
|
:<: :>=
|
3302
4456
|
:>: :<=
|
3303
|
-
# `ActiveSupport` defines some common inverse methods. They are listed below,
|
3304
|
-
# and not enabled by default.
|
3305
|
-
#:present?: :blank?,
|
3306
|
-
#:include?: :exclude?
|
3307
4457
|
# `InverseBlocks` are methods that are inverted by inverting the return
|
3308
4458
|
# of the block that is passed to the method
|
3309
4459
|
InverseBlocks:
|
3310
4460
|
:select: :reject
|
3311
4461
|
:select!: :reject!
|
3312
4462
|
|
4463
|
+
Style/InvertibleUnlessCondition:
|
4464
|
+
Description: 'Favor `if` with inverted condition over `unless`.'
|
4465
|
+
Enabled: false
|
4466
|
+
Safe: false
|
4467
|
+
VersionAdded: '1.44'
|
4468
|
+
VersionChanged: '1.50'
|
4469
|
+
# `InverseMethods` are methods that can be inverted in a `unless` condition.
|
4470
|
+
# The relationship of inverse methods needs to be defined in both directions.
|
4471
|
+
# Keys and values both need to be defined as symbols.
|
4472
|
+
InverseMethods:
|
4473
|
+
:!=: :==
|
4474
|
+
:>: :<=
|
4475
|
+
:<=: :>
|
4476
|
+
:<: :>=
|
4477
|
+
:>=: :<
|
4478
|
+
:!~: :=~
|
4479
|
+
:zero?: :nonzero?
|
4480
|
+
:nonzero?: :zero?
|
4481
|
+
:any?: :none?
|
4482
|
+
:none?: :any?
|
4483
|
+
:even?: :odd?
|
4484
|
+
:odd?: :even?
|
4485
|
+
|
3313
4486
|
Style/IpAddresses:
|
3314
4487
|
Description: "Don't include literal IP addresses in code."
|
3315
4488
|
Enabled: false
|
@@ -3325,11 +4498,37 @@ Style/IpAddresses:
|
|
3325
4498
|
- '**/gems.rb'
|
3326
4499
|
- '**/*.gemspec'
|
3327
4500
|
|
4501
|
+
Style/ItAssignment:
|
4502
|
+
Description: 'Checks for local variables and method parameters named `it`.'
|
4503
|
+
Enabled: pending
|
4504
|
+
VersionAdded: '1.70'
|
4505
|
+
|
4506
|
+
Style/ItBlockParameter:
|
4507
|
+
Description: 'Checks for blocks with one argument where `it` block parameter can be used.'
|
4508
|
+
Enabled: pending
|
4509
|
+
EnforcedStyle: allow_single_line
|
4510
|
+
SupportedStyles:
|
4511
|
+
- allow_single_line
|
4512
|
+
- only_numbered_parameters
|
4513
|
+
- always
|
4514
|
+
- disallow
|
4515
|
+
VersionAdded: '1.75'
|
4516
|
+
VersionChanged: '1.76'
|
4517
|
+
|
4518
|
+
Style/KeywordArgumentsMerging:
|
4519
|
+
Description: >-
|
4520
|
+
When passing an existing hash as keyword arguments, provide additional arguments
|
4521
|
+
directly rather than using `merge`.
|
4522
|
+
StyleGuide: '#merging-keyword-arguments'
|
4523
|
+
Enabled: pending
|
4524
|
+
VersionAdded: '1.68'
|
4525
|
+
|
3328
4526
|
Style/KeywordParametersOrder:
|
3329
4527
|
Description: 'Enforces that optional keyword parameters are placed at the end of the parameters list.'
|
3330
4528
|
StyleGuide: '#keyword-parameters-order'
|
3331
|
-
Enabled:
|
4529
|
+
Enabled: true
|
3332
4530
|
VersionAdded: '0.90'
|
4531
|
+
VersionChanged: '1.7'
|
3333
4532
|
|
3334
4533
|
Style/Lambda:
|
3335
4534
|
Description: 'Use the new lambda literal syntax for single-line blocks.'
|
@@ -3363,19 +4562,65 @@ Style/LineEndConcatenation:
|
|
3363
4562
|
VersionAdded: '0.18'
|
3364
4563
|
VersionChanged: '0.64'
|
3365
4564
|
|
4565
|
+
Style/MagicCommentFormat:
|
4566
|
+
Description: 'Use a consistent style for magic comments.'
|
4567
|
+
Enabled: pending
|
4568
|
+
VersionAdded: '1.35'
|
4569
|
+
EnforcedStyle: snake_case
|
4570
|
+
SupportedStyles:
|
4571
|
+
# `snake` will enforce the magic comment is written
|
4572
|
+
# in snake case (words separated by underscores).
|
4573
|
+
# Eg: froze_string_literal: true
|
4574
|
+
- snake_case
|
4575
|
+
# `kebab` will enforce the magic comment is written
|
4576
|
+
# in kebab case (words separated by hyphens).
|
4577
|
+
# Eg: froze-string-literal: true
|
4578
|
+
- kebab_case
|
4579
|
+
DirectiveCapitalization: lowercase
|
4580
|
+
ValueCapitalization: ~
|
4581
|
+
SupportedCapitalizations:
|
4582
|
+
- lowercase
|
4583
|
+
- uppercase
|
4584
|
+
|
4585
|
+
Style/MapCompactWithConditionalBlock:
|
4586
|
+
Description: 'Prefer `select` or `reject` over `map { ... }.compact`.'
|
4587
|
+
Enabled: pending
|
4588
|
+
VersionAdded: '1.30'
|
4589
|
+
|
4590
|
+
Style/MapIntoArray:
|
4591
|
+
Description: 'Checks for usages of `each` with `<<`, `push`, or `append` which can be replaced by `map`.'
|
4592
|
+
StyleGuide: '#functional-code'
|
4593
|
+
Enabled: pending
|
4594
|
+
VersionAdded: '1.63'
|
4595
|
+
VersionChanged: '1.67'
|
4596
|
+
Safe: false
|
4597
|
+
|
4598
|
+
Style/MapToHash:
|
4599
|
+
Description: 'Prefer `to_h` with a block over `map.to_h`.'
|
4600
|
+
Enabled: pending
|
4601
|
+
VersionAdded: '1.24'
|
4602
|
+
Safe: false
|
4603
|
+
|
4604
|
+
Style/MapToSet:
|
4605
|
+
Description: 'Prefer `to_set` with a block over `map.to_set`.'
|
4606
|
+
Enabled: pending
|
4607
|
+
Safe: false
|
4608
|
+
VersionAdded: '1.42'
|
4609
|
+
|
3366
4610
|
Style/MethodCallWithArgsParentheses:
|
3367
4611
|
Description: 'Use parentheses for method calls with arguments.'
|
3368
4612
|
StyleGuide: '#method-invocation-parens'
|
3369
4613
|
Enabled: false
|
3370
4614
|
VersionAdded: '0.47'
|
3371
|
-
VersionChanged: '
|
4615
|
+
VersionChanged: '1.7'
|
3372
4616
|
IgnoreMacros: true
|
3373
|
-
|
3374
|
-
|
4617
|
+
AllowedMethods: []
|
4618
|
+
AllowedPatterns: []
|
3375
4619
|
IncludedMacros: []
|
3376
4620
|
AllowParenthesesInMultilineCall: false
|
3377
4621
|
AllowParenthesesInChaining: false
|
3378
4622
|
AllowParenthesesInCamelCaseMethod: false
|
4623
|
+
AllowParenthesesInStringInterpolation: false
|
3379
4624
|
EnforcedStyle: require_parentheses
|
3380
4625
|
SupportedStyles:
|
3381
4626
|
- require_parentheses
|
@@ -3385,7 +4630,8 @@ Style/MethodCallWithoutArgsParentheses:
|
|
3385
4630
|
Description: 'Do not use parentheses for method calls with no arguments.'
|
3386
4631
|
StyleGuide: '#method-invocation-parens'
|
3387
4632
|
Enabled: true
|
3388
|
-
|
4633
|
+
AllowedMethods: []
|
4634
|
+
AllowedPatterns: []
|
3389
4635
|
VersionAdded: '0.47'
|
3390
4636
|
VersionChanged: '0.55'
|
3391
4637
|
|
@@ -3402,7 +4648,7 @@ Style/MethodDefParentheses:
|
|
3402
4648
|
StyleGuide: '#method-parens'
|
3403
4649
|
Enabled: true
|
3404
4650
|
VersionAdded: '0.16'
|
3405
|
-
VersionChanged: '
|
4651
|
+
VersionChanged: '1.7'
|
3406
4652
|
EnforcedStyle: require_parentheses
|
3407
4653
|
SupportedStyles:
|
3408
4654
|
- require_parentheses
|
@@ -3416,6 +4662,12 @@ Style/MinMax:
|
|
3416
4662
|
Enabled: true
|
3417
4663
|
VersionAdded: '0.50'
|
3418
4664
|
|
4665
|
+
Style/MinMaxComparison:
|
4666
|
+
Description: 'Enforces the use of `max` or `min` instead of comparison for greater or less.'
|
4667
|
+
Enabled: pending
|
4668
|
+
Safe: false
|
4669
|
+
VersionAdded: '1.42'
|
4670
|
+
|
3419
4671
|
Style/MissingElse:
|
3420
4672
|
Description: >-
|
3421
4673
|
Require if/case expressions to have an else branches.
|
@@ -3494,6 +4746,12 @@ Style/MultilineIfThen:
|
|
3494
4746
|
VersionAdded: '0.9'
|
3495
4747
|
VersionChanged: '0.26'
|
3496
4748
|
|
4749
|
+
Style/MultilineInPatternThen:
|
4750
|
+
Description: 'Do not use `then` for multi-line `in` statement.'
|
4751
|
+
StyleGuide: '#no-then'
|
4752
|
+
Enabled: pending
|
4753
|
+
VersionAdded: '1.16'
|
4754
|
+
|
3497
4755
|
Style/MultilineMemoization:
|
3498
4756
|
Description: 'Wrap multiline memoizations in a `begin` and `end` block.'
|
3499
4757
|
Enabled: true
|
@@ -3508,6 +4766,7 @@ Style/MultilineMethodSignature:
|
|
3508
4766
|
Description: 'Avoid multi-line method signatures.'
|
3509
4767
|
Enabled: false
|
3510
4768
|
VersionAdded: '0.59'
|
4769
|
+
VersionChanged: '1.7'
|
3511
4770
|
|
3512
4771
|
Style/MultilineTernaryOperator:
|
3513
4772
|
Description: >-
|
@@ -3530,12 +4789,16 @@ Style/MultipleComparison:
|
|
3530
4789
|
use Array#include? instead.
|
3531
4790
|
Enabled: true
|
3532
4791
|
VersionAdded: '0.49'
|
4792
|
+
VersionChanged: '1.1'
|
4793
|
+
AllowMethodComparison: true
|
4794
|
+
ComparisonsThreshold: 2
|
3533
4795
|
|
3534
4796
|
Style/MutableConstant:
|
3535
4797
|
Description: 'Do not assign mutable objects to constants.'
|
3536
4798
|
Enabled: true
|
3537
4799
|
VersionAdded: '0.34'
|
3538
|
-
VersionChanged: '
|
4800
|
+
VersionChanged: '1.8'
|
4801
|
+
SafeAutoCorrect: false
|
3539
4802
|
EnforcedStyle: literals
|
3540
4803
|
SupportedStyles:
|
3541
4804
|
# literals: freeze literals assigned to constants
|
@@ -3564,6 +4827,13 @@ Style/NegatedIf:
|
|
3564
4827
|
- prefix
|
3565
4828
|
- postfix
|
3566
4829
|
|
4830
|
+
Style/NegatedIfElseCondition:
|
4831
|
+
Description: >-
|
4832
|
+
Checks for uses of `if-else` and ternary operators with a negated condition
|
4833
|
+
which can be simplified by inverting condition and swapping branches.
|
4834
|
+
Enabled: pending
|
4835
|
+
VersionAdded: '1.2'
|
4836
|
+
|
3567
4837
|
Style/NegatedUnless:
|
3568
4838
|
Description: 'Favor if over unless for negative conditions.'
|
3569
4839
|
StyleGuide: '#if-for-negatives'
|
@@ -3584,6 +4854,11 @@ Style/NegatedWhile:
|
|
3584
4854
|
Enabled: true
|
3585
4855
|
VersionAdded: '0.20'
|
3586
4856
|
|
4857
|
+
Style/NestedFileDirname:
|
4858
|
+
Description: 'Checks for nested `File.dirname`.'
|
4859
|
+
Enabled: pending
|
4860
|
+
VersionAdded: '1.26'
|
4861
|
+
|
3587
4862
|
Style/NestedModifier:
|
3588
4863
|
Description: 'Avoid using nested modifiers.'
|
3589
4864
|
StyleGuide: '#no-nested-modifiers'
|
@@ -3628,7 +4903,7 @@ Style/Next:
|
|
3628
4903
|
StyleGuide: '#no-nested-conditionals'
|
3629
4904
|
Enabled: true
|
3630
4905
|
VersionAdded: '0.22'
|
3631
|
-
VersionChanged: '
|
4906
|
+
VersionChanged: '1.75'
|
3632
4907
|
# With `always` all conditions at the end of an iteration needs to be
|
3633
4908
|
# replaced by next - with `skip_modifier_ifs` the modifier if like this one
|
3634
4909
|
# are ignored: [1, 2].each { |a| return 'yes' if a == 1 }
|
@@ -3636,6 +4911,7 @@ Style/Next:
|
|
3636
4911
|
# `MinBodyLength` defines the number of lines of the a body of an `if` or `unless`
|
3637
4912
|
# needs to have to trigger this cop
|
3638
4913
|
MinBodyLength: 3
|
4914
|
+
AllowConsecutiveConditionals: false
|
3639
4915
|
SupportedStyles:
|
3640
4916
|
- skip_modifier_ifs
|
3641
4917
|
- always
|
@@ -3651,6 +4927,12 @@ Style/NilComparison:
|
|
3651
4927
|
- predicate
|
3652
4928
|
- comparison
|
3653
4929
|
|
4930
|
+
Style/NilLambda:
|
4931
|
+
Description: 'Prefer `-> {}` to `-> { nil }`.'
|
4932
|
+
Enabled: pending
|
4933
|
+
VersionAdded: '1.3'
|
4934
|
+
VersionChanged: '1.15'
|
4935
|
+
|
3654
4936
|
Style/NonNilCheck:
|
3655
4937
|
Description: 'Checks for redundant nil checks.'
|
3656
4938
|
StyleGuide: '#no-non-nil-checks'
|
@@ -3672,6 +4954,21 @@ Style/Not:
|
|
3672
4954
|
VersionAdded: '0.9'
|
3673
4955
|
VersionChanged: '0.20'
|
3674
4956
|
|
4957
|
+
Style/NumberedParameters:
|
4958
|
+
Description: 'Restrict the usage of numbered parameters.'
|
4959
|
+
Enabled: pending
|
4960
|
+
VersionAdded: '1.22'
|
4961
|
+
EnforcedStyle: allow_single_line
|
4962
|
+
SupportedStyles:
|
4963
|
+
- allow_single_line
|
4964
|
+
- disallow
|
4965
|
+
|
4966
|
+
Style/NumberedParametersLimit:
|
4967
|
+
Description: 'Avoid excessive numbered params in a single block.'
|
4968
|
+
Enabled: pending
|
4969
|
+
VersionAdded: '1.22'
|
4970
|
+
Max: 1
|
4971
|
+
|
3675
4972
|
Style/NumericLiteralPrefix:
|
3676
4973
|
Description: 'Use smallcase prefixes for numeric literals.'
|
3677
4974
|
StyleGuide: '#numeric-literal-prefixes'
|
@@ -3682,7 +4979,6 @@ Style/NumericLiteralPrefix:
|
|
3682
4979
|
- zero_with_o
|
3683
4980
|
- zero_only
|
3684
4981
|
|
3685
|
-
|
3686
4982
|
Style/NumericLiterals:
|
3687
4983
|
Description: >-
|
3688
4984
|
Add underscores to large numeric literals to improve their
|
@@ -3693,17 +4989,19 @@ Style/NumericLiterals:
|
|
3693
4989
|
VersionChanged: '0.48'
|
3694
4990
|
MinDigits: 5
|
3695
4991
|
Strict: false
|
4992
|
+
# You can specify allowed numbers. (e.g. port number 3000, 8080, and etc)
|
4993
|
+
AllowedNumbers: []
|
4994
|
+
AllowedPatterns: []
|
3696
4995
|
|
3697
4996
|
Style/NumericPredicate:
|
3698
4997
|
Description: >-
|
3699
4998
|
Checks for the use of predicate- or comparison methods for
|
3700
4999
|
numeric comparisons.
|
3701
5000
|
StyleGuide: '#predicate-methods'
|
3702
|
-
Safe: false
|
3703
5001
|
# This will change to a new method call which isn't guaranteed to be on the
|
3704
5002
|
# object. Switching these methods has to be done with knowledge of the types
|
3705
5003
|
# of the variables which rubocop doesn't have.
|
3706
|
-
|
5004
|
+
Safe: false
|
3707
5005
|
Enabled: true
|
3708
5006
|
VersionAdded: '0.42'
|
3709
5007
|
VersionChanged: '0.59'
|
@@ -3711,12 +5009,26 @@ Style/NumericPredicate:
|
|
3711
5009
|
SupportedStyles:
|
3712
5010
|
- predicate
|
3713
5011
|
- comparison
|
3714
|
-
|
5012
|
+
AllowedMethods: []
|
5013
|
+
AllowedPatterns: []
|
3715
5014
|
# Exclude RSpec specs because assertions like `expect(1).to be > 0` cause
|
3716
5015
|
# false positives.
|
3717
5016
|
Exclude:
|
3718
5017
|
- 'spec/**/*'
|
3719
5018
|
|
5019
|
+
Style/ObjectThen:
|
5020
|
+
Description: 'Enforces the use of consistent method names `Object#yield_self` or `Object#then`.'
|
5021
|
+
StyleGuide: '#object-yield-self-vs-object-then'
|
5022
|
+
Enabled: pending
|
5023
|
+
VersionAdded: '1.28'
|
5024
|
+
# Use `Object#yield_self` or `Object#then`?
|
5025
|
+
# Prefer `Object#yield_self` to `Object#then` (yield_self)
|
5026
|
+
# Prefer `Object#then` to `Object#yield_self` (then)
|
5027
|
+
EnforcedStyle: 'then'
|
5028
|
+
SupportedStyles:
|
5029
|
+
- then
|
5030
|
+
- yield_self
|
5031
|
+
|
3720
5032
|
Style/OneLineConditional:
|
3721
5033
|
Description: >-
|
3722
5034
|
Favor the ternary operator (?:) or multi-line constructs over
|
@@ -3727,8 +5039,27 @@ Style/OneLineConditional:
|
|
3727
5039
|
VersionAdded: '0.9'
|
3728
5040
|
VersionChanged: '0.90'
|
3729
5041
|
|
5042
|
+
Style/OpenStructUse:
|
5043
|
+
Description: >-
|
5044
|
+
Avoid using OpenStruct. As of Ruby 3.0, use is officially discouraged due to performance,
|
5045
|
+
version compatibility, and potential security issues.
|
5046
|
+
References:
|
5047
|
+
- https://docs.ruby-lang.org/en/3.0/OpenStruct.html#class-OpenStruct-label-Caveats
|
5048
|
+
|
5049
|
+
Enabled: pending
|
5050
|
+
Safe: false
|
5051
|
+
VersionAdded: '1.23'
|
5052
|
+
VersionChanged: '1.51'
|
5053
|
+
|
5054
|
+
Style/OperatorMethodCall:
|
5055
|
+
Description: 'Checks for redundant dot before operator method call.'
|
5056
|
+
StyleGuide: '#operator-method-call'
|
5057
|
+
Enabled: pending
|
5058
|
+
VersionAdded: '1.37'
|
5059
|
+
|
3730
5060
|
Style/OptionHash:
|
3731
5061
|
Description: "Don't use option hashes when you can use keyword arguments."
|
5062
|
+
StyleGuide: '#keyword-arguments-vs-option-hashes'
|
3732
5063
|
Enabled: false
|
3733
5064
|
VersionAdded: '0.33'
|
3734
5065
|
VersionChanged: '0.34'
|
@@ -3739,6 +5070,7 @@ Style/OptionHash:
|
|
3739
5070
|
- args
|
3740
5071
|
- params
|
3741
5072
|
- parameters
|
5073
|
+
Allowlist: []
|
3742
5074
|
|
3743
5075
|
Style/OptionalArguments:
|
3744
5076
|
Description: >-
|
@@ -3753,7 +5085,7 @@ Style/OptionalArguments:
|
|
3753
5085
|
Style/OptionalBooleanParameter:
|
3754
5086
|
Description: 'Use keyword arguments when defining method with boolean argument.'
|
3755
5087
|
StyleGuide: '#boolean-keyword-arguments'
|
3756
|
-
Enabled:
|
5088
|
+
Enabled: true
|
3757
5089
|
Safe: false
|
3758
5090
|
VersionAdded: '0.89'
|
3759
5091
|
AllowedMethods:
|
@@ -3800,7 +5132,7 @@ Style/PercentLiteralDelimiters:
|
|
3800
5132
|
'%r': '{}'
|
3801
5133
|
'%w': '[]'
|
3802
5134
|
'%W': '[]'
|
3803
|
-
VersionChanged: '0.48
|
5135
|
+
VersionChanged: '0.48'
|
3804
5136
|
|
3805
5137
|
Style/PercentQLiterals:
|
3806
5138
|
Description: 'Checks if uses of %Q/%q match the configured preference.'
|
@@ -3836,16 +5168,28 @@ Style/Proc:
|
|
3836
5168
|
VersionAdded: '0.9'
|
3837
5169
|
VersionChanged: '0.18'
|
3838
5170
|
|
5171
|
+
Style/QuotedSymbols:
|
5172
|
+
Description: 'Use a consistent style for quoted symbols.'
|
5173
|
+
Enabled: pending
|
5174
|
+
VersionAdded: '1.16'
|
5175
|
+
EnforcedStyle: same_as_string_literals
|
5176
|
+
SupportedStyles:
|
5177
|
+
- same_as_string_literals
|
5178
|
+
- single_quotes
|
5179
|
+
- double_quotes
|
5180
|
+
|
3839
5181
|
Style/RaiseArgs:
|
3840
5182
|
Description: 'Checks the arguments passed to raise/fail.'
|
3841
5183
|
StyleGuide: '#exception-class-messages'
|
3842
5184
|
Enabled: true
|
5185
|
+
Safe: false
|
3843
5186
|
VersionAdded: '0.14'
|
3844
|
-
VersionChanged: '
|
5187
|
+
VersionChanged: '1.61'
|
3845
5188
|
EnforcedStyle: exploded
|
3846
5189
|
SupportedStyles:
|
3847
5190
|
- compact # raise Exception.new(msg)
|
3848
5191
|
- exploded # raise Exception, msg
|
5192
|
+
AllowedCompactTypes: []
|
3849
5193
|
|
3850
5194
|
Style/RandomWithOffset:
|
3851
5195
|
Description: >-
|
@@ -3855,9 +5199,42 @@ Style/RandomWithOffset:
|
|
3855
5199
|
Enabled: true
|
3856
5200
|
VersionAdded: '0.52'
|
3857
5201
|
|
5202
|
+
Style/RedundantArgument:
|
5203
|
+
Description: 'Checks for a redundant argument passed to certain methods.'
|
5204
|
+
Enabled: pending
|
5205
|
+
Safe: false
|
5206
|
+
VersionAdded: '1.4'
|
5207
|
+
VersionChanged: '1.55'
|
5208
|
+
Methods:
|
5209
|
+
# Array#join
|
5210
|
+
join: ''
|
5211
|
+
# Array#sum
|
5212
|
+
sum: 0
|
5213
|
+
# Kernel.#exit
|
5214
|
+
exit: true
|
5215
|
+
# Kernel.#exit!
|
5216
|
+
exit!: false
|
5217
|
+
# String#split
|
5218
|
+
split: ' '
|
5219
|
+
# String#chomp
|
5220
|
+
chomp: "\n"
|
5221
|
+
# String#chomp!
|
5222
|
+
chomp!: "\n"
|
5223
|
+
|
5224
|
+
Style/RedundantArrayConstructor:
|
5225
|
+
Description: 'Checks for the instantiation of array using redundant `Array` constructor.'
|
5226
|
+
Enabled: pending
|
5227
|
+
VersionAdded: '1.52'
|
5228
|
+
|
5229
|
+
Style/RedundantArrayFlatten:
|
5230
|
+
Description: 'Checks for redundant calls of `Array#flatten`.'
|
5231
|
+
Enabled: pending
|
5232
|
+
Safe: false
|
5233
|
+
VersionAdded: '1.76'
|
5234
|
+
|
3858
5235
|
Style/RedundantAssignment:
|
3859
5236
|
Description: 'Checks for redundant assignment before returning.'
|
3860
|
-
Enabled:
|
5237
|
+
Enabled: true
|
3861
5238
|
VersionAdded: '0.87'
|
3862
5239
|
|
3863
5240
|
Style/RedundantBegin:
|
@@ -3876,12 +5253,36 @@ Style/RedundantCondition:
|
|
3876
5253
|
Description: 'Checks for unnecessary conditional expressions.'
|
3877
5254
|
Enabled: true
|
3878
5255
|
VersionAdded: '0.76'
|
5256
|
+
VersionChanged: '1.73'
|
5257
|
+
AllowedMethods:
|
5258
|
+
- nonzero?
|
3879
5259
|
|
3880
5260
|
Style/RedundantConditional:
|
3881
5261
|
Description: "Don't return true/false from a conditional."
|
3882
5262
|
Enabled: true
|
3883
5263
|
VersionAdded: '0.50'
|
3884
5264
|
|
5265
|
+
Style/RedundantConstantBase:
|
5266
|
+
Description: Avoid redundant `::` prefix on constant.
|
5267
|
+
Enabled: pending
|
5268
|
+
VersionAdded: '1.40'
|
5269
|
+
|
5270
|
+
Style/RedundantCurrentDirectoryInPath:
|
5271
|
+
Description: 'Checks for a redundant current directory in a path given to `require_relative`.'
|
5272
|
+
Enabled: pending
|
5273
|
+
VersionAdded: '1.53'
|
5274
|
+
|
5275
|
+
Style/RedundantDoubleSplatHashBraces:
|
5276
|
+
Description: 'Checks for redundant uses of double splat hash braces.'
|
5277
|
+
Enabled: pending
|
5278
|
+
VersionAdded: '1.41'
|
5279
|
+
|
5280
|
+
Style/RedundantEach:
|
5281
|
+
Description: 'Checks for redundant `each`.'
|
5282
|
+
Enabled: pending
|
5283
|
+
Safe: false
|
5284
|
+
VersionAdded: '1.38'
|
5285
|
+
|
3885
5286
|
Style/RedundantException:
|
3886
5287
|
Description: "Checks for an obsolete RuntimeException argument in raise/fail."
|
3887
5288
|
StyleGuide: '#no-explicit-runtimeerror'
|
@@ -3893,8 +5294,9 @@ Style/RedundantFetchBlock:
|
|
3893
5294
|
Description: >-
|
3894
5295
|
Use `fetch(key, value)` instead of `fetch(key) { value }`
|
3895
5296
|
when value has Numeric, Rational, Complex, Symbol or String type, `false`, `true`, `nil` or is a constant.
|
3896
|
-
|
3897
|
-
|
5297
|
+
References:
|
5298
|
+
- 'https://github.com/fastruby/fast-ruby#hashfetch-with-argument-vs-hashfetch--block-code'
|
5299
|
+
Enabled: true
|
3898
5300
|
Safe: false
|
3899
5301
|
# If enabled, this cop will autocorrect usages of
|
3900
5302
|
# `fetch` being called with block returning a constant.
|
@@ -3907,19 +5309,61 @@ Style/RedundantFileExtensionInRequire:
|
|
3907
5309
|
Checks for the presence of superfluous `.rb` extension in
|
3908
5310
|
the filename provided to `require` and `require_relative`.
|
3909
5311
|
StyleGuide: '#no-explicit-rb-to-require'
|
3910
|
-
Enabled:
|
5312
|
+
Enabled: true
|
3911
5313
|
VersionAdded: '0.88'
|
3912
5314
|
|
5315
|
+
Style/RedundantFilterChain:
|
5316
|
+
Description: >-
|
5317
|
+
Identifies usages of `any?`, `empty?`, `none?` or `one?` predicate methods chained to
|
5318
|
+
`select`/`filter`/`find_all` and change them to use predicate method instead.
|
5319
|
+
Enabled: pending
|
5320
|
+
SafeAutoCorrect: false
|
5321
|
+
VersionAdded: '1.52'
|
5322
|
+
VersionChanged: '1.57'
|
5323
|
+
|
5324
|
+
Style/RedundantFormat:
|
5325
|
+
Description: 'Checks for usages of `Kernel#format` or `Kernel#sprintf` with only a single argument.'
|
5326
|
+
Enabled: pending
|
5327
|
+
SafeAutoCorrect: false
|
5328
|
+
VersionAdded: '1.72'
|
5329
|
+
VersionChanged: '1.72'
|
5330
|
+
|
3913
5331
|
Style/RedundantFreeze:
|
3914
5332
|
Description: "Checks usages of Object#freeze on immutable objects."
|
3915
5333
|
Enabled: true
|
3916
5334
|
VersionAdded: '0.34'
|
3917
5335
|
VersionChanged: '0.66'
|
3918
5336
|
|
5337
|
+
Style/RedundantHeredocDelimiterQuotes:
|
5338
|
+
Description: 'Checks for redundant heredoc delimiter quotes.'
|
5339
|
+
Enabled: pending
|
5340
|
+
VersionAdded: '1.45'
|
5341
|
+
|
5342
|
+
Style/RedundantInitialize:
|
5343
|
+
Description: 'Checks for redundant `initialize` methods.'
|
5344
|
+
Enabled: pending
|
5345
|
+
AutoCorrect: contextual
|
5346
|
+
Safe: false
|
5347
|
+
AllowComments: true
|
5348
|
+
VersionAdded: '1.27'
|
5349
|
+
VersionChanged: '1.61'
|
5350
|
+
|
3919
5351
|
Style/RedundantInterpolation:
|
3920
5352
|
Description: 'Checks for strings that are just an interpolated expression.'
|
3921
5353
|
Enabled: true
|
5354
|
+
SafeAutoCorrect: false
|
3922
5355
|
VersionAdded: '0.76'
|
5356
|
+
VersionChanged: '1.30'
|
5357
|
+
|
5358
|
+
Style/RedundantInterpolationUnfreeze:
|
5359
|
+
Description: 'Checks for redundant unfreezing of interpolated strings.'
|
5360
|
+
Enabled: pending
|
5361
|
+
VersionAdded: '1.66'
|
5362
|
+
|
5363
|
+
Style/RedundantLineContinuation:
|
5364
|
+
Description: 'Checks for redundant line continuation.'
|
5365
|
+
Enabled: pending
|
5366
|
+
VersionAdded: '1.49'
|
3923
5367
|
|
3924
5368
|
Style/RedundantParentheses:
|
3925
5369
|
Description: "Checks for parentheses that seem not to serve any purpose."
|
@@ -3932,14 +5376,24 @@ Style/RedundantPercentQ:
|
|
3932
5376
|
Enabled: true
|
3933
5377
|
VersionAdded: '0.76'
|
3934
5378
|
|
5379
|
+
Style/RedundantRegexpArgument:
|
5380
|
+
Description: 'Identifies places where argument can be replaced from a deterministic regexp to a string.'
|
5381
|
+
Enabled: pending
|
5382
|
+
VersionAdded: '1.53'
|
5383
|
+
|
3935
5384
|
Style/RedundantRegexpCharacterClass:
|
3936
5385
|
Description: 'Checks for unnecessary single-element Regexp character classes.'
|
3937
|
-
Enabled:
|
5386
|
+
Enabled: true
|
3938
5387
|
VersionAdded: '0.85'
|
3939
5388
|
|
5389
|
+
Style/RedundantRegexpConstructor:
|
5390
|
+
Description: 'Checks for the instantiation of regexp using redundant `Regexp.new` or `Regexp.compile`.'
|
5391
|
+
Enabled: pending
|
5392
|
+
VersionAdded: '1.52'
|
5393
|
+
|
3940
5394
|
Style/RedundantRegexpEscape:
|
3941
5395
|
Description: 'Checks for redundant escapes in Regexps.'
|
3942
|
-
Enabled:
|
5396
|
+
Enabled: true
|
3943
5397
|
VersionAdded: '0.85'
|
3944
5398
|
|
3945
5399
|
Style/RedundantReturn:
|
@@ -3960,22 +5414,34 @@ Style/RedundantSelf:
|
|
3960
5414
|
|
3961
5415
|
Style/RedundantSelfAssignment:
|
3962
5416
|
Description: 'Checks for places where redundant assignments are made for in place modification methods.'
|
3963
|
-
Enabled:
|
5417
|
+
Enabled: true
|
3964
5418
|
Safe: false
|
3965
5419
|
VersionAdded: '0.90'
|
3966
5420
|
|
5421
|
+
Style/RedundantSelfAssignmentBranch:
|
5422
|
+
Description: 'Checks for places where conditional branch makes redundant self-assignment.'
|
5423
|
+
Enabled: pending
|
5424
|
+
VersionAdded: '1.19'
|
5425
|
+
|
3967
5426
|
Style/RedundantSort:
|
3968
5427
|
Description: >-
|
3969
5428
|
Use `min` instead of `sort.first`,
|
3970
5429
|
`max_by` instead of `sort_by...last`, etc.
|
3971
5430
|
Enabled: true
|
3972
5431
|
VersionAdded: '0.76'
|
5432
|
+
VersionChanged: '1.22'
|
5433
|
+
Safe: false
|
3973
5434
|
|
3974
5435
|
Style/RedundantSortBy:
|
3975
5436
|
Description: 'Use `sort` instead of `sort_by { |x| x }`.'
|
3976
5437
|
Enabled: true
|
3977
5438
|
VersionAdded: '0.36'
|
3978
5439
|
|
5440
|
+
Style/RedundantStringEscape:
|
5441
|
+
Description: 'Checks for redundant escapes in string literals.'
|
5442
|
+
Enabled: pending
|
5443
|
+
VersionAdded: '1.37'
|
5444
|
+
|
3979
5445
|
Style/RegexpLiteral:
|
3980
5446
|
Description: 'Use / or %r around regular expressions.'
|
3981
5447
|
StyleGuide: '#percent-r'
|
@@ -3994,6 +5460,12 @@ Style/RegexpLiteral:
|
|
3994
5460
|
# are found in the regexp string.
|
3995
5461
|
AllowInnerSlashes: false
|
3996
5462
|
|
5463
|
+
Style/RequireOrder:
|
5464
|
+
Description: Sort `require` and `require_relative` in alphabetical order.
|
5465
|
+
Enabled: false
|
5466
|
+
SafeAutoCorrect: false
|
5467
|
+
VersionAdded: '1.40'
|
5468
|
+
|
3997
5469
|
Style/RescueModifier:
|
3998
5470
|
Description: 'Avoid using rescue in its modifier form.'
|
3999
5471
|
StyleGuide: '#no-rescue-modifiers'
|
@@ -4021,16 +5493,26 @@ Style/ReturnNil:
|
|
4021
5493
|
- return_nil
|
4022
5494
|
VersionAdded: '0.50'
|
4023
5495
|
|
5496
|
+
Style/ReturnNilInPredicateMethodDefinition:
|
5497
|
+
Description: 'Checks if uses of `return` or `return nil` in predicate method definition.'
|
5498
|
+
StyleGuide: '#bool-methods-qmark'
|
5499
|
+
Enabled: pending
|
5500
|
+
SafeAutoCorrect: false
|
5501
|
+
AllowedMethods: []
|
5502
|
+
AllowedPatterns: []
|
5503
|
+
VersionAdded: '1.53'
|
5504
|
+
VersionChanged: '1.67'
|
5505
|
+
|
4024
5506
|
Style/SafeNavigation:
|
4025
5507
|
Description: >-
|
4026
|
-
|
5508
|
+
Transforms usages of a method call safeguarded by
|
4027
5509
|
a check for the existence of the object to
|
4028
5510
|
safe navigation (`&.`).
|
4029
|
-
|
5511
|
+
Autocorrection is unsafe as it assumes the object will
|
4030
5512
|
be `nil` or truthy, but never `false`.
|
4031
5513
|
Enabled: true
|
4032
5514
|
VersionAdded: '0.43'
|
4033
|
-
VersionChanged: '
|
5515
|
+
VersionChanged: '1.67'
|
4034
5516
|
# Safe navigation may cause a statement to start returning `nil` in addition
|
4035
5517
|
# to whatever it used to return.
|
4036
5518
|
ConvertCodeThatCanStartToReturnNil: false
|
@@ -4041,15 +5523,31 @@ Style/SafeNavigation:
|
|
4041
5523
|
- try
|
4042
5524
|
- try!
|
4043
5525
|
SafeAutoCorrect: false
|
5526
|
+
# Maximum length of method chains for register an offense.
|
5527
|
+
MaxChainLength: 2
|
5528
|
+
|
5529
|
+
Style/SafeNavigationChainLength:
|
5530
|
+
Description: 'Enforces safe navigation chains length to not exceed the configured maximum.'
|
5531
|
+
StyleGuide: '#safe-navigation'
|
5532
|
+
Enabled: pending
|
5533
|
+
VersionAdded: '1.68'
|
5534
|
+
Max: 2
|
4044
5535
|
|
4045
5536
|
Style/Sample:
|
4046
5537
|
Description: >-
|
4047
5538
|
Use `sample` instead of `shuffle.first`,
|
4048
5539
|
`shuffle.last`, and `shuffle[Integer]`.
|
4049
|
-
|
5540
|
+
References:
|
5541
|
+
- 'https://github.com/fastruby/fast-ruby#arrayshufflefirst-vs-arraysample-code'
|
4050
5542
|
Enabled: true
|
4051
5543
|
VersionAdded: '0.30'
|
4052
5544
|
|
5545
|
+
Style/SelectByRegexp:
|
5546
|
+
Description: 'Prefer grep/grep_v to select/reject with a regexp match.'
|
5547
|
+
Enabled: pending
|
5548
|
+
SafeAutoCorrect: false
|
5549
|
+
VersionAdded: '1.22'
|
5550
|
+
|
4053
5551
|
Style/SelfAssignment:
|
4054
5552
|
Description: >-
|
4055
5553
|
Checks for places where self-assignment shorthand should have
|
@@ -4074,6 +5572,13 @@ Style/Send:
|
|
4074
5572
|
Enabled: false
|
4075
5573
|
VersionAdded: '0.33'
|
4076
5574
|
|
5575
|
+
Style/SendWithLiteralMethodName:
|
5576
|
+
Description: 'Detects the use of the `public_send` method with a static method name argument.'
|
5577
|
+
Enabled: pending
|
5578
|
+
Safe: false
|
5579
|
+
AllowSend: true
|
5580
|
+
VersionAdded: '1.64'
|
5581
|
+
|
4077
5582
|
Style/SignalException:
|
4078
5583
|
Description: 'Checks for proper usage of fail and raise.'
|
4079
5584
|
StyleGuide: '#prefer-raise-over-fail'
|
@@ -4088,7 +5593,7 @@ Style/SignalException:
|
|
4088
5593
|
|
4089
5594
|
Style/SingleArgumentDig:
|
4090
5595
|
Description: 'Avoid using single argument dig method.'
|
4091
|
-
Enabled:
|
5596
|
+
Enabled: true
|
4092
5597
|
VersionAdded: '0.89'
|
4093
5598
|
Safe: false
|
4094
5599
|
|
@@ -4096,7 +5601,7 @@ Style/SingleLineBlockParams:
|
|
4096
5601
|
Description: 'Enforces the names of some block params.'
|
4097
5602
|
Enabled: false
|
4098
5603
|
VersionAdded: '0.16'
|
4099
|
-
VersionChanged: '
|
5604
|
+
VersionChanged: '1.6'
|
4100
5605
|
Methods:
|
4101
5606
|
- reduce:
|
4102
5607
|
- acc
|
@@ -4105,17 +5610,24 @@ Style/SingleLineBlockParams:
|
|
4105
5610
|
- acc
|
4106
5611
|
- elem
|
4107
5612
|
|
5613
|
+
Style/SingleLineDoEndBlock:
|
5614
|
+
Description: 'Checks for single-line `do`...`end` blocks.'
|
5615
|
+
StyleGuide: '#single-line-do-end-block'
|
5616
|
+
Enabled: pending
|
5617
|
+
VersionAdded: '1.57'
|
5618
|
+
|
4108
5619
|
Style/SingleLineMethods:
|
4109
5620
|
Description: 'Avoid single-line methods.'
|
4110
5621
|
StyleGuide: '#no-single-line-methods'
|
4111
5622
|
Enabled: true
|
4112
5623
|
VersionAdded: '0.9'
|
4113
|
-
VersionChanged: '
|
5624
|
+
VersionChanged: '1.8'
|
4114
5625
|
AllowIfMethodIsEmpty: true
|
4115
5626
|
|
4116
5627
|
Style/SlicingWithRange:
|
4117
|
-
Description: 'Checks array slicing is done with endless ranges when suitable.'
|
4118
|
-
|
5628
|
+
Description: 'Checks array slicing is done with redundant, endless, and beginless ranges when suitable.'
|
5629
|
+
StyleGuide: '#slicing-with-ranges'
|
5630
|
+
Enabled: true
|
4119
5631
|
VersionAdded: '0.83'
|
4120
5632
|
Safe: false
|
4121
5633
|
|
@@ -4123,8 +5635,9 @@ Style/SoleNestedConditional:
|
|
4123
5635
|
Description: >-
|
4124
5636
|
Finds sole nested conditional nodes
|
4125
5637
|
which can be merged into outer conditional node.
|
4126
|
-
Enabled:
|
5638
|
+
Enabled: true
|
4127
5639
|
VersionAdded: '0.89'
|
5640
|
+
VersionChanged: '1.5'
|
4128
5641
|
AllowModifier: false
|
4129
5642
|
|
4130
5643
|
Style/SpecialGlobalVars:
|
@@ -4134,13 +5647,15 @@ Style/SpecialGlobalVars:
|
|
4134
5647
|
VersionAdded: '0.13'
|
4135
5648
|
VersionChanged: '0.36'
|
4136
5649
|
SafeAutoCorrect: false
|
5650
|
+
RequireEnglish: true
|
4137
5651
|
EnforcedStyle: use_english_names
|
4138
5652
|
SupportedStyles:
|
4139
5653
|
- use_perl_names
|
4140
5654
|
- use_english_names
|
5655
|
+
- use_builtin_english_names
|
4141
5656
|
|
4142
5657
|
Style/StabbyLambdaParentheses:
|
4143
|
-
Description: '
|
5658
|
+
Description: 'Checks for the usage of parentheses around stabby lambda arguments.'
|
4144
5659
|
StyleGuide: '#stabby-lambda-with-args'
|
4145
5660
|
Enabled: true
|
4146
5661
|
VersionAdded: '0.35'
|
@@ -4149,18 +5664,34 @@ Style/StabbyLambdaParentheses:
|
|
4149
5664
|
- require_parentheses
|
4150
5665
|
- require_no_parentheses
|
4151
5666
|
|
5667
|
+
Style/StaticClass:
|
5668
|
+
Description: 'Prefer modules to classes with only class methods.'
|
5669
|
+
StyleGuide: '#modules-vs-classes'
|
5670
|
+
Enabled: false
|
5671
|
+
Safe: false
|
5672
|
+
VersionAdded: '1.3'
|
5673
|
+
|
4152
5674
|
Style/StderrPuts:
|
4153
5675
|
Description: 'Use `warn` instead of `$stderr.puts`.'
|
4154
5676
|
StyleGuide: '#warn'
|
4155
5677
|
Enabled: true
|
4156
5678
|
VersionAdded: '0.51'
|
4157
5679
|
|
5680
|
+
Style/StringChars:
|
5681
|
+
Description: 'Checks for uses of `String#split` with empty string or regexp literal argument.'
|
5682
|
+
StyleGuide: '#string-chars'
|
5683
|
+
Enabled: pending
|
5684
|
+
Safe: false
|
5685
|
+
VersionAdded: '1.12'
|
5686
|
+
|
4158
5687
|
Style/StringConcatenation:
|
4159
5688
|
Description: 'Checks for places where string concatenation can be replaced with string interpolation.'
|
4160
5689
|
StyleGuide: '#string-interpolation'
|
4161
|
-
Enabled:
|
5690
|
+
Enabled: true
|
4162
5691
|
Safe: false
|
4163
5692
|
VersionAdded: '0.89'
|
5693
|
+
VersionChanged: '1.18'
|
5694
|
+
Mode: aggressive
|
4164
5695
|
|
4165
5696
|
Style/StringHashKeys:
|
4166
5697
|
Description: 'Prefer symbols instead of strings as hash keys.'
|
@@ -4199,7 +5730,7 @@ Style/StringMethods:
|
|
4199
5730
|
Description: 'Checks if configured preferred methods are used over non-preferred.'
|
4200
5731
|
Enabled: false
|
4201
5732
|
VersionAdded: '0.34'
|
4202
|
-
VersionChanged: '0.34
|
5733
|
+
VersionChanged: '0.34'
|
4203
5734
|
# Mapping from undesired method to desired_method
|
4204
5735
|
# e.g. to use `to_sym` over `intern`:
|
4205
5736
|
#
|
@@ -4218,8 +5749,27 @@ Style/StructInheritance:
|
|
4218
5749
|
Description: 'Checks for inheritance from Struct.new.'
|
4219
5750
|
StyleGuide: '#no-extend-struct-new'
|
4220
5751
|
Enabled: true
|
5752
|
+
SafeAutoCorrect: false
|
4221
5753
|
VersionAdded: '0.29'
|
4222
|
-
VersionChanged: '
|
5754
|
+
VersionChanged: '1.20'
|
5755
|
+
|
5756
|
+
Style/SuperArguments:
|
5757
|
+
Description: 'Call `super` without arguments and parentheses when the signature is identical.'
|
5758
|
+
Enabled: pending
|
5759
|
+
VersionAdded: '1.64'
|
5760
|
+
|
5761
|
+
Style/SuperWithArgsParentheses:
|
5762
|
+
Description: 'Use parentheses for `super` with arguments.'
|
5763
|
+
StyleGuide: '#super-with-args'
|
5764
|
+
Enabled: pending
|
5765
|
+
VersionAdded: '1.58'
|
5766
|
+
|
5767
|
+
Style/SwapValues:
|
5768
|
+
Description: 'Enforces the use of shorthand-style swapping of 2 variables.'
|
5769
|
+
StyleGuide: '#values-swapping'
|
5770
|
+
Enabled: pending
|
5771
|
+
VersionAdded: '1.1'
|
5772
|
+
SafeAutoCorrect: false
|
4223
5773
|
|
4224
5774
|
Style/SymbolArray:
|
4225
5775
|
Description: 'Use %i or %I for arrays of symbols.'
|
@@ -4243,12 +5793,14 @@ Style/SymbolProc:
|
|
4243
5793
|
Enabled: true
|
4244
5794
|
Safe: false
|
4245
5795
|
VersionAdded: '0.26'
|
4246
|
-
VersionChanged: '
|
4247
|
-
|
5796
|
+
VersionChanged: '1.64'
|
5797
|
+
AllowMethodsWithArguments: false
|
5798
|
+
# A list of method names to be always allowed by the check.
|
4248
5799
|
# The names should be fairly unique, otherwise you'll end up ignoring lots of code.
|
4249
|
-
|
4250
|
-
- respond_to
|
5800
|
+
AllowedMethods:
|
4251
5801
|
- define_method
|
5802
|
+
AllowedPatterns: []
|
5803
|
+
AllowComments: false
|
4252
5804
|
|
4253
5805
|
Style/TernaryParentheses:
|
4254
5806
|
Description: 'Checks for use of parentheses around ternary conditions.'
|
@@ -4262,6 +5814,12 @@ Style/TernaryParentheses:
|
|
4262
5814
|
- require_parentheses_when_complex
|
4263
5815
|
AllowSafeAssignment: true
|
4264
5816
|
|
5817
|
+
Style/TopLevelMethodDefinition:
|
5818
|
+
Description: 'Looks for top-level method definitions.'
|
5819
|
+
StyleGuide: '#top-level-methods'
|
5820
|
+
Enabled: false
|
5821
|
+
VersionAdded: '1.15'
|
5822
|
+
|
4265
5823
|
Style/TrailingBodyOnClass:
|
4266
5824
|
Description: 'Class body goes below class statement.'
|
4267
5825
|
Enabled: true
|
@@ -4297,14 +5855,17 @@ Style/TrailingCommaInArrayLiteral:
|
|
4297
5855
|
StyleGuide: '#no-trailing-array-commas'
|
4298
5856
|
Enabled: true
|
4299
5857
|
VersionAdded: '0.53'
|
4300
|
-
# If `comma`, the cop requires a comma after the last item in an array,
|
4301
|
-
#
|
4302
|
-
# If `consistent_comma`, the cop requires a comma after the last item of all
|
4303
|
-
#
|
5858
|
+
# If `comma`, the cop requires a comma after the last item in an array, but only when each item is
|
5859
|
+
# on its own line.
|
5860
|
+
# If `consistent_comma`, the cop requires a comma after the last item of all non-empty, multiline
|
5861
|
+
# array literals.
|
5862
|
+
# If `diff_comma`, the cop requires a comma after the last item of all non-empty, multiline array
|
5863
|
+
# literals, but only when that last item immediately precedes a newline.
|
4304
5864
|
EnforcedStyleForMultiline: no_comma
|
4305
5865
|
SupportedStylesForMultiline:
|
4306
5866
|
- comma
|
4307
5867
|
- consistent_comma
|
5868
|
+
- diff_comma
|
4308
5869
|
- no_comma
|
4309
5870
|
|
4310
5871
|
Style/TrailingCommaInBlockArgs:
|
@@ -4316,14 +5877,17 @@ Style/TrailingCommaInBlockArgs:
|
|
4316
5877
|
Style/TrailingCommaInHashLiteral:
|
4317
5878
|
Description: 'Checks for trailing comma in hash literals.'
|
4318
5879
|
Enabled: true
|
4319
|
-
# If `comma`, the cop requires a comma after the last item in a hash,
|
4320
|
-
#
|
4321
|
-
# If `consistent_comma`, the cop requires a comma after the last item of all
|
4322
|
-
#
|
5880
|
+
# If `comma`, the cop requires a comma after the last item in a hash, but only when each item is
|
5881
|
+
# on its own line.
|
5882
|
+
# If `consistent_comma`, the cop requires a comma after the last item of all non-empty, multiline
|
5883
|
+
# hash literals.
|
5884
|
+
# If `diff_comma`, the cop requires a comma after the last item of all non-empty, multiline hash
|
5885
|
+
# literals, but only when that last item immediately precedes a newline.
|
4323
5886
|
EnforcedStyleForMultiline: no_comma
|
4324
5887
|
SupportedStylesForMultiline:
|
4325
5888
|
- comma
|
4326
5889
|
- consistent_comma
|
5890
|
+
- diff_comma
|
4327
5891
|
- no_comma
|
4328
5892
|
VersionAdded: '0.53'
|
4329
5893
|
|
@@ -4348,7 +5912,7 @@ Style/TrivialAccessors:
|
|
4348
5912
|
StyleGuide: '#attr_family'
|
4349
5913
|
Enabled: true
|
4350
5914
|
VersionAdded: '0.9'
|
4351
|
-
VersionChanged: '
|
5915
|
+
VersionChanged: '1.15'
|
4352
5916
|
# When set to `false` the cop will suggest the use of accessor methods
|
4353
5917
|
# in situations like:
|
4354
5918
|
#
|
@@ -4367,7 +5931,7 @@ Style/TrivialAccessors:
|
|
4367
5931
|
# on_exception :restart
|
4368
5932
|
#
|
4369
5933
|
# Commonly used in DSLs
|
4370
|
-
AllowDSLWriters:
|
5934
|
+
AllowDSLWriters: true
|
4371
5935
|
IgnoreClassMethods: false
|
4372
5936
|
AllowedMethods:
|
4373
5937
|
- to_ary
|
@@ -4396,6 +5960,16 @@ Style/UnlessElse:
|
|
4396
5960
|
Enabled: true
|
4397
5961
|
VersionAdded: '0.9'
|
4398
5962
|
|
5963
|
+
Style/UnlessLogicalOperators:
|
5964
|
+
Description: >-
|
5965
|
+
Checks for use of logical operators in an unless condition.
|
5966
|
+
Enabled: false
|
5967
|
+
VersionAdded: '1.11'
|
5968
|
+
EnforcedStyle: forbid_mixed_logical_operators
|
5969
|
+
SupportedStyles:
|
5970
|
+
- forbid_mixed_logical_operators
|
5971
|
+
- forbid_logical_operators
|
5972
|
+
|
4399
5973
|
Style/UnpackFirst:
|
4400
5974
|
Description: >-
|
4401
5975
|
Checks for accessing the first element of `String#unpack`
|
@@ -4414,7 +5988,7 @@ Style/VariableInterpolation:
|
|
4414
5988
|
|
4415
5989
|
Style/WhenThen:
|
4416
5990
|
Description: 'Use when x then ... for one-line cases.'
|
4417
|
-
StyleGuide: '#
|
5991
|
+
StyleGuide: '#no-when-semicolons'
|
4418
5992
|
Enabled: true
|
4419
5993
|
VersionAdded: '0.9'
|
4420
5994
|
|
@@ -4438,7 +6012,7 @@ Style/WordArray:
|
|
4438
6012
|
StyleGuide: '#percent-w'
|
4439
6013
|
Enabled: true
|
4440
6014
|
VersionAdded: '0.9'
|
4441
|
-
VersionChanged: '
|
6015
|
+
VersionChanged: '1.19'
|
4442
6016
|
EnforcedStyle: percent
|
4443
6017
|
SupportedStyles:
|
4444
6018
|
# percent style: %w(word1 word2)
|
@@ -4452,9 +6026,15 @@ Style/WordArray:
|
|
4452
6026
|
# The regular expression `WordRegex` decides what is considered a word.
|
4453
6027
|
WordRegex: !ruby/regexp '/\A(?:\p{Word}|\p{Word}-\p{Word}|\n|\t)+\z/'
|
4454
6028
|
|
6029
|
+
Style/YAMLFileRead:
|
6030
|
+
Description: 'Checks for the use of `YAML.load`, `YAML.safe_load`, and `YAML.parse` with `File.read` argument.'
|
6031
|
+
Enabled: pending
|
6032
|
+
VersionAdded: '1.53'
|
6033
|
+
|
4455
6034
|
Style/YodaCondition:
|
4456
6035
|
Description: 'Forbid or enforce yoda conditions.'
|
4457
|
-
|
6036
|
+
References:
|
6037
|
+
- 'https://en.wikipedia.org/wiki/Yoda_conditions'
|
4458
6038
|
Enabled: true
|
4459
6039
|
EnforcedStyle: forbid_for_all_comparison_operators
|
4460
6040
|
SupportedStyles:
|
@@ -4470,6 +6050,19 @@ Style/YodaCondition:
|
|
4470
6050
|
VersionAdded: '0.49'
|
4471
6051
|
VersionChanged: '0.75'
|
4472
6052
|
|
6053
|
+
Style/YodaExpression:
|
6054
|
+
Description: 'Forbid the use of yoda expressions.'
|
6055
|
+
Enabled: false
|
6056
|
+
Safe: false
|
6057
|
+
VersionAdded: '1.42'
|
6058
|
+
VersionChanged: '1.43'
|
6059
|
+
SupportedOperators:
|
6060
|
+
- '*'
|
6061
|
+
- '+'
|
6062
|
+
- '&'
|
6063
|
+
- '|'
|
6064
|
+
- '^'
|
6065
|
+
|
4473
6066
|
Style/ZeroLengthPredicate:
|
4474
6067
|
Description: 'Use #empty? when testing for objects of length 0.'
|
4475
6068
|
Enabled: true
|