rubocop 0.87.1 → 0.89.1
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 +1 -1
- data/bin/rubocop-profile +32 -0
- data/config/default.yml +153 -22
- data/lib/rubocop.rb +22 -4
- data/lib/rubocop/cli.rb +2 -2
- data/lib/rubocop/cli/command/auto_genenerate_config.rb +3 -3
- data/lib/rubocop/cli/command/base.rb +1 -0
- data/lib/rubocop/cli/command/execute_runner.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 +5 -7
- data/lib/rubocop/config.rb +20 -3
- data/lib/rubocop/config_loader.rb +22 -9
- data/lib/rubocop/config_loader_resolver.rb +3 -3
- data/lib/rubocop/config_obsoletion.rb +6 -1
- data/lib/rubocop/config_store.rb +4 -0
- data/lib/rubocop/config_validator.rb +2 -4
- data/lib/rubocop/cop/autocorrect_logic.rb +1 -1
- data/lib/rubocop/cop/badge.rb +1 -1
- data/lib/rubocop/cop/base.rb +14 -6
- data/lib/rubocop/cop/commissioner.rb +0 -1
- data/lib/rubocop/cop/cop.rb +1 -1
- data/lib/rubocop/cop/correctors/line_break_corrector.rb +4 -4
- data/lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb +26 -0
- data/lib/rubocop/cop/correctors/percent_literal_corrector.rb +2 -2
- 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 +38 -12
- data/lib/rubocop/cop/generator/configuration_injector.rb +2 -2
- 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/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/class_structure.rb +3 -7
- data/lib/rubocop/cop/layout/comment_indentation.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/end_alignment.rb +3 -2
- data/lib/rubocop/cop/layout/extra_spacing.rb +22 -36
- data/lib/rubocop/cop/layout/first_method_argument_line_break.rb +1 -1
- 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/leading_comment_space.rb +1 -1
- data/lib/rubocop/cop/layout/multiline_block_layout.rb +16 -5
- 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_around_block_parameters.rb +3 -2
- data/lib/rubocop/cop/layout/space_around_method_call_operator.rb +33 -66
- data/lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb +3 -2
- 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 +50 -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 +1 -1
- 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 +17 -13
- 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 +1 -1
- data/lib/rubocop/cop/lint/format_parameter_mismatch.rb +5 -4
- 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 +18 -15
- 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 +14 -20
- 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 +82 -11
- 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 +90 -0
- data/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb +4 -10
- data/lib/rubocop/cop/lint/percent_string_array.rb +13 -12
- data/lib/rubocop/cop/lint/percent_symbol_array.rb +13 -12
- data/lib/rubocop/cop/lint/raise_exception.rb +12 -10
- data/lib/rubocop/cop/lint/rand_one.rb +2 -2
- data/lib/rubocop/cop/lint/redundant_cop_disable_directive.rb +16 -19
- 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 +13 -9
- 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 +4 -6
- 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 +7 -7
- 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/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 +8 -3
- data/lib/rubocop/cop/lint/uri_escape_unescape.rb +1 -1
- data/lib/rubocop/cop/lint/uri_regexp.rb +11 -47
- data/lib/rubocop/cop/lint/useless_access_modifier.rb +25 -15
- 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 +2 -2
- data/lib/rubocop/cop/metrics/block_nesting.rb +2 -2
- data/lib/rubocop/cop/metrics/class_length.rb +2 -2
- data/lib/rubocop/cop/metrics/cyclomatic_complexity.rb +2 -1
- data/lib/rubocop/cop/metrics/method_length.rb +2 -2
- data/lib/rubocop/cop/metrics/module_length.rb +2 -2
- 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 +48 -5
- data/lib/rubocop/cop/metrics/utils/code_length_calculator.rb +52 -24
- data/lib/rubocop/cop/metrics/utils/repeated_csend_discount.rb +37 -0
- data/lib/rubocop/cop/migration/department_name.rb +14 -16
- data/lib/rubocop/cop/mixin/alignment.rb +2 -1
- data/lib/rubocop/cop/mixin/array_min_size.rb +1 -1
- data/lib/rubocop/cop/mixin/check_line_breakable.rb +2 -2
- data/lib/rubocop/cop/mixin/code_length.rb +22 -5
- data/lib/rubocop/cop/mixin/hash_transform_method.rb +5 -11
- data/lib/rubocop/cop/mixin/line_length_help.rb +1 -3
- data/lib/rubocop/cop/mixin/method_complexity.rb +10 -2
- data/lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb +1 -2
- data/lib/rubocop/cop/mixin/percent_array.rb +2 -6
- data/lib/rubocop/cop/mixin/range_help.rb +18 -4
- data/lib/rubocop/cop/mixin/statement_modifier.rb +39 -10
- data/lib/rubocop/cop/mixin/surrounding_space.rb +0 -25
- data/lib/rubocop/cop/mixin/trailing_comma.rb +2 -4
- data/lib/rubocop/cop/mixin/uncommunicative_name.rb +6 -13
- data/lib/rubocop/cop/mixin/unused_argument.rb +4 -6
- data/lib/rubocop/cop/naming/accessor_method_name.rb +4 -2
- data/lib/rubocop/cop/naming/ascii_identifiers.rb +3 -3
- data/lib/rubocop/cop/naming/binary_operator_parameter_name.rb +1 -1
- 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 +3 -3
- data/lib/rubocop/cop/naming/heredoc_delimiter_case.rb +2 -2
- data/lib/rubocop/cop/naming/heredoc_delimiter_naming.rb +2 -2
- data/lib/rubocop/cop/naming/memoized_instance_variable_name.rb +2 -2
- data/lib/rubocop/cop/naming/method_parameter_name.rb +1 -1
- data/lib/rubocop/cop/naming/predicate_name.rb +3 -5
- data/lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb +12 -11
- 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 +16 -9
- data/lib/rubocop/cop/style/accessor_grouping.rb +29 -20
- data/lib/rubocop/cop/style/alias.rb +41 -36
- data/lib/rubocop/cop/style/and_or.rb +9 -11
- data/lib/rubocop/cop/style/array_coercion.rb +63 -0
- data/lib/rubocop/cop/style/array_join.rb +6 -8
- data/lib/rubocop/cop/style/ascii_comments.rb +4 -4
- data/lib/rubocop/cop/style/attr.rb +11 -9
- data/lib/rubocop/cop/style/auto_resource_cleanup.rb +5 -7
- data/lib/rubocop/cop/style/bare_percent_literals.rb +10 -12
- data/lib/rubocop/cop/style/begin_block.rb +2 -2
- data/lib/rubocop/cop/style/bisected_attr_accessor.rb +14 -18
- data/lib/rubocop/cop/style/block_comments.rb +14 -18
- data/lib/rubocop/cop/style/block_delimiters.rb +23 -23
- data/lib/rubocop/cop/style/case_equality.rb +22 -3
- data/lib/rubocop/cop/style/case_like_if.rb +220 -0
- data/lib/rubocop/cop/style/class_and_module_children.rb +14 -11
- data/lib/rubocop/cop/style/class_check.rb +7 -9
- data/lib/rubocop/cop/style/class_methods.rb +7 -11
- data/lib/rubocop/cop/style/class_vars.rb +6 -10
- data/lib/rubocop/cop/style/collection_methods.rb +11 -17
- data/lib/rubocop/cop/style/colon_method_call.rb +8 -9
- data/lib/rubocop/cop/style/colon_method_definition.rb +6 -6
- data/lib/rubocop/cop/style/command_literal.rb +23 -24
- data/lib/rubocop/cop/style/comment_annotation.rb +15 -15
- data/lib/rubocop/cop/style/commented_keyword.rb +6 -3
- data/lib/rubocop/cop/style/conditional_assignment.rb +13 -4
- data/lib/rubocop/cop/style/constant_visibility.rb +3 -2
- data/lib/rubocop/cop/style/copyright.rb +12 -12
- data/lib/rubocop/cop/style/date_time.rb +1 -1
- data/lib/rubocop/cop/style/def_with_parentheses.rb +8 -10
- data/lib/rubocop/cop/style/dir.rb +7 -10
- data/lib/rubocop/cop/style/disable_cops_within_source_code_directive.rb +7 -9
- data/lib/rubocop/cop/style/documentation.rb +6 -8
- data/lib/rubocop/cop/style/documentation_method.rb +1 -1
- data/lib/rubocop/cop/style/double_cop_disable_directive.rb +12 -15
- data/lib/rubocop/cop/style/double_negation.rb +2 -2
- data/lib/rubocop/cop/style/each_for_simple_loop.rb +5 -8
- data/lib/rubocop/cop/style/each_with_object.rb +16 -19
- data/lib/rubocop/cop/style/empty_case_condition.rb +19 -20
- data/lib/rubocop/cop/style/empty_else.rb +17 -19
- data/lib/rubocop/cop/style/empty_literal.rb +15 -16
- data/lib/rubocop/cop/style/empty_method.rb +10 -13
- data/lib/rubocop/cop/style/encoding.rb +5 -9
- data/lib/rubocop/cop/style/end_block.rb +4 -6
- data/lib/rubocop/cop/style/eval_with_location.rb +9 -7
- data/lib/rubocop/cop/style/even_odd.rb +7 -11
- data/lib/rubocop/cop/style/expand_path_arguments.rb +21 -20
- data/lib/rubocop/cop/style/explicit_block_argument.rb +102 -0
- data/lib/rubocop/cop/style/exponential_notation.rb +7 -9
- data/lib/rubocop/cop/style/float_division.rb +8 -11
- data/lib/rubocop/cop/style/for.rb +11 -15
- data/lib/rubocop/cop/style/format_string.rb +21 -19
- data/lib/rubocop/cop/style/format_string_token.rb +10 -12
- data/lib/rubocop/cop/style/frozen_string_literal_comment.rb +19 -41
- data/lib/rubocop/cop/style/global_std_stream.rb +65 -0
- data/lib/rubocop/cop/style/global_vars.rb +2 -2
- data/lib/rubocop/cop/style/guard_clause.rb +5 -6
- data/lib/rubocop/cop/style/hash_as_last_array_item.rb +69 -0
- data/lib/rubocop/cop/style/hash_each_methods.rb +5 -8
- data/lib/rubocop/cop/style/hash_like_case.rb +76 -0
- data/lib/rubocop/cop/style/hash_syntax.rb +4 -3
- data/lib/rubocop/cop/style/hash_transform_keys.rb +3 -2
- data/lib/rubocop/cop/style/hash_transform_values.rb +2 -1
- data/lib/rubocop/cop/style/identical_conditional_branches.rb +2 -2
- data/lib/rubocop/cop/style/if_inside_else.rb +3 -3
- data/lib/rubocop/cop/style/if_unless_modifier.rb +18 -40
- data/lib/rubocop/cop/style/if_unless_modifier_of_if_unless.rb +3 -7
- data/lib/rubocop/cop/style/if_with_semicolon.rb +3 -6
- data/lib/rubocop/cop/style/implicit_runtime_error.rb +1 -1
- data/lib/rubocop/cop/style/infinite_loop.rb +24 -24
- data/lib/rubocop/cop/style/inline_comment.rb +3 -3
- data/lib/rubocop/cop/style/inverse_methods.rb +22 -32
- data/lib/rubocop/cop/style/lambda.rb +7 -12
- data/lib/rubocop/cop/style/lambda_call.rb +14 -13
- data/lib/rubocop/cop/style/line_end_concatenation.rb +19 -16
- data/lib/rubocop/cop/style/method_call_with_args_parentheses.rb +2 -1
- data/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb +16 -11
- data/lib/rubocop/cop/style/method_call_with_args_parentheses/require_parentheses.rb +4 -8
- data/lib/rubocop/cop/style/method_call_without_args_parentheses.rb +8 -7
- data/lib/rubocop/cop/style/method_called_on_do_end_block.rb +2 -2
- data/lib/rubocop/cop/style/method_def_parentheses.rb +11 -16
- data/lib/rubocop/cop/style/min_max.rb +8 -12
- data/lib/rubocop/cop/style/missing_else.rb +11 -21
- data/lib/rubocop/cop/style/missing_respond_to_missing.rb +10 -3
- data/lib/rubocop/cop/style/mixin_grouping.rb +24 -27
- data/lib/rubocop/cop/style/mixin_usage.rb +1 -1
- data/lib/rubocop/cop/style/module_function.rb +10 -13
- data/lib/rubocop/cop/style/multiline_if_modifier.rb +3 -10
- data/lib/rubocop/cop/style/multiline_if_then.rb +4 -10
- data/lib/rubocop/cop/style/multiline_memoization.rb +14 -12
- data/lib/rubocop/cop/style/multiline_method_signature.rb +2 -2
- data/lib/rubocop/cop/style/multiline_ternary_operator.rb +4 -6
- data/lib/rubocop/cop/style/multiline_when_then.rb +7 -9
- data/lib/rubocop/cop/style/multiple_comparison.rb +1 -1
- data/lib/rubocop/cop/style/mutable_constant.rb +23 -20
- data/lib/rubocop/cop/style/nested_parenthesized_calls.rb +3 -1
- 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 +1 -1
- data/lib/rubocop/cop/style/random_with_offset.rb +1 -0
- data/lib/rubocop/cop/style/redundant_condition.rb +15 -3
- data/lib/rubocop/cop/style/redundant_exception.rb +4 -0
- data/lib/rubocop/cop/style/redundant_file_extension_in_require.rb +50 -0
- data/lib/rubocop/cop/style/redundant_regexp_escape.rb +9 -9
- data/lib/rubocop/cop/style/redundant_sort.rb +26 -12
- data/lib/rubocop/cop/style/safe_navigation.rb +4 -4
- data/lib/rubocop/cop/style/signal_exception.rb +2 -0
- data/lib/rubocop/cop/style/single_argument_dig.rb +54 -0
- data/lib/rubocop/cop/style/single_line_methods.rb +1 -1
- data/lib/rubocop/cop/style/stabby_lambda_parentheses.rb +3 -2
- data/lib/rubocop/cop/style/string_concatenation.rb +92 -0
- data/lib/rubocop/cop/style/struct_inheritance.rb +1 -1
- data/lib/rubocop/cop/style/symbol_array.rb +1 -1
- data/lib/rubocop/cop/style/symbol_proc.rb +1 -1
- data/lib/rubocop/cop/style/trailing_method_end_statement.rb +9 -32
- data/lib/rubocop/cop/style/zero_length_predicate.rb +10 -6
- data/lib/rubocop/cop/team.rb +1 -1
- data/lib/rubocop/cop/tokens_util.rb +84 -0
- data/lib/rubocop/cop/util.rb +3 -13
- 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 +1 -1
- data/lib/rubocop/formatter/formatter_set.rb +1 -0
- data/lib/rubocop/formatter/junit_formatter.rb +1 -1
- data/lib/rubocop/options.rb +3 -3
- data/lib/rubocop/path_util.rb +17 -17
- data/lib/rubocop/rake_task.rb +1 -0
- data/lib/rubocop/result_cache.rb +12 -8
- data/lib/rubocop/rspec/expect_offense.rb +31 -5
- data/lib/rubocop/rspec/shared_contexts.rb +13 -14
- data/lib/rubocop/runner.rb +6 -7
- data/lib/rubocop/target_finder.rb +13 -10
- data/lib/rubocop/version.rb +2 -2
- metadata +28 -8
- data/lib/rubocop/cop/lint/useless_comparison.rb +0 -28
- data/lib/rubocop/cop/mixin/parser_diagnostic.rb +0 -37
- data/lib/rubocop/cop/mixin/too_many_lines.rb +0 -25
- data/lib/rubocop/cop/style/method_missing_super.rb +0 -34
data/lib/rubocop/result_cache.rb
CHANGED
@@ -33,7 +33,7 @@ module RuboCop
|
|
33
33
|
|
34
34
|
def requires_file_removal?(file_count, config_store)
|
35
35
|
file_count > 1 &&
|
36
|
-
file_count > config_store.
|
36
|
+
file_count > config_store.for_pwd.for_all_cops['MaxFilesInCache']
|
37
37
|
end
|
38
38
|
|
39
39
|
def remove_oldest_files(files, dirs, cache_root, verbose)
|
@@ -60,7 +60,7 @@ module RuboCop
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def self.cache_root(config_store)
|
63
|
-
root = config_store.
|
63
|
+
root = config_store.for_pwd.for_all_cops['CacheRootDirectory']
|
64
64
|
root ||= if ENV.key?('XDG_CACHE_HOME')
|
65
65
|
# Include user ID in the path to make sure the user has write
|
66
66
|
# access.
|
@@ -72,7 +72,7 @@ module RuboCop
|
|
72
72
|
end
|
73
73
|
|
74
74
|
def self.allow_symlinks_in_cache_location?(config_store)
|
75
|
-
config_store.
|
75
|
+
config_store.for_pwd.for_all_cops['AllowSymlinksInCacheRootDirectory']
|
76
76
|
end
|
77
77
|
|
78
78
|
def initialize(file, team, options, config_store, cache_root = nil)
|
@@ -158,6 +158,7 @@ module RuboCop
|
|
158
158
|
end
|
159
159
|
|
160
160
|
# The checksum of the rubocop program running the inspection.
|
161
|
+
# rubocop:disable Metrics/AbcSize
|
161
162
|
def rubocop_checksum
|
162
163
|
ResultCache.source_checksum ||=
|
163
164
|
begin
|
@@ -168,13 +169,16 @@ module RuboCop
|
|
168
169
|
# exe directory. A change to any of them could affect the cop output
|
169
170
|
# so we include them in the cache hash.
|
170
171
|
source_files = $LOADED_FEATURES + Find.find(exe_root).to_a
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
172
|
+
|
173
|
+
digest = Digest::SHA1.new
|
174
|
+
source_files
|
175
|
+
.select { |path| File.file?(path) }
|
176
|
+
.sort!
|
177
|
+
.each { |path| digest << File.mtime(path).to_s }
|
178
|
+
digest.hexdigest
|
176
179
|
end
|
177
180
|
end
|
181
|
+
# rubocop:enable Metrics/AbcSize
|
178
182
|
|
179
183
|
# Return a hash of the options given at invocation, minus the ones that have
|
180
184
|
# no effect on which offenses and disabled line ranges are found, and thus
|
@@ -73,19 +73,20 @@ module RuboCop
|
|
73
73
|
# expect_no_corrections
|
74
74
|
#
|
75
75
|
# If your code has variables of different lengths, you can use `%{foo}`,
|
76
|
-
# `^{foo}`, and `_{foo}` to format your template
|
76
|
+
# `^{foo}`, and `_{foo}` to format your template; you can also abbreviate
|
77
|
+
# offense messages with `[...]`:
|
77
78
|
#
|
78
79
|
# %w[raise fail].each do |keyword|
|
79
80
|
# expect_offense(<<~RUBY, keyword: keyword)
|
80
81
|
# %{keyword}(RuntimeError, msg)
|
81
|
-
# ^{keyword}^^^^^^^^^^^^^^^^^^^ Redundant `RuntimeError` argument
|
82
|
+
# ^{keyword}^^^^^^^^^^^^^^^^^^^ Redundant `RuntimeError` argument [...]
|
82
83
|
# RUBY
|
83
84
|
#
|
84
85
|
# %w[has_one has_many].each do |type|
|
85
86
|
# expect_offense(<<~RUBY, type: type)
|
86
87
|
# class Book
|
87
88
|
# %{type} :chapter, foreign_key: 'book_id'
|
88
|
-
# _{type} ^^^^^^^^^^^^^^^^^^^^^^ Specifying the default
|
89
|
+
# _{type} ^^^^^^^^^^^^^^^^^^^^^^ Specifying the default [...]
|
89
90
|
# end
|
90
91
|
# RUBY
|
91
92
|
# end
|
@@ -102,6 +103,7 @@ module RuboCop
|
|
102
103
|
module ExpectOffense
|
103
104
|
def format_offense(source, **replacements)
|
104
105
|
replacements.each do |keyword, value|
|
106
|
+
value = value.to_s
|
105
107
|
source = source.gsub("%{#{keyword}}", value)
|
106
108
|
.gsub("^{#{keyword}}", '^' * value.size)
|
107
109
|
.gsub("_{#{keyword}}", ' ' * value.size)
|
@@ -132,7 +134,7 @@ module RuboCop
|
|
132
134
|
actual_annotations =
|
133
135
|
expected_annotations.with_offense_annotations(offenses)
|
134
136
|
|
135
|
-
expect(actual_annotations
|
137
|
+
expect(actual_annotations).to eq(expected_annotations), ''
|
136
138
|
expect(offenses.map(&:severity).uniq).to eq([severity]) if severity
|
137
139
|
end
|
138
140
|
|
@@ -188,6 +190,7 @@ module RuboCop
|
|
188
190
|
# Parsed representation of code annotated with the `^^^ Message` style
|
189
191
|
class AnnotatedSource
|
190
192
|
ANNOTATION_PATTERN = /\A\s*(\^+|\^{}) /.freeze
|
193
|
+
ABBREV = "[...]\n"
|
191
194
|
|
192
195
|
# @param annotated_source [String] string passed to the matchers
|
193
196
|
#
|
@@ -206,6 +209,7 @@ module RuboCop
|
|
206
209
|
source << source_line
|
207
210
|
end
|
208
211
|
end
|
212
|
+
annotations.each { |a| a[0] = 1 } if source.empty?
|
209
213
|
|
210
214
|
new(source, annotations)
|
211
215
|
end
|
@@ -221,6 +225,27 @@ module RuboCop
|
|
221
225
|
@annotations = annotations.sort.freeze
|
222
226
|
end
|
223
227
|
|
228
|
+
def ==(other)
|
229
|
+
other.is_a?(self.class) &&
|
230
|
+
other.lines == lines &&
|
231
|
+
match_annotations?(other)
|
232
|
+
end
|
233
|
+
|
234
|
+
# Dirty hack: expectations with [...] are rewritten when they match
|
235
|
+
# This way the diff is clean.
|
236
|
+
def match_annotations?(other)
|
237
|
+
annotations.zip(other.annotations) do |(_actual_line, actual_annotation),
|
238
|
+
(_expected_line, expected_annotation)|
|
239
|
+
if expected_annotation&.end_with?(ABBREV)
|
240
|
+
if actual_annotation.start_with?(expected_annotation[0...-ABBREV.length])
|
241
|
+
expected_annotation.replace(actual_annotation)
|
242
|
+
end
|
243
|
+
end
|
244
|
+
end
|
245
|
+
|
246
|
+
annotations == other.annotations
|
247
|
+
end
|
248
|
+
|
224
249
|
# Construct annotated source string (like what we parse)
|
225
250
|
#
|
226
251
|
# Reconstruct a deterministic annotated source string. This is
|
@@ -253,6 +278,7 @@ module RuboCop
|
|
253
278
|
|
254
279
|
reconstructed.join
|
255
280
|
end
|
281
|
+
alias inspect to_s
|
256
282
|
|
257
283
|
# Return the plain source code without annotations
|
258
284
|
#
|
@@ -279,7 +305,7 @@ module RuboCop
|
|
279
305
|
self.class.new(lines, offense_annotations)
|
280
306
|
end
|
281
307
|
|
282
|
-
|
308
|
+
protected
|
283
309
|
|
284
310
|
attr_reader :lines, :annotations
|
285
311
|
end
|
@@ -12,19 +12,22 @@ RSpec.shared_context 'isolated environment', :isolated_environment do
|
|
12
12
|
# get mismatched pathnames when loading config files later on.
|
13
13
|
tmpdir = File.realpath(tmpdir)
|
14
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
|
+
|
15
24
|
# Make upwards search for .rubocop.yml files stop at this directory.
|
16
|
-
RuboCop::FileFinder.root_level =
|
25
|
+
RuboCop::FileFinder.root_level = working_dir
|
17
26
|
|
18
27
|
begin
|
19
|
-
|
20
|
-
Dir.mkdir(virtual_home)
|
21
|
-
ENV['HOME'] = virtual_home
|
22
|
-
ENV.delete('XDG_CONFIG_HOME')
|
23
|
-
|
24
|
-
working_dir = File.join(tmpdir, 'work')
|
25
|
-
Dir.mkdir(working_dir)
|
28
|
+
FileUtils.mkdir_p(working_dir)
|
26
29
|
|
27
|
-
|
30
|
+
Dir.chdir(working_dir) do
|
28
31
|
example.run
|
29
32
|
end
|
30
33
|
ensure
|
@@ -41,8 +44,6 @@ end
|
|
41
44
|
RSpec.shared_context 'config', :config do # rubocop:disable Metrics/BlockLength
|
42
45
|
### Meant to be overridden at will
|
43
46
|
|
44
|
-
let(:source) { 'code = {some: :ruby}' }
|
45
|
-
|
46
47
|
let(:cop_class) do
|
47
48
|
unless described_class.is_a?(Class) && described_class < RuboCop::Cop::Base
|
48
49
|
raise 'Specify which cop class to use (e.g `let(:cop_class) { RuboCop::Cop::Base }`, ' \
|
@@ -94,9 +95,7 @@ RSpec.shared_context 'config', :config do # rubocop:disable Metrics/BlockLength
|
|
94
95
|
end
|
95
96
|
|
96
97
|
let(:cop) do
|
97
|
-
cop_class.new(config, cop_options)
|
98
|
-
cop.send :begin_investigation, processed_source
|
99
|
-
end
|
98
|
+
cop_class.new(config, cop_options)
|
100
99
|
end
|
101
100
|
end
|
102
101
|
|
data/lib/rubocop/runner.rb
CHANGED
@@ -118,8 +118,7 @@ module RuboCop
|
|
118
118
|
|
119
119
|
def file_offenses(file)
|
120
120
|
file_offense_cache(file) do
|
121
|
-
source =
|
122
|
-
source, offenses = do_inspection_loop(file, source)
|
121
|
+
source, offenses = do_inspection_loop(file)
|
123
122
|
offenses = add_redundant_disables(file, offenses.compact.sort, source)
|
124
123
|
offenses.sort.reject(&:disabled?).freeze
|
125
124
|
end
|
@@ -159,8 +158,7 @@ module RuboCop
|
|
159
158
|
# Do one extra inspection loop if any redundant disables were
|
160
159
|
# removed. This is done in order to find rubocop:enable directives that
|
161
160
|
# have now become useless.
|
162
|
-
_source, new_offenses = do_inspection_loop(file
|
163
|
-
get_processed_source(file))
|
161
|
+
_source, new_offenses = do_inspection_loop(file)
|
164
162
|
offenses |= new_offenses
|
165
163
|
end
|
166
164
|
end
|
@@ -213,7 +211,7 @@ module RuboCop
|
|
213
211
|
@cached_run ||=
|
214
212
|
(@options[:cache] == 'true' ||
|
215
213
|
@options[:cache] != 'false' &&
|
216
|
-
@config_store.
|
214
|
+
@config_store.for_pwd.for_all_cops['UseCache']) &&
|
217
215
|
# When running --auto-gen-config, there's some processing done in the
|
218
216
|
# cops related to calculating the Max parameters for Metrics cops. We
|
219
217
|
# need to do that processing and cannot use caching.
|
@@ -232,7 +230,8 @@ module RuboCop
|
|
232
230
|
cache.save(offenses)
|
233
231
|
end
|
234
232
|
|
235
|
-
def do_inspection_loop(file
|
233
|
+
def do_inspection_loop(file)
|
234
|
+
processed_source = get_processed_source(file)
|
236
235
|
offenses = []
|
237
236
|
|
238
237
|
# When running with --auto-correct, we need to inspect the file (which
|
@@ -307,7 +306,7 @@ module RuboCop
|
|
307
306
|
def mobilized_cop_classes(config)
|
308
307
|
@mobilized_cop_classes ||= {}
|
309
308
|
@mobilized_cop_classes[config.object_id] ||= begin
|
310
|
-
cop_classes = Cop::
|
309
|
+
cop_classes = Cop::Registry.all
|
311
310
|
|
312
311
|
OptionsValidator.new(@options).validate_cop_options
|
313
312
|
|
@@ -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,14 +125,17 @@ 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)
|
@@ -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/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.1'
|
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.1
|
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-10 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: parallel
|
@@ -94,7 +94,7 @@ dependencies:
|
|
94
94
|
requirements:
|
95
95
|
- - ">="
|
96
96
|
- !ruby/object:Gem::Version
|
97
|
-
version: 0.
|
97
|
+
version: 0.3.0
|
98
98
|
- - "<"
|
99
99
|
- !ruby/object:Gem::Version
|
100
100
|
version: '1.0'
|
@@ -104,7 +104,7 @@ dependencies:
|
|
104
104
|
requirements:
|
105
105
|
- - ">="
|
106
106
|
- !ruby/object:Gem::Version
|
107
|
-
version: 0.
|
107
|
+
version: 0.3.0
|
108
108
|
- - "<"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '1.0'
|
@@ -178,6 +178,7 @@ files:
|
|
178
178
|
- assets/logo.png
|
179
179
|
- assets/output.html.erb
|
180
180
|
- bin/console
|
181
|
+
- bin/rubocop-profile
|
181
182
|
- bin/setup
|
182
183
|
- config/default.yml
|
183
184
|
- exe/rubocop
|
@@ -339,6 +340,7 @@ files:
|
|
339
340
|
- lib/rubocop/cop/lint/ambiguous_regexp_literal.rb
|
340
341
|
- lib/rubocop/cop/lint/assignment_in_condition.rb
|
341
342
|
- lib/rubocop/cop/lint/big_decimal_new.rb
|
343
|
+
- lib/rubocop/cop/lint/binary_operator_with_identical_operands.rb
|
342
344
|
- lib/rubocop/cop/lint/boolean_symbol.rb
|
343
345
|
- lib/rubocop/cop/lint/circular_argument_reference.rb
|
344
346
|
- lib/rubocop/cop/lint/constant_resolution.rb
|
@@ -347,10 +349,13 @@ files:
|
|
347
349
|
- lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb
|
348
350
|
- lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb
|
349
351
|
- lib/rubocop/cop/lint/duplicate_case_condition.rb
|
352
|
+
- lib/rubocop/cop/lint/duplicate_elsif_condition.rb
|
350
353
|
- lib/rubocop/cop/lint/duplicate_hash_key.rb
|
351
354
|
- lib/rubocop/cop/lint/duplicate_methods.rb
|
355
|
+
- lib/rubocop/cop/lint/duplicate_rescue_exception.rb
|
352
356
|
- lib/rubocop/cop/lint/each_with_object_argument.rb
|
353
357
|
- lib/rubocop/cop/lint/else_layout.rb
|
358
|
+
- lib/rubocop/cop/lint/empty_conditional_body.rb
|
354
359
|
- lib/rubocop/cop/lint/empty_ensure.rb
|
355
360
|
- lib/rubocop/cop/lint/empty_expression.rb
|
356
361
|
- lib/rubocop/cop/lint/empty_interpolation.rb
|
@@ -358,6 +363,7 @@ files:
|
|
358
363
|
- lib/rubocop/cop/lint/ensure_return.rb
|
359
364
|
- lib/rubocop/cop/lint/erb_new_arguments.rb
|
360
365
|
- lib/rubocop/cop/lint/flip_flop.rb
|
366
|
+
- lib/rubocop/cop/lint/float_comparison.rb
|
361
367
|
- lib/rubocop/cop/lint/float_out_of_range.rb
|
362
368
|
- lib/rubocop/cop/lint/format_parameter_mismatch.rb
|
363
369
|
- lib/rubocop/cop/lint/heredoc_method_call_position.rb
|
@@ -369,6 +375,7 @@ files:
|
|
369
375
|
- lib/rubocop/cop/lint/literal_in_interpolation.rb
|
370
376
|
- lib/rubocop/cop/lint/loop.rb
|
371
377
|
- lib/rubocop/cop/lint/missing_cop_enable_directive.rb
|
378
|
+
- lib/rubocop/cop/lint/missing_super.rb
|
372
379
|
- lib/rubocop/cop/lint/mixed_regexp_capture_types.rb
|
373
380
|
- lib/rubocop/cop/lint/multiple_comparison.rb
|
374
381
|
- lib/rubocop/cop/lint/nested_method_definition.rb
|
@@ -378,6 +385,7 @@ files:
|
|
378
385
|
- lib/rubocop/cop/lint/non_local_exit_from_iterator.rb
|
379
386
|
- lib/rubocop/cop/lint/number_conversion.rb
|
380
387
|
- lib/rubocop/cop/lint/ordered_magic_comments.rb
|
388
|
+
- lib/rubocop/cop/lint/out_of_range_regexp_ref.rb
|
381
389
|
- lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb
|
382
390
|
- lib/rubocop/cop/lint/percent_string_array.rb
|
383
391
|
- lib/rubocop/cop/lint/percent_symbol_array.rb
|
@@ -399,6 +407,7 @@ files:
|
|
399
407
|
- lib/rubocop/cop/lint/safe_navigation_consistency.rb
|
400
408
|
- lib/rubocop/cop/lint/safe_navigation_with_empty.rb
|
401
409
|
- lib/rubocop/cop/lint/script_permission.rb
|
410
|
+
- lib/rubocop/cop/lint/self_assignment.rb
|
402
411
|
- lib/rubocop/cop/lint/send_with_mixin_argument.rb
|
403
412
|
- lib/rubocop/cop/lint/shadowed_argument.rb
|
404
413
|
- lib/rubocop/cop/lint/shadowed_exception.rb
|
@@ -407,16 +416,17 @@ files:
|
|
407
416
|
- lib/rubocop/cop/lint/suppressed_exception.rb
|
408
417
|
- lib/rubocop/cop/lint/syntax.rb
|
409
418
|
- lib/rubocop/cop/lint/to_json.rb
|
419
|
+
- lib/rubocop/cop/lint/top_level_return_with_argument.rb
|
410
420
|
- lib/rubocop/cop/lint/underscore_prefixed_variable_name.rb
|
411
421
|
- lib/rubocop/cop/lint/unified_integer.rb
|
412
422
|
- lib/rubocop/cop/lint/unreachable_code.rb
|
423
|
+
- lib/rubocop/cop/lint/unreachable_loop.rb
|
413
424
|
- lib/rubocop/cop/lint/unused_block_argument.rb
|
414
425
|
- lib/rubocop/cop/lint/unused_method_argument.rb
|
415
426
|
- lib/rubocop/cop/lint/uri_escape_unescape.rb
|
416
427
|
- lib/rubocop/cop/lint/uri_regexp.rb
|
417
428
|
- lib/rubocop/cop/lint/useless_access_modifier.rb
|
418
429
|
- lib/rubocop/cop/lint/useless_assignment.rb
|
419
|
-
- lib/rubocop/cop/lint/useless_comparison.rb
|
420
430
|
- lib/rubocop/cop/lint/useless_else_without_rescue.rb
|
421
431
|
- lib/rubocop/cop/lint/useless_setter_call.rb
|
422
432
|
- lib/rubocop/cop/lint/void.rb
|
@@ -433,6 +443,7 @@ files:
|
|
433
443
|
- lib/rubocop/cop/metrics/utils/abc_size_calculator.rb
|
434
444
|
- lib/rubocop/cop/metrics/utils/code_length_calculator.rb
|
435
445
|
- lib/rubocop/cop/metrics/utils/iterating_block.rb
|
446
|
+
- lib/rubocop/cop/metrics/utils/repeated_csend_discount.rb
|
436
447
|
- lib/rubocop/cop/migration/department_name.rb
|
437
448
|
- lib/rubocop/cop/mixin/alignment.rb
|
438
449
|
- lib/rubocop/cop/mixin/allowed_methods.rb
|
@@ -478,7 +489,6 @@ files:
|
|
478
489
|
- lib/rubocop/cop/mixin/on_normal_if_unless.rb
|
479
490
|
- lib/rubocop/cop/mixin/ordered_gem_node.rb
|
480
491
|
- lib/rubocop/cop/mixin/parentheses.rb
|
481
|
-
- lib/rubocop/cop/mixin/parser_diagnostic.rb
|
482
492
|
- lib/rubocop/cop/mixin/percent_array.rb
|
483
493
|
- lib/rubocop/cop/mixin/percent_literal.rb
|
484
494
|
- lib/rubocop/cop/mixin/preceding_following_alignment.rb
|
@@ -495,7 +505,6 @@ files:
|
|
495
505
|
- lib/rubocop/cop/mixin/string_literals_help.rb
|
496
506
|
- lib/rubocop/cop/mixin/surrounding_space.rb
|
497
507
|
- lib/rubocop/cop/mixin/target_ruby_version.rb
|
498
|
-
- lib/rubocop/cop/mixin/too_many_lines.rb
|
499
508
|
- lib/rubocop/cop/mixin/trailing_body.rb
|
500
509
|
- lib/rubocop/cop/mixin/trailing_comma.rb
|
501
510
|
- lib/rubocop/cop/mixin/uncommunicative_name.rb
|
@@ -529,6 +538,7 @@ files:
|
|
529
538
|
- lib/rubocop/cop/style/accessor_grouping.rb
|
530
539
|
- lib/rubocop/cop/style/alias.rb
|
531
540
|
- lib/rubocop/cop/style/and_or.rb
|
541
|
+
- lib/rubocop/cop/style/array_coercion.rb
|
532
542
|
- lib/rubocop/cop/style/array_join.rb
|
533
543
|
- lib/rubocop/cop/style/ascii_comments.rb
|
534
544
|
- lib/rubocop/cop/style/attr.rb
|
@@ -539,6 +549,7 @@ files:
|
|
539
549
|
- lib/rubocop/cop/style/block_comments.rb
|
540
550
|
- lib/rubocop/cop/style/block_delimiters.rb
|
541
551
|
- lib/rubocop/cop/style/case_equality.rb
|
552
|
+
- lib/rubocop/cop/style/case_like_if.rb
|
542
553
|
- lib/rubocop/cop/style/character_literal.rb
|
543
554
|
- lib/rubocop/cop/style/class_and_module_children.rb
|
544
555
|
- lib/rubocop/cop/style/class_check.rb
|
@@ -574,15 +585,19 @@ files:
|
|
574
585
|
- lib/rubocop/cop/style/eval_with_location.rb
|
575
586
|
- lib/rubocop/cop/style/even_odd.rb
|
576
587
|
- lib/rubocop/cop/style/expand_path_arguments.rb
|
588
|
+
- lib/rubocop/cop/style/explicit_block_argument.rb
|
577
589
|
- lib/rubocop/cop/style/exponential_notation.rb
|
578
590
|
- lib/rubocop/cop/style/float_division.rb
|
579
591
|
- lib/rubocop/cop/style/for.rb
|
580
592
|
- lib/rubocop/cop/style/format_string.rb
|
581
593
|
- lib/rubocop/cop/style/format_string_token.rb
|
582
594
|
- lib/rubocop/cop/style/frozen_string_literal_comment.rb
|
595
|
+
- lib/rubocop/cop/style/global_std_stream.rb
|
583
596
|
- lib/rubocop/cop/style/global_vars.rb
|
584
597
|
- lib/rubocop/cop/style/guard_clause.rb
|
598
|
+
- lib/rubocop/cop/style/hash_as_last_array_item.rb
|
585
599
|
- lib/rubocop/cop/style/hash_each_methods.rb
|
600
|
+
- lib/rubocop/cop/style/hash_like_case.rb
|
586
601
|
- lib/rubocop/cop/style/hash_syntax.rb
|
587
602
|
- lib/rubocop/cop/style/hash_transform_keys.rb
|
588
603
|
- lib/rubocop/cop/style/hash_transform_values.rb
|
@@ -605,7 +620,6 @@ files:
|
|
605
620
|
- lib/rubocop/cop/style/method_call_without_args_parentheses.rb
|
606
621
|
- lib/rubocop/cop/style/method_called_on_do_end_block.rb
|
607
622
|
- lib/rubocop/cop/style/method_def_parentheses.rb
|
608
|
-
- lib/rubocop/cop/style/method_missing_super.rb
|
609
623
|
- lib/rubocop/cop/style/min_max.rb
|
610
624
|
- lib/rubocop/cop/style/missing_else.rb
|
611
625
|
- lib/rubocop/cop/style/missing_respond_to_missing.rb
|
@@ -637,6 +651,7 @@ files:
|
|
637
651
|
- lib/rubocop/cop/style/one_line_conditional.rb
|
638
652
|
- lib/rubocop/cop/style/option_hash.rb
|
639
653
|
- lib/rubocop/cop/style/optional_arguments.rb
|
654
|
+
- lib/rubocop/cop/style/optional_boolean_parameter.rb
|
640
655
|
- lib/rubocop/cop/style/or_assignment.rb
|
641
656
|
- lib/rubocop/cop/style/parallel_assignment.rb
|
642
657
|
- lib/rubocop/cop/style/parentheses_around_condition.rb
|
@@ -654,6 +669,7 @@ files:
|
|
654
669
|
- lib/rubocop/cop/style/redundant_conditional.rb
|
655
670
|
- lib/rubocop/cop/style/redundant_exception.rb
|
656
671
|
- lib/rubocop/cop/style/redundant_fetch_block.rb
|
672
|
+
- lib/rubocop/cop/style/redundant_file_extension_in_require.rb
|
657
673
|
- lib/rubocop/cop/style/redundant_freeze.rb
|
658
674
|
- lib/rubocop/cop/style/redundant_interpolation.rb
|
659
675
|
- lib/rubocop/cop/style/redundant_parentheses.rb
|
@@ -674,12 +690,14 @@ files:
|
|
674
690
|
- lib/rubocop/cop/style/semicolon.rb
|
675
691
|
- lib/rubocop/cop/style/send.rb
|
676
692
|
- lib/rubocop/cop/style/signal_exception.rb
|
693
|
+
- lib/rubocop/cop/style/single_argument_dig.rb
|
677
694
|
- lib/rubocop/cop/style/single_line_block_params.rb
|
678
695
|
- lib/rubocop/cop/style/single_line_methods.rb
|
679
696
|
- lib/rubocop/cop/style/slicing_with_range.rb
|
680
697
|
- lib/rubocop/cop/style/special_global_vars.rb
|
681
698
|
- lib/rubocop/cop/style/stabby_lambda_parentheses.rb
|
682
699
|
- lib/rubocop/cop/style/stderr_puts.rb
|
700
|
+
- lib/rubocop/cop/style/string_concatenation.rb
|
683
701
|
- lib/rubocop/cop/style/string_hash_keys.rb
|
684
702
|
- lib/rubocop/cop/style/string_literals.rb
|
685
703
|
- lib/rubocop/cop/style/string_literals_in_interpolation.rb
|
@@ -710,6 +728,7 @@ files:
|
|
710
728
|
- lib/rubocop/cop/style/yoda_condition.rb
|
711
729
|
- lib/rubocop/cop/style/zero_length_predicate.rb
|
712
730
|
- lib/rubocop/cop/team.rb
|
731
|
+
- lib/rubocop/cop/tokens_util.rb
|
713
732
|
- lib/rubocop/cop/util.rb
|
714
733
|
- lib/rubocop/cop/utils/format_string.rb
|
715
734
|
- lib/rubocop/cop/variable_force.rb
|
@@ -720,6 +739,7 @@ files:
|
|
720
739
|
- lib/rubocop/cop/variable_force/scope.rb
|
721
740
|
- lib/rubocop/cop/variable_force/variable.rb
|
722
741
|
- lib/rubocop/cop/variable_force/variable_table.rb
|
742
|
+
- lib/rubocop/cops_documentation_generator.rb
|
723
743
|
- lib/rubocop/core_ext/string.rb
|
724
744
|
- lib/rubocop/error.rb
|
725
745
|
- lib/rubocop/ext/processed_source.rb
|