rubocop 0.85.1 → 0.89.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +16 -4
- data/bin/rubocop-profile +32 -0
- data/config/default.yml +227 -26
- data/lib/rubocop.rb +33 -5
- data/lib/rubocop/cli.rb +2 -4
- data/lib/rubocop/cli/command/auto_genenerate_config.rb +42 -7
- data/lib/rubocop/cli/command/base.rb +1 -0
- data/lib/rubocop/cli/command/execute_runner.rb +1 -1
- data/lib/rubocop/cli/command/init_dotfile.rb +1 -1
- data/lib/rubocop/cli/command/show_cops.rb +2 -2
- data/lib/rubocop/cli/command/version.rb +2 -2
- data/lib/rubocop/comment_config.rb +2 -2
- data/lib/rubocop/config.rb +20 -3
- data/lib/rubocop/config_loader.rb +40 -68
- data/lib/rubocop/config_loader_resolver.rb +4 -4
- data/lib/rubocop/config_obsoletion.rb +6 -2
- data/lib/rubocop/config_store.rb +4 -0
- data/lib/rubocop/config_validator.rb +1 -3
- data/lib/rubocop/cop/autocorrect_logic.rb +14 -24
- data/lib/rubocop/cop/badge.rb +1 -1
- data/lib/rubocop/cop/base.rb +407 -0
- data/lib/rubocop/cop/bundler/insecure_protocol_source.rb +10 -20
- data/lib/rubocop/cop/commissioner.rb +47 -50
- data/lib/rubocop/cop/cop.rb +85 -236
- data/lib/rubocop/cop/corrector.rb +38 -115
- data/lib/rubocop/cop/correctors/line_break_corrector.rb +3 -3
- data/lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb +26 -0
- data/lib/rubocop/cop/correctors/percent_literal_corrector.rb +1 -1
- data/lib/rubocop/cop/correctors/punctuation_corrector.rb +1 -1
- data/lib/rubocop/cop/correctors/unused_arg_corrector.rb +15 -18
- data/lib/rubocop/cop/force.rb +1 -0
- data/lib/rubocop/cop/gemspec/required_ruby_version.rb +39 -13
- data/lib/rubocop/cop/gemspec/ruby_version_globals_usage.rb +1 -1
- data/lib/rubocop/cop/generator.rb +1 -1
- data/lib/rubocop/cop/generator/configuration_injector.rb +3 -3
- data/lib/rubocop/cop/internal_affairs/method_name_equal.rb +4 -12
- data/lib/rubocop/cop/internal_affairs/node_destructuring.rb +1 -1
- data/lib/rubocop/cop/internal_affairs/node_type_predicate.rb +11 -14
- data/lib/rubocop/cop/internal_affairs/offense_location_keyword.rb +8 -8
- data/lib/rubocop/cop/internal_affairs/redundant_location_argument.rb +10 -7
- data/lib/rubocop/cop/internal_affairs/redundant_message_argument.rb +7 -8
- data/lib/rubocop/cop/internal_affairs/useless_message_assertion.rb +2 -2
- data/lib/rubocop/cop/layout/block_alignment.rb +1 -1
- data/lib/rubocop/cop/layout/case_indentation.rb +18 -19
- data/lib/rubocop/cop/layout/class_structure.rb +2 -37
- data/lib/rubocop/cop/layout/comment_indentation.rb +3 -3
- data/lib/rubocop/cop/layout/empty_comment.rb +1 -1
- data/lib/rubocop/cop/layout/empty_lines.rb +0 -2
- data/lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb +1 -0
- data/lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb +3 -8
- data/lib/rubocop/cop/layout/end_alignment.rb +3 -2
- data/lib/rubocop/cop/layout/end_of_line.rb +1 -1
- data/lib/rubocop/cop/layout/extra_spacing.rb +9 -16
- data/lib/rubocop/cop/layout/first_argument_indentation.rb +5 -1
- data/lib/rubocop/cop/layout/first_array_element_line_break.rb +1 -1
- data/lib/rubocop/cop/layout/first_method_argument_line_break.rb +1 -1
- data/lib/rubocop/cop/layout/hash_alignment.rb +2 -3
- data/lib/rubocop/cop/layout/heredoc_indentation.rb +2 -2
- data/lib/rubocop/cop/layout/indentation_style.rb +0 -2
- data/lib/rubocop/cop/layout/multiline_block_layout.rb +17 -7
- data/lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb +1 -1
- data/lib/rubocop/cop/layout/rescue_ensure_alignment.rb +0 -2
- data/lib/rubocop/cop/layout/space_after_colon.rb +1 -1
- data/lib/rubocop/cop/layout/space_around_block_parameters.rb +22 -27
- data/lib/rubocop/cop/layout/space_around_keyword.rb +2 -2
- data/lib/rubocop/cop/layout/space_around_method_call_operator.rb +33 -66
- data/lib/rubocop/cop/layout/space_around_operators.rb +1 -1
- data/lib/rubocop/cop/layout/space_before_block_braces.rb +14 -0
- data/lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb +4 -3
- data/lib/rubocop/cop/layout/space_inside_block_braces.rb +1 -1
- data/lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb +2 -2
- data/lib/rubocop/cop/legacy/corrections_proxy.rb +49 -0
- data/lib/rubocop/cop/legacy/corrector.rb +29 -0
- data/lib/rubocop/cop/lint/ambiguous_block_association.rb +7 -4
- data/lib/rubocop/cop/lint/ambiguous_operator.rb +15 -10
- data/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb +11 -13
- data/lib/rubocop/cop/lint/assignment_in_condition.rb +2 -2
- data/lib/rubocop/cop/lint/big_decimal_new.rb +10 -10
- data/lib/rubocop/cop/lint/binary_operator_with_identical_operands.rb +49 -0
- data/lib/rubocop/cop/lint/boolean_symbol.rb +16 -11
- data/lib/rubocop/cop/lint/circular_argument_reference.rb +1 -1
- data/lib/rubocop/cop/lint/constant_resolution.rb +89 -0
- data/lib/rubocop/cop/lint/debugger.rb +7 -1
- data/lib/rubocop/cop/lint/deprecated_class_methods.rb +9 -10
- data/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb +21 -17
- data/lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb +8 -2
- data/lib/rubocop/cop/lint/duplicate_case_condition.rb +1 -1
- data/lib/rubocop/cop/lint/duplicate_elsif_condition.rb +39 -0
- data/lib/rubocop/cop/lint/duplicate_hash_key.rb +1 -1
- data/lib/rubocop/cop/lint/duplicate_methods.rb +9 -6
- data/lib/rubocop/cop/lint/duplicate_rescue_exception.rb +60 -0
- data/lib/rubocop/cop/lint/each_with_object_argument.rb +1 -1
- data/lib/rubocop/cop/lint/else_layout.rb +1 -1
- data/lib/rubocop/cop/lint/empty_conditional_body.rb +67 -0
- data/lib/rubocop/cop/lint/empty_ensure.rb +5 -5
- data/lib/rubocop/cop/lint/empty_expression.rb +2 -2
- data/lib/rubocop/cop/lint/empty_interpolation.rb +5 -6
- data/lib/rubocop/cop/lint/empty_when.rb +2 -2
- data/lib/rubocop/cop/lint/ensure_return.rb +27 -29
- data/lib/rubocop/cop/lint/erb_new_arguments.rb +11 -10
- data/lib/rubocop/cop/lint/flip_flop.rb +1 -1
- data/lib/rubocop/cop/lint/float_comparison.rb +93 -0
- data/lib/rubocop/cop/lint/float_out_of_range.rb +2 -2
- data/lib/rubocop/cop/lint/format_parameter_mismatch.rb +11 -5
- data/lib/rubocop/cop/lint/heredoc_method_call_position.rb +13 -14
- data/lib/rubocop/cop/lint/implicit_string_concatenation.rb +5 -4
- data/lib/rubocop/cop/lint/ineffective_access_modifier.rb +8 -8
- data/lib/rubocop/cop/lint/inherit_exception.rb +12 -7
- data/lib/rubocop/cop/lint/interpolation_check.rb +21 -5
- data/lib/rubocop/cop/lint/literal_as_condition.rb +14 -2
- data/lib/rubocop/cop/lint/literal_in_interpolation.rb +7 -7
- data/lib/rubocop/cop/lint/loop.rb +23 -2
- data/lib/rubocop/cop/lint/missing_cop_enable_directive.rb +6 -5
- data/lib/rubocop/cop/lint/missing_super.rb +99 -0
- data/lib/rubocop/cop/lint/mixed_regexp_capture_types.rb +1 -1
- data/lib/rubocop/cop/lint/multiple_comparison.rb +6 -9
- data/lib/rubocop/cop/lint/nested_method_definition.rb +15 -21
- data/lib/rubocop/cop/lint/nested_percent_literal.rb +1 -1
- data/lib/rubocop/cop/lint/next_without_accumulator.rb +1 -1
- data/lib/rubocop/cop/lint/non_deterministic_require_order.rb +84 -13
- data/lib/rubocop/cop/lint/non_local_exit_from_iterator.rb +2 -2
- data/lib/rubocop/cop/lint/number_conversion.rb +6 -9
- data/lib/rubocop/cop/lint/ordered_magic_comments.rb +11 -13
- data/lib/rubocop/cop/lint/out_of_range_regexp_ref.rb +61 -0
- data/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb +12 -13
- data/lib/rubocop/cop/lint/percent_string_array.rb +14 -13
- data/lib/rubocop/cop/lint/percent_symbol_array.rb +14 -13
- data/lib/rubocop/cop/lint/raise_exception.rb +15 -5
- data/lib/rubocop/cop/lint/rand_one.rb +3 -3
- data/lib/rubocop/cop/lint/redundant_cop_disable_directive.rb +31 -25
- data/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb +7 -11
- data/lib/rubocop/cop/lint/redundant_require_statement.rb +4 -7
- data/lib/rubocop/cop/lint/redundant_splat_expansion.rb +15 -11
- data/lib/rubocop/cop/lint/redundant_string_coercion.rb +6 -13
- data/lib/rubocop/cop/lint/redundant_with_index.rb +11 -14
- data/lib/rubocop/cop/lint/redundant_with_object.rb +11 -14
- data/lib/rubocop/cop/lint/regexp_as_condition.rb +6 -2
- data/lib/rubocop/cop/lint/require_parentheses.rb +2 -2
- data/lib/rubocop/cop/lint/rescue_exception.rb +1 -1
- data/lib/rubocop/cop/lint/rescue_type.rb +8 -8
- data/lib/rubocop/cop/lint/return_in_void_context.rb +2 -4
- data/lib/rubocop/cop/lint/safe_navigation_chain.rb +3 -6
- data/lib/rubocop/cop/lint/safe_navigation_consistency.rb +14 -10
- data/lib/rubocop/cop/lint/safe_navigation_with_empty.rb +10 -2
- data/lib/rubocop/cop/lint/script_permission.rb +10 -7
- data/lib/rubocop/cop/lint/self_assignment.rb +78 -0
- data/lib/rubocop/cop/lint/send_with_mixin_argument.rb +5 -11
- data/lib/rubocop/cop/lint/shadowed_argument.rb +3 -3
- data/lib/rubocop/cop/lint/shadowed_exception.rb +2 -2
- data/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb +3 -3
- data/lib/rubocop/cop/lint/struct_new_override.rb +1 -1
- data/lib/rubocop/cop/lint/suppressed_exception.rb +4 -7
- data/lib/rubocop/cop/lint/syntax.rb +11 -26
- data/lib/rubocop/cop/lint/to_json.rb +4 -6
- data/lib/rubocop/cop/lint/top_level_return_with_argument.rb +34 -0
- data/lib/rubocop/cop/lint/underscore_prefixed_variable_name.rb +4 -4
- data/lib/rubocop/cop/lint/unified_integer.rb +4 -6
- data/lib/rubocop/cop/lint/unreachable_code.rb +1 -1
- data/lib/rubocop/cop/lint/unreachable_loop.rb +174 -0
- data/lib/rubocop/cop/lint/unused_block_argument.rb +8 -3
- data/lib/rubocop/cop/lint/unused_method_argument.rb +9 -4
- data/lib/rubocop/cop/lint/uri_escape_unescape.rb +1 -1
- data/lib/rubocop/cop/lint/uri_regexp.rb +11 -31
- data/lib/rubocop/cop/lint/useless_access_modifier.rb +26 -16
- data/lib/rubocop/cop/lint/useless_assignment.rb +4 -4
- data/lib/rubocop/cop/lint/useless_else_without_rescue.rb +6 -15
- data/lib/rubocop/cop/lint/useless_setter_call.rb +4 -6
- data/lib/rubocop/cop/lint/void.rb +3 -7
- data/lib/rubocop/cop/metrics/abc_size.rb +1 -1
- data/lib/rubocop/cop/metrics/block_length.rb +24 -2
- data/lib/rubocop/cop/metrics/block_nesting.rb +2 -2
- data/lib/rubocop/cop/metrics/class_length.rb +26 -3
- data/lib/rubocop/cop/metrics/cyclomatic_complexity.rb +37 -4
- data/lib/rubocop/cop/metrics/method_length.rb +25 -2
- data/lib/rubocop/cop/metrics/module_length.rb +26 -3
- data/lib/rubocop/cop/metrics/parameter_lists.rb +2 -6
- data/lib/rubocop/cop/metrics/perceived_complexity.rb +7 -8
- data/lib/rubocop/cop/metrics/utils/abc_size_calculator.rb +47 -4
- data/lib/rubocop/cop/metrics/utils/code_length_calculator.rb +157 -0
- data/lib/rubocop/cop/metrics/utils/iterating_block.rb +61 -0
- data/lib/rubocop/cop/metrics/utils/repeated_csend_discount.rb +37 -0
- data/lib/rubocop/cop/migration/department_name.rb +13 -15
- data/lib/rubocop/cop/mixin/allowed_methods.rb +19 -0
- data/lib/rubocop/cop/mixin/array_min_size.rb +1 -1
- data/lib/rubocop/cop/mixin/auto_corrector.rb +12 -0
- data/lib/rubocop/cop/mixin/check_line_breakable.rb +1 -1
- data/lib/rubocop/cop/mixin/code_length.rb +26 -5
- data/lib/rubocop/cop/mixin/configurable_formatting.rb +1 -1
- data/lib/rubocop/cop/mixin/configurable_naming.rb +1 -1
- data/lib/rubocop/cop/mixin/documentation_comment.rb +2 -2
- data/lib/rubocop/cop/mixin/end_keyword_alignment.rb +1 -1
- data/lib/rubocop/cop/mixin/enforce_superclass.rb +5 -1
- data/lib/rubocop/cop/mixin/first_element_line_break.rb +1 -1
- data/lib/rubocop/cop/mixin/method_complexity.rb +10 -2
- data/lib/rubocop/cop/mixin/multiline_expression_indentation.rb +1 -1
- data/lib/rubocop/cop/mixin/nil_methods.rb +3 -5
- data/lib/rubocop/cop/mixin/ordered_gem_node.rb +6 -1
- data/lib/rubocop/cop/mixin/parentheses.rb +1 -2
- data/lib/rubocop/cop/mixin/preceding_following_alignment.rb +1 -1
- data/lib/rubocop/cop/mixin/range_help.rb +1 -1
- data/lib/rubocop/cop/mixin/regexp_literal_help.rb +27 -0
- data/lib/rubocop/cop/mixin/statement_modifier.rb +38 -9
- data/lib/rubocop/cop/mixin/string_literals_help.rb +1 -1
- data/lib/rubocop/cop/mixin/surrounding_space.rb +7 -27
- data/lib/rubocop/cop/mixin/trailing_comma.rb +1 -1
- data/lib/rubocop/cop/mixin/uncommunicative_name.rb +12 -17
- data/lib/rubocop/cop/mixin/unused_argument.rb +4 -6
- data/lib/rubocop/cop/mixin/visibility_help.rb +50 -0
- data/lib/rubocop/cop/naming/accessor_method_name.rb +4 -2
- data/lib/rubocop/cop/naming/ascii_identifiers.rb +29 -6
- data/lib/rubocop/cop/naming/binary_operator_parameter_name.rb +4 -4
- data/lib/rubocop/cop/naming/block_parameter_name.rb +1 -1
- data/lib/rubocop/cop/naming/class_and_module_camel_case.rb +2 -2
- data/lib/rubocop/cop/naming/constant_name.rb +2 -2
- data/lib/rubocop/cop/naming/file_name.rb +4 -6
- data/lib/rubocop/cop/naming/heredoc_delimiter_case.rb +2 -2
- data/lib/rubocop/cop/naming/heredoc_delimiter_naming.rb +3 -3
- data/lib/rubocop/cop/naming/memoized_instance_variable_name.rb +2 -2
- data/lib/rubocop/cop/naming/method_name.rb +1 -1
- data/lib/rubocop/cop/naming/method_parameter_name.rb +2 -2
- data/lib/rubocop/cop/naming/predicate_name.rb +6 -10
- data/lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb +12 -11
- data/lib/rubocop/cop/naming/variable_name.rb +1 -1
- data/lib/rubocop/cop/naming/variable_number.rb +1 -1
- data/lib/rubocop/cop/offense.rb +16 -2
- data/lib/rubocop/cop/registry.rb +3 -3
- data/lib/rubocop/cop/security/eval.rb +2 -2
- data/lib/rubocop/cop/security/json_load.rb +6 -8
- data/lib/rubocop/cop/security/marshal_load.rb +2 -4
- data/lib/rubocop/cop/security/open.rb +2 -2
- data/lib/rubocop/cop/security/yaml_load.rb +6 -6
- data/lib/rubocop/cop/style/access_modifier_declarations.rb +11 -1
- data/lib/rubocop/cop/style/accessor_grouping.rb +149 -0
- data/lib/rubocop/cop/style/alias.rb +7 -3
- data/lib/rubocop/cop/style/array_coercion.rb +63 -0
- data/lib/rubocop/cop/style/auto_resource_cleanup.rb +3 -2
- data/lib/rubocop/cop/style/bare_percent_literals.rb +1 -1
- data/lib/rubocop/cop/style/bisected_attr_accessor.rb +144 -0
- data/lib/rubocop/cop/style/block_delimiters.rb +2 -4
- data/lib/rubocop/cop/style/case_equality.rb +22 -3
- data/lib/rubocop/cop/style/case_like_if.rb +217 -0
- data/lib/rubocop/cop/style/class_and_module_children.rb +1 -1
- data/lib/rubocop/cop/style/class_vars.rb +21 -0
- data/lib/rubocop/cop/style/colon_method_call.rb +3 -3
- data/lib/rubocop/cop/style/command_literal.rb +1 -1
- data/lib/rubocop/cop/style/commented_keyword.rb +5 -2
- data/lib/rubocop/cop/style/conditional_assignment.rb +11 -2
- data/lib/rubocop/cop/style/copyright.rb +3 -3
- data/lib/rubocop/cop/style/date_time.rb +1 -1
- data/lib/rubocop/cop/style/dir.rb +2 -2
- data/lib/rubocop/cop/style/disable_cops_within_source_code_directive.rb +1 -1
- data/lib/rubocop/cop/style/documentation.rb +6 -6
- data/lib/rubocop/cop/style/each_with_object.rb +0 -2
- data/lib/rubocop/cop/style/empty_case_condition.rb +8 -6
- data/lib/rubocop/cop/style/empty_literal.rb +5 -5
- data/lib/rubocop/cop/style/empty_method.rb +5 -5
- data/lib/rubocop/cop/style/encoding.rb +1 -1
- data/lib/rubocop/cop/style/eval_with_location.rb +4 -0
- data/lib/rubocop/cop/style/expand_path_arguments.rb +6 -2
- data/lib/rubocop/cop/style/explicit_block_argument.rb +102 -0
- data/lib/rubocop/cop/style/exponential_notation.rb +8 -10
- data/lib/rubocop/cop/style/float_division.rb +7 -10
- data/lib/rubocop/cop/style/format_string.rb +4 -0
- data/lib/rubocop/cop/style/format_string_token.rb +6 -5
- data/lib/rubocop/cop/style/frozen_string_literal_comment.rb +1 -1
- data/lib/rubocop/cop/style/global_std_stream.rb +65 -0
- data/lib/rubocop/cop/style/guard_clause.rb +2 -2
- data/lib/rubocop/cop/style/hash_as_last_array_item.rb +69 -0
- data/lib/rubocop/cop/style/hash_like_case.rb +76 -0
- data/lib/rubocop/cop/style/hash_syntax.rb +6 -3
- data/lib/rubocop/cop/style/identical_conditional_branches.rb +1 -1
- data/lib/rubocop/cop/style/if_unless_modifier.rb +8 -28
- data/lib/rubocop/cop/style/if_unless_modifier_of_if_unless.rb +12 -0
- data/lib/rubocop/cop/style/infinite_loop.rb +1 -1
- data/lib/rubocop/cop/style/inverse_methods.rb +3 -4
- data/lib/rubocop/cop/style/ip_addresses.rb +1 -1
- data/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb +5 -0
- data/lib/rubocop/cop/style/method_call_without_args_parentheses.rb +1 -1
- data/lib/rubocop/cop/style/missing_else.rb +1 -11
- data/lib/rubocop/cop/style/missing_respond_to_missing.rb +9 -2
- data/lib/rubocop/cop/style/multiline_block_chain.rb +10 -1
- data/lib/rubocop/cop/style/multiline_if_then.rb +1 -1
- data/lib/rubocop/cop/style/multiline_memoization.rb +2 -2
- data/lib/rubocop/cop/style/multiline_method_signature.rb +1 -1
- data/lib/rubocop/cop/style/multiline_ternary_operator.rb +17 -6
- data/lib/rubocop/cop/style/mutable_constant.rb +4 -4
- data/lib/rubocop/cop/style/nested_parenthesized_calls.rb +2 -5
- data/lib/rubocop/cop/style/nested_ternary_operator.rb +27 -0
- data/lib/rubocop/cop/style/next.rb +2 -2
- data/lib/rubocop/cop/style/numeric_literal_prefix.rb +2 -2
- data/lib/rubocop/cop/style/numeric_predicate.rb +7 -4
- data/lib/rubocop/cop/style/optional_boolean_parameter.rb +42 -0
- data/lib/rubocop/cop/style/parallel_assignment.rb +5 -5
- data/lib/rubocop/cop/style/percent_literal_delimiters.rb +2 -2
- data/lib/rubocop/cop/style/proc.rb +1 -1
- data/lib/rubocop/cop/style/random_with_offset.rb +5 -10
- data/lib/rubocop/cop/style/redundant_assignment.rb +117 -0
- data/lib/rubocop/cop/style/redundant_condition.rb +15 -3
- data/lib/rubocop/cop/style/redundant_exception.rb +18 -10
- data/lib/rubocop/cop/style/redundant_fetch_block.rb +122 -0
- data/lib/rubocop/cop/style/redundant_file_extension_in_require.rb +50 -0
- data/lib/rubocop/cop/style/redundant_freeze.rb +1 -1
- data/lib/rubocop/cop/style/redundant_parentheses.rb +8 -2
- data/lib/rubocop/cop/style/redundant_percent_q.rb +2 -2
- data/lib/rubocop/cop/style/redundant_regexp_character_class.rb +4 -3
- data/lib/rubocop/cop/style/redundant_regexp_escape.rb +23 -32
- data/lib/rubocop/cop/style/redundant_self.rb +6 -9
- data/lib/rubocop/cop/style/redundant_sort.rb +28 -12
- data/lib/rubocop/cop/style/rescue_standard_error.rb +1 -1
- data/lib/rubocop/cop/style/sample.rb +1 -1
- data/lib/rubocop/cop/style/semicolon.rb +1 -1
- data/lib/rubocop/cop/style/signal_exception.rb +3 -1
- data/lib/rubocop/cop/style/single_argument_dig.rb +54 -0
- data/lib/rubocop/cop/style/stabby_lambda_parentheses.rb +3 -2
- data/lib/rubocop/cop/style/stderr_puts.rb +1 -1
- data/lib/rubocop/cop/style/string_concatenation.rb +92 -0
- data/lib/rubocop/cop/style/struct_inheritance.rb +23 -2
- data/lib/rubocop/cop/style/symbol_array.rb +6 -6
- data/lib/rubocop/cop/style/symbol_proc.rb +2 -2
- data/lib/rubocop/cop/style/ternary_parentheses.rb +1 -1
- data/lib/rubocop/cop/style/trailing_method_end_statement.rb +9 -32
- data/lib/rubocop/cop/style/trivial_accessors.rb +8 -7
- data/lib/rubocop/cop/style/word_array.rb +1 -1
- data/lib/rubocop/cop/style/yoda_condition.rb +18 -1
- data/lib/rubocop/cop/style/zero_length_predicate.rb +12 -8
- data/lib/rubocop/cop/team.rb +98 -82
- data/lib/rubocop/cop/tokens_util.rb +84 -0
- data/lib/rubocop/cop/util.rb +3 -15
- data/lib/rubocop/cop/utils/format_string.rb +2 -3
- data/lib/rubocop/cop/variable_force.rb +0 -2
- data/lib/rubocop/cop/variable_force/branch.rb +1 -0
- data/lib/rubocop/cop/variable_force/variable.rb +7 -5
- data/lib/rubocop/cops_documentation_generator.rb +282 -0
- data/lib/rubocop/error.rb +1 -0
- data/lib/rubocop/file_finder.rb +12 -12
- data/lib/rubocop/formatter/disabled_config_formatter.rb +2 -2
- data/lib/rubocop/formatter/formatter_set.rb +2 -1
- data/lib/rubocop/name_similarity.rb +7 -3
- data/lib/rubocop/options.rb +15 -8
- data/lib/rubocop/path_util.rb +19 -19
- data/lib/rubocop/platform.rb +1 -1
- data/lib/rubocop/rake_task.rb +7 -9
- data/lib/rubocop/result_cache.rb +12 -8
- data/lib/rubocop/rspec/cop_helper.rb +4 -4
- data/lib/rubocop/rspec/expect_offense.rb +63 -22
- data/lib/rubocop/rspec/shared_contexts.rb +19 -16
- data/lib/rubocop/runner.rb +34 -33
- data/lib/rubocop/target_finder.rb +14 -11
- data/lib/rubocop/target_ruby.rb +2 -2
- data/lib/rubocop/version.rb +2 -2
- metadata +49 -11
- data/lib/rubocop/cop/lint/useless_comparison.rb +0 -28
- data/lib/rubocop/cop/mixin/classish_length.rb +0 -37
- data/lib/rubocop/cop/mixin/parser_diagnostic.rb +0 -37
- data/lib/rubocop/cop/mixin/too_many_lines.rb +0 -35
- data/lib/rubocop/cop/style/method_missing_super.rb +0 -34
| @@ -1,7 +1,6 @@ | |
| 1 1 | 
             
            # frozen_string_literal: true
         | 
| 2 2 |  | 
| 3 3 | 
             
            require 'tmpdir'
         | 
| 4 | 
            -
            require 'fileutils'
         | 
| 5 4 |  | 
| 6 5 | 
             
            RSpec.shared_context 'isolated environment', :isolated_environment do
         | 
| 7 6 | 
             
              around do |example|
         | 
| @@ -13,19 +12,22 @@ RSpec.shared_context 'isolated environment', :isolated_environment do | |
| 13 12 | 
             
                  # get mismatched pathnames when loading config files later on.
         | 
| 14 13 | 
             
                  tmpdir = File.realpath(tmpdir)
         | 
| 15 14 |  | 
| 15 | 
            +
                  virtual_home = File.expand_path(File.join(tmpdir, 'home'))
         | 
| 16 | 
            +
                  Dir.mkdir(virtual_home)
         | 
| 17 | 
            +
                  ENV['HOME'] = virtual_home
         | 
| 18 | 
            +
                  ENV.delete('XDG_CONFIG_HOME')
         | 
| 19 | 
            +
             | 
| 20 | 
            +
                  base_dir = example.metadata[:project_inside_home] ? virtual_home : tmpdir
         | 
| 21 | 
            +
                  root = example.metadata[:root]
         | 
| 22 | 
            +
                  working_dir = root ? File.join(base_dir, 'work', root) : File.join(base_dir, 'work')
         | 
| 23 | 
            +
             | 
| 16 24 | 
             
                  # Make upwards search for .rubocop.yml files stop at this directory.
         | 
| 17 | 
            -
                  RuboCop::FileFinder.root_level =  | 
| 25 | 
            +
                  RuboCop::FileFinder.root_level = working_dir
         | 
| 18 26 |  | 
| 19 27 | 
             
                  begin
         | 
| 20 | 
            -
                     | 
| 21 | 
            -
                    Dir.mkdir(virtual_home)
         | 
| 22 | 
            -
                    ENV['HOME'] = virtual_home
         | 
| 23 | 
            -
                    ENV.delete('XDG_CONFIG_HOME')
         | 
| 28 | 
            +
                    FileUtils.mkdir_p(working_dir)
         | 
| 24 29 |  | 
| 25 | 
            -
                     | 
| 26 | 
            -
                    Dir.mkdir(working_dir)
         | 
| 27 | 
            -
             | 
| 28 | 
            -
                    RuboCop::PathUtil.chdir(working_dir) do
         | 
| 30 | 
            +
                    Dir.chdir(working_dir) do
         | 
| 29 31 | 
             
                      example.run
         | 
| 30 32 | 
             
                    end
         | 
| 31 33 | 
             
                  ensure
         | 
| @@ -45,11 +47,11 @@ RSpec.shared_context 'config', :config do # rubocop:disable Metrics/BlockLength | |
| 45 47 | 
             
              let(:source) { 'code = {some: :ruby}' }
         | 
| 46 48 |  | 
| 47 49 | 
             
              let(:cop_class) do
         | 
| 48 | 
            -
                 | 
| 49 | 
            -
                   | 
| 50 | 
            -
             | 
| 51 | 
            -
                  RuboCop::Cop::Cop
         | 
| 50 | 
            +
                unless described_class.is_a?(Class) && described_class < RuboCop::Cop::Base
         | 
| 51 | 
            +
                  raise 'Specify which cop class to use (e.g `let(:cop_class) { RuboCop::Cop::Base }`, ' \
         | 
| 52 | 
            +
                        'or RuboCop::Cop::Cop for legacy)'
         | 
| 52 53 | 
             
                end
         | 
| 54 | 
            +
                described_class
         | 
| 53 55 | 
             
              end
         | 
| 54 56 |  | 
| 55 57 | 
             
              let(:cop_config) { {} }
         | 
| @@ -95,8 +97,9 @@ RSpec.shared_context 'config', :config do # rubocop:disable Metrics/BlockLength | |
| 95 97 | 
             
              end
         | 
| 96 98 |  | 
| 97 99 | 
             
              let(:cop) do
         | 
| 98 | 
            -
                cop_class.new(config, cop_options)
         | 
| 99 | 
            -
             | 
| 100 | 
            +
                cop_class.new(config, cop_options).tap do |cop|
         | 
| 101 | 
            +
                  cop.send :begin_investigation, processed_source
         | 
| 102 | 
            +
                end
         | 
| 100 103 | 
             
              end
         | 
| 101 104 | 
             
            end
         | 
| 102 105 |  | 
    
        data/lib/rubocop/runner.rb
    CHANGED
    
    | @@ -118,9 +118,9 @@ module RuboCop | |
| 118 118 |  | 
| 119 119 | 
             
                def file_offenses(file)
         | 
| 120 120 | 
             
                  file_offense_cache(file) do
         | 
| 121 | 
            -
                    source =  | 
| 122 | 
            -
                     | 
| 123 | 
            -
                     | 
| 121 | 
            +
                    source, offenses = do_inspection_loop(file)
         | 
| 122 | 
            +
                    offenses = add_redundant_disables(file, offenses.compact.sort, source)
         | 
| 123 | 
            +
                    offenses.sort.reject(&:disabled?).freeze
         | 
| 124 124 | 
             
                  end
         | 
| 125 125 | 
             
                end
         | 
| 126 126 |  | 
| @@ -151,16 +151,29 @@ module RuboCop | |
| 151 151 | 
             
                end
         | 
| 152 152 |  | 
| 153 153 | 
             
                def add_redundant_disables(file, offenses, source)
         | 
| 154 | 
            -
                   | 
| 155 | 
            -
                     | 
| 156 | 
            -
             | 
| 157 | 
            -
             | 
| 158 | 
            -
                       | 
| 159 | 
            -
             | 
| 154 | 
            +
                  team_for_redundant_disables(file, offenses, source) do |team|
         | 
| 155 | 
            +
                    new_offenses, redundant_updated = inspect_file(source, team)
         | 
| 156 | 
            +
                    offenses += new_offenses
         | 
| 157 | 
            +
                    if redundant_updated
         | 
| 158 | 
            +
                      # Do one extra inspection loop if any redundant disables were
         | 
| 159 | 
            +
                      # removed. This is done in order to find rubocop:enable directives that
         | 
| 160 | 
            +
                      # have now become useless.
         | 
| 161 | 
            +
                      _source, new_offenses = do_inspection_loop(file)
         | 
| 162 | 
            +
                      offenses |= new_offenses
         | 
| 160 163 | 
             
                    end
         | 
| 161 164 | 
             
                  end
         | 
| 165 | 
            +
                  offenses
         | 
| 166 | 
            +
                end
         | 
| 162 167 |  | 
| 163 | 
            -
             | 
| 168 | 
            +
                def team_for_redundant_disables(file, offenses, source)
         | 
| 169 | 
            +
                  return unless check_for_redundant_disables?(source)
         | 
| 170 | 
            +
             | 
| 171 | 
            +
                  config = @config_store.for_file(file)
         | 
| 172 | 
            +
                  team = Cop::Team.mobilize([Cop::Lint::RedundantCopDisableDirective], config, @options)
         | 
| 173 | 
            +
                  return if team.cops.empty?
         | 
| 174 | 
            +
             | 
| 175 | 
            +
                  team.cops.first.offenses_to_check = offenses
         | 
| 176 | 
            +
                  yield team
         | 
| 164 177 | 
             
                end
         | 
| 165 178 |  | 
| 166 179 | 
             
                def check_for_redundant_disables?(source)
         | 
| @@ -180,22 +193,6 @@ module RuboCop | |
| 180 193 | 
             
                  @options[:except] || @options[:only]
         | 
| 181 194 | 
             
                end
         | 
| 182 195 |  | 
| 183 | 
            -
                def autocorrect_redundant_disables(file, source, cop, offenses)
         | 
| 184 | 
            -
                  cop.processed_source = source
         | 
| 185 | 
            -
             | 
| 186 | 
            -
                  team = Cop::Team.mobilize(RuboCop::Cop::Registry.new, nil, @options)
         | 
| 187 | 
            -
                  team.autocorrect(source.buffer, [cop])
         | 
| 188 | 
            -
             | 
| 189 | 
            -
                  return [] unless team.updated_source_file?
         | 
| 190 | 
            -
             | 
| 191 | 
            -
                  # Do one extra inspection loop if any redundant disables were
         | 
| 192 | 
            -
                  # removed. This is done in order to find rubocop:enable directives that
         | 
| 193 | 
            -
                  # have now become useless.
         | 
| 194 | 
            -
                  _source, new_offenses = do_inspection_loop(file,
         | 
| 195 | 
            -
                                                             get_processed_source(file))
         | 
| 196 | 
            -
                  new_offenses - offenses
         | 
| 197 | 
            -
                end
         | 
| 198 | 
            -
             | 
| 199 196 | 
             
                def file_started(file)
         | 
| 200 197 | 
             
                  puts "Scanning #{file}" if @options[:debug]
         | 
| 201 198 | 
             
                  formatter_set.file_started(file,
         | 
| @@ -214,7 +211,7 @@ module RuboCop | |
| 214 211 | 
             
                  @cached_run ||=
         | 
| 215 212 | 
             
                    (@options[:cache] == 'true' ||
         | 
| 216 213 | 
             
                     @options[:cache] != 'false' &&
         | 
| 217 | 
            -
                     @config_store. | 
| 214 | 
            +
                     @config_store.for_pwd.for_all_cops['UseCache']) &&
         | 
| 218 215 | 
             
                    # When running --auto-gen-config, there's some processing done in the
         | 
| 219 216 | 
             
                    # cops related to calculating the Max parameters for Metrics cops. We
         | 
| 220 217 | 
             
                    # need to do that processing and cannot use caching.
         | 
| @@ -233,7 +230,8 @@ module RuboCop | |
| 233 230 | 
             
                  cache.save(offenses)
         | 
| 234 231 | 
             
                end
         | 
| 235 232 |  | 
| 236 | 
            -
                def do_inspection_loop(file | 
| 233 | 
            +
                def do_inspection_loop(file)
         | 
| 234 | 
            +
                  processed_source = get_processed_source(file)
         | 
| 237 235 | 
             
                  offenses = []
         | 
| 238 236 |  | 
| 239 237 | 
             
                  # When running with --auto-correct, we need to inspect the file (which
         | 
| @@ -293,13 +291,16 @@ module RuboCop | |
| 293 291 | 
             
                  @processed_sources << checksum
         | 
| 294 292 | 
             
                end
         | 
| 295 293 |  | 
| 296 | 
            -
                def inspect_file(processed_source)
         | 
| 297 | 
            -
                   | 
| 298 | 
            -
                  team = Cop::Team.mobilize(mobilized_cop_classes(config), config, @options)
         | 
| 299 | 
            -
                  offenses = team.inspect_file(processed_source)
         | 
| 294 | 
            +
                def inspect_file(processed_source, team = mobilize_team(processed_source))
         | 
| 295 | 
            +
                  report = team.investigate(processed_source)
         | 
| 300 296 | 
             
                  @errors.concat(team.errors)
         | 
| 301 297 | 
             
                  @warnings.concat(team.warnings)
         | 
| 302 | 
            -
                  [offenses, team.updated_source_file?]
         | 
| 298 | 
            +
                  [report.offenses, team.updated_source_file?]
         | 
| 299 | 
            +
                end
         | 
| 300 | 
            +
             | 
| 301 | 
            +
                def mobilize_team(processed_source)
         | 
| 302 | 
            +
                  config = @config_store.for_file(processed_source.path)
         | 
| 303 | 
            +
                  Cop::Team.mobilize(mobilized_cop_classes(config), config, @options)
         | 
| 303 304 | 
             
                end
         | 
| 304 305 |  | 
| 305 306 | 
             
                def mobilized_cop_classes(config)
         | 
| @@ -1,7 +1,5 @@ | |
| 1 1 | 
             
            # frozen_string_literal: true
         | 
| 2 2 |  | 
| 3 | 
            -
            require 'set'
         | 
| 4 | 
            -
             | 
| 5 3 | 
             
            module RuboCop
         | 
| 6 4 | 
             
              # This class finds target files to inspect by scanning the directory tree
         | 
| 7 5 | 
             
              # and picking ruby files.
         | 
| @@ -114,10 +112,12 @@ module RuboCop | |
| 114 112 | 
             
                end
         | 
| 115 113 |  | 
| 116 114 | 
             
                def ruby_extensions
         | 
| 117 | 
            -
                   | 
| 118 | 
            -
                    pattern | 
| 115 | 
            +
                  @ruby_extensions ||= begin
         | 
| 116 | 
            +
                    ext_patterns = all_cops_include.select do |pattern|
         | 
| 117 | 
            +
                      pattern.start_with?('**/*.')
         | 
| 118 | 
            +
                    end
         | 
| 119 | 
            +
                    ext_patterns.map { |pattern| pattern.sub('**/*', '') }
         | 
| 119 120 | 
             
                  end
         | 
| 120 | 
            -
                  ext_patterns.map { |pattern| pattern.sub('**/*', '') }
         | 
| 121 121 | 
             
                end
         | 
| 122 122 |  | 
| 123 123 | 
             
                def ruby_filename?(file)
         | 
| @@ -125,21 +125,24 @@ module RuboCop | |
| 125 125 | 
             
                end
         | 
| 126 126 |  | 
| 127 127 | 
             
                def ruby_filenames
         | 
| 128 | 
            -
                   | 
| 129 | 
            -
                    pattern | 
| 128 | 
            +
                  @ruby_filenames ||= begin
         | 
| 129 | 
            +
                    file_patterns = all_cops_include.reject do |pattern|
         | 
| 130 | 
            +
                      pattern.start_with?('**/*.')
         | 
| 131 | 
            +
                    end
         | 
| 132 | 
            +
                    file_patterns.map { |pattern| pattern.sub('**/', '') }
         | 
| 130 133 | 
             
                  end
         | 
| 131 | 
            -
                  file_patterns.map { |pattern| pattern.sub('**/', '') }
         | 
| 132 134 | 
             
                end
         | 
| 133 135 |  | 
| 134 136 | 
             
                def all_cops_include
         | 
| 135 | 
            -
                  @ | 
| 137 | 
            +
                  @all_cops_include ||=
         | 
| 138 | 
            +
                    @config_store.for_pwd.for_all_cops['Include'].map(&:to_s)
         | 
| 136 139 | 
             
                end
         | 
| 137 140 |  | 
| 138 141 | 
             
                def ruby_executable?(file)
         | 
| 139 142 | 
             
                  return false unless File.extname(file).empty? && File.exist?(file)
         | 
| 140 143 |  | 
| 141 144 | 
             
                  first_line = File.open(file, &:readline)
         | 
| 142 | 
            -
                   | 
| 145 | 
            +
                  /#!.*(#{ruby_interpreters(file).join('|')})/.match?(first_line)
         | 
| 143 146 | 
             
                rescue EOFError, ArgumentError => e
         | 
| 144 147 | 
             
                  warn("Unprocessable file #{file}: #{e.class}, #{e.message}") if debug?
         | 
| 145 148 |  | 
| @@ -160,7 +163,7 @@ module RuboCop | |
| 160 163 | 
             
                end
         | 
| 161 164 |  | 
| 162 165 | 
             
                def configured_include?(file)
         | 
| 163 | 
            -
                  @config_store. | 
| 166 | 
            +
                  @config_store.for_pwd.file_to_include?(file)
         | 
| 164 167 | 
             
                end
         | 
| 165 168 |  | 
| 166 169 | 
             
                def included_file?(file)
         | 
    
        data/lib/rubocop/target_ruby.rb
    CHANGED
    
    | @@ -3,11 +3,11 @@ | |
| 3 3 | 
             
            module RuboCop
         | 
| 4 4 | 
             
              # The kind of Ruby that code inspected by RuboCop is written in.
         | 
| 5 5 | 
             
              class TargetRuby
         | 
| 6 | 
            -
                KNOWN_RUBIES = [2.4, 2.5, 2.6, 2.7].freeze
         | 
| 6 | 
            +
                KNOWN_RUBIES = [2.4, 2.5, 2.6, 2.7, 2.8].freeze
         | 
| 7 7 | 
             
                DEFAULT_VERSION = KNOWN_RUBIES.first
         | 
| 8 8 |  | 
| 9 9 | 
             
                OBSOLETE_RUBIES = {
         | 
| 10 | 
            -
                  1.9 => '0. | 
| 10 | 
            +
                  1.9 => '0.41', 2.0 => '0.50', 2.1 => '0.57', 2.2 => '0.68', 2.3 => '0.81'
         | 
| 11 11 | 
             
                }.freeze
         | 
| 12 12 | 
             
                private_constant :KNOWN_RUBIES, :OBSOLETE_RUBIES
         | 
| 13 13 |  | 
    
        data/lib/rubocop/version.rb
    CHANGED
    
    | @@ -3,13 +3,13 @@ | |
| 3 3 | 
             
            module RuboCop
         | 
| 4 4 | 
             
              # This module holds the RuboCop version information.
         | 
| 5 5 | 
             
              module Version
         | 
| 6 | 
            -
                STRING = '0. | 
| 6 | 
            +
                STRING = '0.89.0'
         | 
| 7 7 |  | 
| 8 8 | 
             
                MSG = '%<version>s (using Parser %<parser_version>s, '\
         | 
| 9 9 | 
             
                      'rubocop-ast %<rubocop_ast_version>s, ' \
         | 
| 10 10 | 
             
                      'running on %<ruby_engine>s %<ruby_version>s %<ruby_platform>s)'
         | 
| 11 11 |  | 
| 12 | 
            -
                def self.version(debug  | 
| 12 | 
            +
                def self.version(debug: false)
         | 
| 13 13 | 
             
                  if debug
         | 
| 14 14 | 
             
                    format(MSG, version: STRING, parser_version: Parser::VERSION,
         | 
| 15 15 | 
             
                                rubocop_ast_version: RuboCop::AST::Version::STRING,
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: rubocop
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0. | 
| 4 | 
            +
              version: 0.89.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Bozhidar Batsov
         | 
| @@ -10,7 +10,7 @@ authors: | |
| 10 10 | 
             
            autorequire: 
         | 
| 11 11 | 
             
            bindir: exe
         | 
| 12 12 | 
             
            cert_chain: []
         | 
| 13 | 
            -
            date: 2020- | 
| 13 | 
            +
            date: 2020-08-05 00:00:00.000000000 Z
         | 
| 14 14 | 
             
            dependencies:
         | 
| 15 15 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 16 16 | 
             
              name: parallel
         | 
| @@ -32,14 +32,14 @@ dependencies: | |
| 32 32 | 
             
                requirements:
         | 
| 33 33 | 
             
                - - ">="
         | 
| 34 34 | 
             
                  - !ruby/object:Gem::Version
         | 
| 35 | 
            -
                    version: 2.7. | 
| 35 | 
            +
                    version: 2.7.1.1
         | 
| 36 36 | 
             
              type: :runtime
         | 
| 37 37 | 
             
              prerelease: false
         | 
| 38 38 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 39 39 | 
             
                requirements:
         | 
| 40 40 | 
             
                - - ">="
         | 
| 41 41 | 
             
                  - !ruby/object:Gem::Version
         | 
| 42 | 
            -
                    version: 2.7. | 
| 42 | 
            +
                    version: 2.7.1.1
         | 
| 43 43 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 44 44 | 
             
              name: rainbow
         | 
| 45 45 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -94,14 +94,20 @@ dependencies: | |
| 94 94 | 
             
                requirements:
         | 
| 95 95 | 
             
                - - ">="
         | 
| 96 96 | 
             
                  - !ruby/object:Gem::Version
         | 
| 97 | 
            -
                    version: 0.0 | 
| 97 | 
            +
                    version: 0.1.0
         | 
| 98 | 
            +
                - - "<"
         | 
| 99 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 100 | 
            +
                    version: '1.0'
         | 
| 98 101 | 
             
              type: :runtime
         | 
| 99 102 | 
             
              prerelease: false
         | 
| 100 103 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 101 104 | 
             
                requirements:
         | 
| 102 105 | 
             
                - - ">="
         | 
| 103 106 | 
             
                  - !ruby/object:Gem::Version
         | 
| 104 | 
            -
                    version: 0.0 | 
| 107 | 
            +
                    version: 0.1.0
         | 
| 108 | 
            +
                - - "<"
         | 
| 109 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 110 | 
            +
                    version: '1.0'
         | 
| 105 111 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 106 112 | 
             
              name: ruby-progressbar
         | 
| 107 113 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -172,6 +178,7 @@ files: | |
| 172 178 | 
             
            - assets/logo.png
         | 
| 173 179 | 
             
            - assets/output.html.erb
         | 
| 174 180 | 
             
            - bin/console
         | 
| 181 | 
            +
            - bin/rubocop-profile
         | 
| 175 182 | 
             
            - bin/setup
         | 
| 176 183 | 
             
            - config/default.yml
         | 
| 177 184 | 
             
            - exe/rubocop
         | 
| @@ -196,6 +203,7 @@ files: | |
| 196 203 | 
             
            - lib/rubocop/config_validator.rb
         | 
| 197 204 | 
             
            - lib/rubocop/cop/autocorrect_logic.rb
         | 
| 198 205 | 
             
            - lib/rubocop/cop/badge.rb
         | 
| 206 | 
            +
            - lib/rubocop/cop/base.rb
         | 
| 199 207 | 
             
            - lib/rubocop/cop/bundler/duplicated_gem.rb
         | 
| 200 208 | 
             
            - lib/rubocop/cop/bundler/gem_comment.rb
         | 
| 201 209 | 
             
            - lib/rubocop/cop/bundler/insecure_protocol_source.rb
         | 
| @@ -325,22 +333,29 @@ files: | |
| 325 333 | 
             
            - lib/rubocop/cop/layout/space_inside_string_interpolation.rb
         | 
| 326 334 | 
             
            - lib/rubocop/cop/layout/trailing_empty_lines.rb
         | 
| 327 335 | 
             
            - lib/rubocop/cop/layout/trailing_whitespace.rb
         | 
| 336 | 
            +
            - lib/rubocop/cop/legacy/corrections_proxy.rb
         | 
| 337 | 
            +
            - lib/rubocop/cop/legacy/corrector.rb
         | 
| 328 338 | 
             
            - lib/rubocop/cop/lint/ambiguous_block_association.rb
         | 
| 329 339 | 
             
            - lib/rubocop/cop/lint/ambiguous_operator.rb
         | 
| 330 340 | 
             
            - lib/rubocop/cop/lint/ambiguous_regexp_literal.rb
         | 
| 331 341 | 
             
            - lib/rubocop/cop/lint/assignment_in_condition.rb
         | 
| 332 342 | 
             
            - lib/rubocop/cop/lint/big_decimal_new.rb
         | 
| 343 | 
            +
            - lib/rubocop/cop/lint/binary_operator_with_identical_operands.rb
         | 
| 333 344 | 
             
            - lib/rubocop/cop/lint/boolean_symbol.rb
         | 
| 334 345 | 
             
            - lib/rubocop/cop/lint/circular_argument_reference.rb
         | 
| 346 | 
            +
            - lib/rubocop/cop/lint/constant_resolution.rb
         | 
| 335 347 | 
             
            - lib/rubocop/cop/lint/debugger.rb
         | 
| 336 348 | 
             
            - lib/rubocop/cop/lint/deprecated_class_methods.rb
         | 
| 337 349 | 
             
            - lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb
         | 
| 338 350 | 
             
            - lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb
         | 
| 339 351 | 
             
            - lib/rubocop/cop/lint/duplicate_case_condition.rb
         | 
| 352 | 
            +
            - lib/rubocop/cop/lint/duplicate_elsif_condition.rb
         | 
| 340 353 | 
             
            - lib/rubocop/cop/lint/duplicate_hash_key.rb
         | 
| 341 354 | 
             
            - lib/rubocop/cop/lint/duplicate_methods.rb
         | 
| 355 | 
            +
            - lib/rubocop/cop/lint/duplicate_rescue_exception.rb
         | 
| 342 356 | 
             
            - lib/rubocop/cop/lint/each_with_object_argument.rb
         | 
| 343 357 | 
             
            - lib/rubocop/cop/lint/else_layout.rb
         | 
| 358 | 
            +
            - lib/rubocop/cop/lint/empty_conditional_body.rb
         | 
| 344 359 | 
             
            - lib/rubocop/cop/lint/empty_ensure.rb
         | 
| 345 360 | 
             
            - lib/rubocop/cop/lint/empty_expression.rb
         | 
| 346 361 | 
             
            - lib/rubocop/cop/lint/empty_interpolation.rb
         | 
| @@ -348,6 +363,7 @@ files: | |
| 348 363 | 
             
            - lib/rubocop/cop/lint/ensure_return.rb
         | 
| 349 364 | 
             
            - lib/rubocop/cop/lint/erb_new_arguments.rb
         | 
| 350 365 | 
             
            - lib/rubocop/cop/lint/flip_flop.rb
         | 
| 366 | 
            +
            - lib/rubocop/cop/lint/float_comparison.rb
         | 
| 351 367 | 
             
            - lib/rubocop/cop/lint/float_out_of_range.rb
         | 
| 352 368 | 
             
            - lib/rubocop/cop/lint/format_parameter_mismatch.rb
         | 
| 353 369 | 
             
            - lib/rubocop/cop/lint/heredoc_method_call_position.rb
         | 
| @@ -359,6 +375,7 @@ files: | |
| 359 375 | 
             
            - lib/rubocop/cop/lint/literal_in_interpolation.rb
         | 
| 360 376 | 
             
            - lib/rubocop/cop/lint/loop.rb
         | 
| 361 377 | 
             
            - lib/rubocop/cop/lint/missing_cop_enable_directive.rb
         | 
| 378 | 
            +
            - lib/rubocop/cop/lint/missing_super.rb
         | 
| 362 379 | 
             
            - lib/rubocop/cop/lint/mixed_regexp_capture_types.rb
         | 
| 363 380 | 
             
            - lib/rubocop/cop/lint/multiple_comparison.rb
         | 
| 364 381 | 
             
            - lib/rubocop/cop/lint/nested_method_definition.rb
         | 
| @@ -368,6 +385,7 @@ files: | |
| 368 385 | 
             
            - lib/rubocop/cop/lint/non_local_exit_from_iterator.rb
         | 
| 369 386 | 
             
            - lib/rubocop/cop/lint/number_conversion.rb
         | 
| 370 387 | 
             
            - lib/rubocop/cop/lint/ordered_magic_comments.rb
         | 
| 388 | 
            +
            - lib/rubocop/cop/lint/out_of_range_regexp_ref.rb
         | 
| 371 389 | 
             
            - lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb
         | 
| 372 390 | 
             
            - lib/rubocop/cop/lint/percent_string_array.rb
         | 
| 373 391 | 
             
            - lib/rubocop/cop/lint/percent_symbol_array.rb
         | 
| @@ -389,6 +407,7 @@ files: | |
| 389 407 | 
             
            - lib/rubocop/cop/lint/safe_navigation_consistency.rb
         | 
| 390 408 | 
             
            - lib/rubocop/cop/lint/safe_navigation_with_empty.rb
         | 
| 391 409 | 
             
            - lib/rubocop/cop/lint/script_permission.rb
         | 
| 410 | 
            +
            - lib/rubocop/cop/lint/self_assignment.rb
         | 
| 392 411 | 
             
            - lib/rubocop/cop/lint/send_with_mixin_argument.rb
         | 
| 393 412 | 
             
            - lib/rubocop/cop/lint/shadowed_argument.rb
         | 
| 394 413 | 
             
            - lib/rubocop/cop/lint/shadowed_exception.rb
         | 
| @@ -397,16 +416,17 @@ files: | |
| 397 416 | 
             
            - lib/rubocop/cop/lint/suppressed_exception.rb
         | 
| 398 417 | 
             
            - lib/rubocop/cop/lint/syntax.rb
         | 
| 399 418 | 
             
            - lib/rubocop/cop/lint/to_json.rb
         | 
| 419 | 
            +
            - lib/rubocop/cop/lint/top_level_return_with_argument.rb
         | 
| 400 420 | 
             
            - lib/rubocop/cop/lint/underscore_prefixed_variable_name.rb
         | 
| 401 421 | 
             
            - lib/rubocop/cop/lint/unified_integer.rb
         | 
| 402 422 | 
             
            - lib/rubocop/cop/lint/unreachable_code.rb
         | 
| 423 | 
            +
            - lib/rubocop/cop/lint/unreachable_loop.rb
         | 
| 403 424 | 
             
            - lib/rubocop/cop/lint/unused_block_argument.rb
         | 
| 404 425 | 
             
            - lib/rubocop/cop/lint/unused_method_argument.rb
         | 
| 405 426 | 
             
            - lib/rubocop/cop/lint/uri_escape_unescape.rb
         | 
| 406 427 | 
             
            - lib/rubocop/cop/lint/uri_regexp.rb
         | 
| 407 428 | 
             
            - lib/rubocop/cop/lint/useless_access_modifier.rb
         | 
| 408 429 | 
             
            - lib/rubocop/cop/lint/useless_assignment.rb
         | 
| 409 | 
            -
            - lib/rubocop/cop/lint/useless_comparison.rb
         | 
| 410 430 | 
             
            - lib/rubocop/cop/lint/useless_else_without_rescue.rb
         | 
| 411 431 | 
             
            - lib/rubocop/cop/lint/useless_setter_call.rb
         | 
| 412 432 | 
             
            - lib/rubocop/cop/lint/void.rb
         | 
| @@ -421,14 +441,18 @@ files: | |
| 421 441 | 
             
            - lib/rubocop/cop/metrics/parameter_lists.rb
         | 
| 422 442 | 
             
            - lib/rubocop/cop/metrics/perceived_complexity.rb
         | 
| 423 443 | 
             
            - lib/rubocop/cop/metrics/utils/abc_size_calculator.rb
         | 
| 444 | 
            +
            - lib/rubocop/cop/metrics/utils/code_length_calculator.rb
         | 
| 445 | 
            +
            - lib/rubocop/cop/metrics/utils/iterating_block.rb
         | 
| 446 | 
            +
            - lib/rubocop/cop/metrics/utils/repeated_csend_discount.rb
         | 
| 424 447 | 
             
            - lib/rubocop/cop/migration/department_name.rb
         | 
| 425 448 | 
             
            - lib/rubocop/cop/mixin/alignment.rb
         | 
| 449 | 
            +
            - lib/rubocop/cop/mixin/allowed_methods.rb
         | 
| 426 450 | 
             
            - lib/rubocop/cop/mixin/annotation_comment.rb
         | 
| 427 451 | 
             
            - lib/rubocop/cop/mixin/array_min_size.rb
         | 
| 428 452 | 
             
            - lib/rubocop/cop/mixin/array_syntax.rb
         | 
| 453 | 
            +
            - lib/rubocop/cop/mixin/auto_corrector.rb
         | 
| 429 454 | 
             
            - lib/rubocop/cop/mixin/check_assignment.rb
         | 
| 430 455 | 
             
            - lib/rubocop/cop/mixin/check_line_breakable.rb
         | 
| 431 | 
            -
            - lib/rubocop/cop/mixin/classish_length.rb
         | 
| 432 456 | 
             
            - lib/rubocop/cop/mixin/code_length.rb
         | 
| 433 457 | 
             
            - lib/rubocop/cop/mixin/configurable_enforced_style.rb
         | 
| 434 458 | 
             
            - lib/rubocop/cop/mixin/configurable_formatting.rb
         | 
| @@ -465,7 +489,6 @@ files: | |
| 465 489 | 
             
            - lib/rubocop/cop/mixin/on_normal_if_unless.rb
         | 
| 466 490 | 
             
            - lib/rubocop/cop/mixin/ordered_gem_node.rb
         | 
| 467 491 | 
             
            - lib/rubocop/cop/mixin/parentheses.rb
         | 
| 468 | 
            -
            - lib/rubocop/cop/mixin/parser_diagnostic.rb
         | 
| 469 492 | 
             
            - lib/rubocop/cop/mixin/percent_array.rb
         | 
| 470 493 | 
             
            - lib/rubocop/cop/mixin/percent_literal.rb
         | 
| 471 494 | 
             
            - lib/rubocop/cop/mixin/preceding_following_alignment.rb
         | 
| @@ -482,11 +505,11 @@ files: | |
| 482 505 | 
             
            - lib/rubocop/cop/mixin/string_literals_help.rb
         | 
| 483 506 | 
             
            - lib/rubocop/cop/mixin/surrounding_space.rb
         | 
| 484 507 | 
             
            - lib/rubocop/cop/mixin/target_ruby_version.rb
         | 
| 485 | 
            -
            - lib/rubocop/cop/mixin/too_many_lines.rb
         | 
| 486 508 | 
             
            - lib/rubocop/cop/mixin/trailing_body.rb
         | 
| 487 509 | 
             
            - lib/rubocop/cop/mixin/trailing_comma.rb
         | 
| 488 510 | 
             
            - lib/rubocop/cop/mixin/uncommunicative_name.rb
         | 
| 489 511 | 
             
            - lib/rubocop/cop/mixin/unused_argument.rb
         | 
| 512 | 
            +
            - lib/rubocop/cop/mixin/visibility_help.rb
         | 
| 490 513 | 
             
            - lib/rubocop/cop/naming/accessor_method_name.rb
         | 
| 491 514 | 
             
            - lib/rubocop/cop/naming/ascii_identifiers.rb
         | 
| 492 515 | 
             
            - lib/rubocop/cop/naming/binary_operator_parameter_name.rb
         | 
| @@ -512,17 +535,21 @@ files: | |
| 512 535 | 
             
            - lib/rubocop/cop/security/yaml_load.rb
         | 
| 513 536 | 
             
            - lib/rubocop/cop/severity.rb
         | 
| 514 537 | 
             
            - lib/rubocop/cop/style/access_modifier_declarations.rb
         | 
| 538 | 
            +
            - lib/rubocop/cop/style/accessor_grouping.rb
         | 
| 515 539 | 
             
            - lib/rubocop/cop/style/alias.rb
         | 
| 516 540 | 
             
            - lib/rubocop/cop/style/and_or.rb
         | 
| 541 | 
            +
            - lib/rubocop/cop/style/array_coercion.rb
         | 
| 517 542 | 
             
            - lib/rubocop/cop/style/array_join.rb
         | 
| 518 543 | 
             
            - lib/rubocop/cop/style/ascii_comments.rb
         | 
| 519 544 | 
             
            - lib/rubocop/cop/style/attr.rb
         | 
| 520 545 | 
             
            - lib/rubocop/cop/style/auto_resource_cleanup.rb
         | 
| 521 546 | 
             
            - lib/rubocop/cop/style/bare_percent_literals.rb
         | 
| 522 547 | 
             
            - lib/rubocop/cop/style/begin_block.rb
         | 
| 548 | 
            +
            - lib/rubocop/cop/style/bisected_attr_accessor.rb
         | 
| 523 549 | 
             
            - lib/rubocop/cop/style/block_comments.rb
         | 
| 524 550 | 
             
            - lib/rubocop/cop/style/block_delimiters.rb
         | 
| 525 551 | 
             
            - lib/rubocop/cop/style/case_equality.rb
         | 
| 552 | 
            +
            - lib/rubocop/cop/style/case_like_if.rb
         | 
| 526 553 | 
             
            - lib/rubocop/cop/style/character_literal.rb
         | 
| 527 554 | 
             
            - lib/rubocop/cop/style/class_and_module_children.rb
         | 
| 528 555 | 
             
            - lib/rubocop/cop/style/class_check.rb
         | 
| @@ -558,15 +585,19 @@ files: | |
| 558 585 | 
             
            - lib/rubocop/cop/style/eval_with_location.rb
         | 
| 559 586 | 
             
            - lib/rubocop/cop/style/even_odd.rb
         | 
| 560 587 | 
             
            - lib/rubocop/cop/style/expand_path_arguments.rb
         | 
| 588 | 
            +
            - lib/rubocop/cop/style/explicit_block_argument.rb
         | 
| 561 589 | 
             
            - lib/rubocop/cop/style/exponential_notation.rb
         | 
| 562 590 | 
             
            - lib/rubocop/cop/style/float_division.rb
         | 
| 563 591 | 
             
            - lib/rubocop/cop/style/for.rb
         | 
| 564 592 | 
             
            - lib/rubocop/cop/style/format_string.rb
         | 
| 565 593 | 
             
            - lib/rubocop/cop/style/format_string_token.rb
         | 
| 566 594 | 
             
            - lib/rubocop/cop/style/frozen_string_literal_comment.rb
         | 
| 595 | 
            +
            - lib/rubocop/cop/style/global_std_stream.rb
         | 
| 567 596 | 
             
            - lib/rubocop/cop/style/global_vars.rb
         | 
| 568 597 | 
             
            - lib/rubocop/cop/style/guard_clause.rb
         | 
| 598 | 
            +
            - lib/rubocop/cop/style/hash_as_last_array_item.rb
         | 
| 569 599 | 
             
            - lib/rubocop/cop/style/hash_each_methods.rb
         | 
| 600 | 
            +
            - lib/rubocop/cop/style/hash_like_case.rb
         | 
| 570 601 | 
             
            - lib/rubocop/cop/style/hash_syntax.rb
         | 
| 571 602 | 
             
            - lib/rubocop/cop/style/hash_transform_keys.rb
         | 
| 572 603 | 
             
            - lib/rubocop/cop/style/hash_transform_values.rb
         | 
| @@ -589,7 +620,6 @@ files: | |
| 589 620 | 
             
            - lib/rubocop/cop/style/method_call_without_args_parentheses.rb
         | 
| 590 621 | 
             
            - lib/rubocop/cop/style/method_called_on_do_end_block.rb
         | 
| 591 622 | 
             
            - lib/rubocop/cop/style/method_def_parentheses.rb
         | 
| 592 | 
            -
            - lib/rubocop/cop/style/method_missing_super.rb
         | 
| 593 623 | 
             
            - lib/rubocop/cop/style/min_max.rb
         | 
| 594 624 | 
             
            - lib/rubocop/cop/style/missing_else.rb
         | 
| 595 625 | 
             
            - lib/rubocop/cop/style/missing_respond_to_missing.rb
         | 
| @@ -621,6 +651,7 @@ files: | |
| 621 651 | 
             
            - lib/rubocop/cop/style/one_line_conditional.rb
         | 
| 622 652 | 
             
            - lib/rubocop/cop/style/option_hash.rb
         | 
| 623 653 | 
             
            - lib/rubocop/cop/style/optional_arguments.rb
         | 
| 654 | 
            +
            - lib/rubocop/cop/style/optional_boolean_parameter.rb
         | 
| 624 655 | 
             
            - lib/rubocop/cop/style/or_assignment.rb
         | 
| 625 656 | 
             
            - lib/rubocop/cop/style/parallel_assignment.rb
         | 
| 626 657 | 
             
            - lib/rubocop/cop/style/parentheses_around_condition.rb
         | 
| @@ -631,11 +662,14 @@ files: | |
| 631 662 | 
             
            - lib/rubocop/cop/style/proc.rb
         | 
| 632 663 | 
             
            - lib/rubocop/cop/style/raise_args.rb
         | 
| 633 664 | 
             
            - lib/rubocop/cop/style/random_with_offset.rb
         | 
| 665 | 
            +
            - lib/rubocop/cop/style/redundant_assignment.rb
         | 
| 634 666 | 
             
            - lib/rubocop/cop/style/redundant_begin.rb
         | 
| 635 667 | 
             
            - lib/rubocop/cop/style/redundant_capital_w.rb
         | 
| 636 668 | 
             
            - lib/rubocop/cop/style/redundant_condition.rb
         | 
| 637 669 | 
             
            - lib/rubocop/cop/style/redundant_conditional.rb
         | 
| 638 670 | 
             
            - lib/rubocop/cop/style/redundant_exception.rb
         | 
| 671 | 
            +
            - lib/rubocop/cop/style/redundant_fetch_block.rb
         | 
| 672 | 
            +
            - lib/rubocop/cop/style/redundant_file_extension_in_require.rb
         | 
| 639 673 | 
             
            - lib/rubocop/cop/style/redundant_freeze.rb
         | 
| 640 674 | 
             
            - lib/rubocop/cop/style/redundant_interpolation.rb
         | 
| 641 675 | 
             
            - lib/rubocop/cop/style/redundant_parentheses.rb
         | 
| @@ -656,12 +690,14 @@ files: | |
| 656 690 | 
             
            - lib/rubocop/cop/style/semicolon.rb
         | 
| 657 691 | 
             
            - lib/rubocop/cop/style/send.rb
         | 
| 658 692 | 
             
            - lib/rubocop/cop/style/signal_exception.rb
         | 
| 693 | 
            +
            - lib/rubocop/cop/style/single_argument_dig.rb
         | 
| 659 694 | 
             
            - lib/rubocop/cop/style/single_line_block_params.rb
         | 
| 660 695 | 
             
            - lib/rubocop/cop/style/single_line_methods.rb
         | 
| 661 696 | 
             
            - lib/rubocop/cop/style/slicing_with_range.rb
         | 
| 662 697 | 
             
            - lib/rubocop/cop/style/special_global_vars.rb
         | 
| 663 698 | 
             
            - lib/rubocop/cop/style/stabby_lambda_parentheses.rb
         | 
| 664 699 | 
             
            - lib/rubocop/cop/style/stderr_puts.rb
         | 
| 700 | 
            +
            - lib/rubocop/cop/style/string_concatenation.rb
         | 
| 665 701 | 
             
            - lib/rubocop/cop/style/string_hash_keys.rb
         | 
| 666 702 | 
             
            - lib/rubocop/cop/style/string_literals.rb
         | 
| 667 703 | 
             
            - lib/rubocop/cop/style/string_literals_in_interpolation.rb
         | 
| @@ -692,6 +728,7 @@ files: | |
| 692 728 | 
             
            - lib/rubocop/cop/style/yoda_condition.rb
         | 
| 693 729 | 
             
            - lib/rubocop/cop/style/zero_length_predicate.rb
         | 
| 694 730 | 
             
            - lib/rubocop/cop/team.rb
         | 
| 731 | 
            +
            - lib/rubocop/cop/tokens_util.rb
         | 
| 695 732 | 
             
            - lib/rubocop/cop/util.rb
         | 
| 696 733 | 
             
            - lib/rubocop/cop/utils/format_string.rb
         | 
| 697 734 | 
             
            - lib/rubocop/cop/variable_force.rb
         | 
| @@ -702,6 +739,7 @@ files: | |
| 702 739 | 
             
            - lib/rubocop/cop/variable_force/scope.rb
         | 
| 703 740 | 
             
            - lib/rubocop/cop/variable_force/variable.rb
         | 
| 704 741 | 
             
            - lib/rubocop/cop/variable_force/variable_table.rb
         | 
| 742 | 
            +
            - lib/rubocop/cops_documentation_generator.rb
         | 
| 705 743 | 
             
            - lib/rubocop/core_ext/string.rb
         | 
| 706 744 | 
             
            - lib/rubocop/error.rb
         | 
| 707 745 | 
             
            - lib/rubocop/ext/processed_source.rb
         |