rubocop 0.89.1 → 0.93.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 +2 -2
- data/config/default.yml +160 -14
- data/lib/rubocop.rb +33 -5
- data/lib/rubocop/cached_data.rb +3 -1
- data/lib/rubocop/cli/command.rb +1 -0
- data/lib/rubocop/cli/command/auto_genenerate_config.rb +1 -0
- data/lib/rubocop/cli/command/base.rb +1 -0
- data/lib/rubocop/cli/command/execute_runner.rb +9 -0
- data/lib/rubocop/cli/command/init_dotfile.rb +1 -0
- data/lib/rubocop/cli/command/show_cops.rb +1 -0
- data/lib/rubocop/cli/command/version.rb +1 -0
- data/lib/rubocop/cli/environment.rb +1 -0
- data/lib/rubocop/comment_config.rb +14 -5
- data/lib/rubocop/config_loader.rb +20 -9
- data/lib/rubocop/config_loader_resolver.rb +1 -0
- data/lib/rubocop/config_obsoletion.rb +1 -0
- data/lib/rubocop/config_regeneration.rb +33 -0
- data/lib/rubocop/config_store.rb +3 -3
- data/lib/rubocop/config_validator.rb +3 -0
- data/lib/rubocop/cop/base.rb +23 -0
- data/lib/rubocop/cop/bundler/duplicated_gem.rb +5 -1
- data/lib/rubocop/cop/bundler/gem_comment.rb +8 -3
- data/lib/rubocop/cop/bundler/insecure_protocol_source.rb +2 -0
- data/lib/rubocop/cop/commissioner.rb +47 -7
- data/lib/rubocop/cop/correctors/alignment_corrector.rb +4 -4
- data/lib/rubocop/cop/correctors/condition_corrector.rb +3 -5
- data/lib/rubocop/cop/correctors/empty_line_corrector.rb +9 -10
- data/lib/rubocop/cop/correctors/line_break_corrector.rb +4 -4
- data/lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb +8 -3
- data/lib/rubocop/cop/correctors/parentheses_corrector.rb +5 -8
- data/lib/rubocop/cop/correctors/percent_literal_corrector.rb +4 -9
- data/lib/rubocop/cop/correctors/punctuation_corrector.rb +8 -10
- data/lib/rubocop/cop/documentation.rb +22 -0
- data/lib/rubocop/cop/gemspec/required_ruby_version.rb +10 -10
- data/lib/rubocop/cop/generator.rb +2 -1
- data/lib/rubocop/cop/internal_affairs/method_name_equal.rb +1 -0
- data/lib/rubocop/cop/internal_affairs/node_type_predicate.rb +1 -0
- data/lib/rubocop/cop/internal_affairs/offense_location_keyword.rb +1 -0
- data/lib/rubocop/cop/internal_affairs/redundant_location_argument.rb +1 -0
- data/lib/rubocop/cop/internal_affairs/redundant_message_argument.rb +1 -0
- data/lib/rubocop/cop/layout/array_alignment.rb +1 -0
- data/lib/rubocop/cop/layout/begin_end_alignment.rb +77 -0
- data/lib/rubocop/cop/layout/block_alignment.rb +23 -19
- data/lib/rubocop/cop/layout/case_indentation.rb +4 -7
- data/lib/rubocop/cop/layout/class_structure.rb +11 -10
- data/lib/rubocop/cop/layout/closing_heredoc_indentation.rb +4 -6
- data/lib/rubocop/cop/layout/condition_position.rb +13 -15
- data/lib/rubocop/cop/layout/def_end_alignment.rb +8 -5
- data/lib/rubocop/cop/layout/dot_position.rb +21 -20
- data/lib/rubocop/cop/layout/empty_comment.rb +30 -23
- data/lib/rubocop/cop/layout/empty_line_after_guard_clause.rb +21 -18
- data/lib/rubocop/cop/layout/empty_line_after_magic_comment.rb +13 -13
- data/lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb +136 -0
- data/lib/rubocop/cop/layout/empty_line_between_defs.rb +21 -23
- data/lib/rubocop/cop/layout/empty_lines.rb +6 -7
- data/lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb +17 -14
- data/lib/rubocop/cop/layout/empty_lines_around_arguments.rb +7 -8
- data/lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb +5 -8
- data/lib/rubocop/cop/layout/empty_lines_around_begin_body.rb +2 -5
- data/lib/rubocop/cop/layout/empty_lines_around_block_body.rb +2 -5
- data/lib/rubocop/cop/layout/empty_lines_around_class_body.rb +2 -5
- data/lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb +3 -7
- data/lib/rubocop/cop/layout/empty_lines_around_method_body.rb +2 -5
- data/lib/rubocop/cop/layout/empty_lines_around_module_body.rb +2 -5
- data/lib/rubocop/cop/layout/end_alignment.rb +11 -17
- data/lib/rubocop/cop/layout/first_array_element_line_break.rb +2 -5
- data/lib/rubocop/cop/layout/first_hash_element_line_break.rb +2 -5
- data/lib/rubocop/cop/layout/first_method_argument_line_break.rb +4 -8
- data/lib/rubocop/cop/layout/first_method_parameter_line_break.rb +2 -5
- data/lib/rubocop/cop/layout/hash_alignment.rb +17 -20
- data/lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb +15 -14
- data/lib/rubocop/cop/layout/heredoc_indentation.rb +14 -11
- data/lib/rubocop/cop/layout/initial_indentation.rb +6 -7
- data/lib/rubocop/cop/layout/leading_comment_space.rb +11 -9
- data/lib/rubocop/cop/layout/leading_empty_lines.rb +6 -11
- data/lib/rubocop/cop/layout/multiline_array_brace_layout.rb +2 -5
- data/lib/rubocop/cop/layout/multiline_array_line_breaks.rb +2 -5
- data/lib/rubocop/cop/layout/multiline_assignment_layout.rb +10 -14
- data/lib/rubocop/cop/layout/multiline_block_layout.rb +21 -19
- data/lib/rubocop/cop/layout/multiline_hash_brace_layout.rb +2 -5
- data/lib/rubocop/cop/layout/multiline_hash_key_line_breaks.rb +2 -5
- data/lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb +5 -9
- data/lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb +2 -5
- data/lib/rubocop/cop/layout/multiline_method_definition_brace_layout.rb +2 -5
- data/lib/rubocop/cop/layout/rescue_ensure_alignment.rb +41 -22
- data/lib/rubocop/cop/layout/space_after_colon.rb +11 -7
- data/lib/rubocop/cop/layout/space_after_comma.rb +2 -5
- data/lib/rubocop/cop/layout/space_after_method_name.rb +5 -6
- data/lib/rubocop/cop/layout/space_after_not.rb +9 -11
- data/lib/rubocop/cop/layout/space_after_semicolon.rb +2 -5
- data/lib/rubocop/cop/layout/space_around_equals_in_parameter_default.rb +17 -21
- data/lib/rubocop/cop/layout/space_around_keyword.rb +17 -18
- data/lib/rubocop/cop/layout/space_around_operators.rb +17 -16
- data/lib/rubocop/cop/layout/space_before_block_braces.rb +23 -22
- data/lib/rubocop/cop/layout/space_before_comma.rb +3 -5
- data/lib/rubocop/cop/layout/space_before_comment.rb +10 -7
- data/lib/rubocop/cop/layout/space_before_first_arg.rb +7 -7
- data/lib/rubocop/cop/layout/space_before_semicolon.rb +2 -5
- data/lib/rubocop/cop/layout/space_in_lambda_literal.rb +9 -17
- data/lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb +20 -23
- data/lib/rubocop/cop/layout/space_inside_array_percent_literal.rb +3 -8
- data/lib/rubocop/cop/layout/space_inside_block_braces.rb +13 -16
- data/lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb +19 -37
- data/lib/rubocop/cop/layout/space_inside_parens.rb +9 -14
- data/lib/rubocop/cop/layout/space_inside_percent_literal_delimiters.rb +5 -10
- data/lib/rubocop/cop/layout/space_inside_range_literal.rb +8 -17
- data/lib/rubocop/cop/layout/space_inside_reference_brackets.rb +16 -24
- data/lib/rubocop/cop/layout/space_inside_string_interpolation.rb +12 -13
- data/lib/rubocop/cop/layout/trailing_empty_lines.rb +10 -15
- data/lib/rubocop/cop/layout/trailing_whitespace.rb +11 -11
- data/lib/rubocop/cop/lint/ambiguous_block_association.rb +2 -0
- data/lib/rubocop/cop/lint/ambiguous_operator.rb +2 -0
- data/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb +15 -1
- data/lib/rubocop/cop/lint/big_decimal_new.rb +1 -2
- data/lib/rubocop/cop/lint/binary_operator_with_identical_operands.rb +1 -1
- data/lib/rubocop/cop/lint/boolean_symbol.rb +3 -0
- data/lib/rubocop/cop/lint/constant_definition_in_block.rb +74 -0
- data/lib/rubocop/cop/lint/constant_resolution.rb +1 -1
- data/lib/rubocop/cop/lint/debugger.rb +2 -3
- data/lib/rubocop/cop/lint/deprecated_class_methods.rb +1 -3
- data/lib/rubocop/cop/lint/duplicate_methods.rb +2 -4
- data/lib/rubocop/cop/lint/duplicate_require.rb +46 -0
- data/lib/rubocop/cop/lint/duplicate_rescue_exception.rb +2 -15
- data/lib/rubocop/cop/lint/each_with_object_argument.rb +1 -0
- data/lib/rubocop/cop/lint/empty_file.rb +50 -0
- data/lib/rubocop/cop/lint/erb_new_arguments.rb +2 -0
- data/lib/rubocop/cop/lint/float_comparison.rb +2 -2
- data/lib/rubocop/cop/lint/format_parameter_mismatch.rb +2 -2
- data/lib/rubocop/cop/lint/hash_compare_by_identity.rb +37 -0
- data/lib/rubocop/cop/lint/identity_comparison.rb +51 -0
- data/lib/rubocop/cop/lint/ineffective_access_modifier.rb +2 -5
- data/lib/rubocop/cop/lint/inherit_exception.rb +2 -2
- data/lib/rubocop/cop/lint/missing_super.rb +2 -2
- data/lib/rubocop/cop/lint/mixed_regexp_capture_types.rb +3 -35
- data/lib/rubocop/cop/lint/multiple_comparison.rb +3 -1
- data/lib/rubocop/cop/lint/number_conversion.rb +1 -0
- data/lib/rubocop/cop/lint/out_of_range_regexp_ref.rb +9 -20
- data/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb +1 -1
- data/lib/rubocop/cop/lint/percent_string_array.rb +8 -12
- data/lib/rubocop/cop/lint/raise_exception.rb +1 -0
- data/lib/rubocop/cop/lint/rand_one.rb +2 -1
- data/lib/rubocop/cop/lint/redundant_cop_disable_directive.rb +22 -12
- data/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb +14 -4
- data/lib/rubocop/cop/lint/redundant_require_statement.rb +1 -0
- data/lib/rubocop/cop/lint/redundant_safe_navigation.rb +45 -0
- data/lib/rubocop/cop/lint/rescue_type.rb +0 -1
- data/lib/rubocop/cop/lint/send_with_mixin_argument.rb +3 -1
- data/lib/rubocop/cop/lint/shadowed_exception.rb +6 -6
- data/lib/rubocop/cop/lint/shadowing_outer_local_variable.rb +4 -4
- data/lib/rubocop/cop/lint/struct_new_override.rb +1 -0
- data/lib/rubocop/cop/lint/to_json.rb +16 -5
- data/lib/rubocop/cop/lint/top_level_return_with_argument.rb +1 -1
- data/lib/rubocop/cop/lint/trailing_comma_in_attribute_declaration.rb +57 -0
- data/lib/rubocop/cop/lint/unreachable_loop.rb +3 -6
- data/lib/rubocop/cop/lint/uri_escape_unescape.rb +3 -1
- data/lib/rubocop/cop/lint/uri_regexp.rb +2 -1
- data/lib/rubocop/cop/lint/useless_access_modifier.rb +3 -9
- data/lib/rubocop/cop/lint/useless_method_definition.rb +70 -0
- data/lib/rubocop/cop/lint/useless_times.rb +106 -0
- data/lib/rubocop/cop/metrics/block_length.rb +3 -1
- data/lib/rubocop/cop/metrics/class_length.rb +8 -6
- data/lib/rubocop/cop/metrics/utils/abc_size_calculator.rb +27 -16
- data/lib/rubocop/cop/metrics/utils/code_length_calculator.rb +1 -0
- data/lib/rubocop/cop/mixin/alignment.rb +3 -0
- data/lib/rubocop/cop/mixin/allowed_methods.rb +2 -0
- data/lib/rubocop/cop/mixin/annotation_comment.rb +5 -0
- data/lib/rubocop/cop/mixin/check_line_breakable.rb +16 -7
- data/lib/rubocop/cop/mixin/comments_help.rb +48 -0
- data/lib/rubocop/cop/mixin/configurable_naming.rb +2 -2
- data/lib/rubocop/cop/mixin/configurable_numbering.rb +3 -3
- data/lib/rubocop/cop/mixin/empty_lines_around_body.rb +8 -7
- data/lib/rubocop/cop/mixin/empty_parameter.rb +3 -1
- data/lib/rubocop/cop/mixin/end_keyword_alignment.rb +12 -1
- data/lib/rubocop/cop/mixin/first_element_line_break.rb +3 -1
- data/lib/rubocop/cop/mixin/hash_transform_method.rb +27 -2
- data/lib/rubocop/cop/mixin/multiline_element_line_breaks.rb +3 -1
- data/lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb +12 -10
- data/lib/rubocop/cop/mixin/negative_conditional.rb +2 -2
- data/lib/rubocop/cop/mixin/percent_array.rb +14 -3
- data/lib/rubocop/cop/mixin/rescue_node.rb +11 -1
- data/lib/rubocop/cop/mixin/space_after_punctuation.rb +4 -3
- data/lib/rubocop/cop/mixin/space_before_punctuation.rb +4 -3
- data/lib/rubocop/cop/mixin/statement_modifier.rb +9 -3
- data/lib/rubocop/cop/mixin/surrounding_space.rb +8 -4
- data/lib/rubocop/cop/mixin/trailing_comma.rb +7 -7
- data/lib/rubocop/cop/mixin/visibility_help.rb +4 -16
- data/lib/rubocop/cop/naming/binary_operator_parameter_name.rb +1 -1
- data/lib/rubocop/cop/naming/file_name.rb +1 -1
- data/lib/rubocop/cop/offense.rb +16 -2
- data/lib/rubocop/cop/security/eval.rb +1 -0
- data/lib/rubocop/cop/security/json_load.rb +1 -0
- data/lib/rubocop/cop/security/marshal_load.rb +1 -0
- data/lib/rubocop/cop/security/open.rb +1 -0
- data/lib/rubocop/cop/security/yaml_load.rb +1 -0
- data/lib/rubocop/cop/severity.rb +0 -8
- data/lib/rubocop/cop/style/access_modifier_declarations.rb +7 -11
- data/lib/rubocop/cop/style/accessor_grouping.rb +3 -0
- data/lib/rubocop/cop/style/alias.rb +2 -0
- data/lib/rubocop/cop/style/array_coercion.rb +4 -0
- data/lib/rubocop/cop/style/array_join.rb +1 -0
- data/lib/rubocop/cop/style/attr.rb +1 -0
- data/lib/rubocop/cop/style/auto_resource_cleanup.rb +2 -0
- data/lib/rubocop/cop/style/case_equality.rb +11 -3
- data/lib/rubocop/cop/style/case_like_if.rb +40 -8
- data/lib/rubocop/cop/style/class_and_module_children.rb +2 -0
- data/lib/rubocop/cop/style/class_check.rb +6 -9
- data/lib/rubocop/cop/style/class_equality_comparison.rb +49 -0
- data/lib/rubocop/cop/style/class_methods_definitions.rb +157 -0
- data/lib/rubocop/cop/style/class_vars.rb +1 -2
- data/lib/rubocop/cop/style/combinable_loops.rb +91 -0
- data/lib/rubocop/cop/style/comment_annotation.rb +6 -0
- data/lib/rubocop/cop/style/commented_keyword.rb +7 -8
- data/lib/rubocop/cop/style/conditional_assignment.rb +49 -60
- data/lib/rubocop/cop/style/date_time.rb +12 -1
- data/lib/rubocop/cop/style/dir.rb +1 -0
- data/lib/rubocop/cop/style/double_negation.rb +1 -0
- data/lib/rubocop/cop/style/empty_block_parameter.rb +9 -10
- data/lib/rubocop/cop/style/empty_lambda_parameter.rb +9 -10
- data/lib/rubocop/cop/style/empty_literal.rb +3 -1
- data/lib/rubocop/cop/style/eval_with_location.rb +1 -3
- data/lib/rubocop/cop/style/even_odd.rb +1 -0
- data/lib/rubocop/cop/style/expand_path_arguments.rb +2 -2
- data/lib/rubocop/cop/style/explicit_block_argument.rb +7 -3
- data/lib/rubocop/cop/style/float_division.rb +2 -0
- data/lib/rubocop/cop/style/for.rb +0 -4
- data/lib/rubocop/cop/style/format_string.rb +1 -4
- data/lib/rubocop/cop/style/format_string_token.rb +1 -1
- data/lib/rubocop/cop/style/guard_clause.rb +1 -0
- data/lib/rubocop/cop/style/hash_as_last_array_item.rb +24 -5
- data/lib/rubocop/cop/style/hash_syntax.rb +6 -5
- data/lib/rubocop/cop/style/hash_transform_keys.rb +16 -9
- data/lib/rubocop/cop/style/hash_transform_values.rb +16 -9
- data/lib/rubocop/cop/style/if_unless_modifier.rb +2 -6
- data/lib/rubocop/cop/style/implicit_runtime_error.rb +1 -0
- data/lib/rubocop/cop/style/keyword_parameters_order.rb +53 -0
- data/lib/rubocop/cop/style/lambda_call.rb +3 -1
- data/lib/rubocop/cop/style/method_called_on_do_end_block.rb +10 -1
- data/lib/rubocop/cop/style/method_def_parentheses.rb +0 -4
- data/lib/rubocop/cop/style/mixin_usage.rb +8 -27
- data/lib/rubocop/cop/style/multiline_block_chain.rb +2 -2
- data/lib/rubocop/cop/style/multiline_ternary_operator.rb +14 -1
- data/lib/rubocop/cop/style/multiline_when_then.rb +3 -2
- data/lib/rubocop/cop/style/negated_if.rb +6 -6
- data/lib/rubocop/cop/style/negated_unless.rb +6 -6
- data/lib/rubocop/cop/style/negated_while.rb +7 -15
- data/lib/rubocop/cop/style/nested_modifier.rb +10 -13
- data/lib/rubocop/cop/style/nested_parenthesized_calls.rb +11 -11
- data/lib/rubocop/cop/style/nested_ternary_operator.rb +16 -16
- data/lib/rubocop/cop/style/next.rb +10 -14
- data/lib/rubocop/cop/style/nil_comparison.rb +13 -11
- data/lib/rubocop/cop/style/non_nil_check.rb +34 -26
- data/lib/rubocop/cop/style/not.rb +20 -26
- data/lib/rubocop/cop/style/numeric_literal_prefix.rb +4 -9
- data/lib/rubocop/cop/style/numeric_predicate.rb +5 -14
- data/lib/rubocop/cop/style/one_line_conditional.rb +73 -23
- data/lib/rubocop/cop/style/option_hash.rb +1 -1
- data/lib/rubocop/cop/style/optional_arguments.rb +1 -1
- data/lib/rubocop/cop/style/optional_boolean_parameter.rb +12 -1
- data/lib/rubocop/cop/style/or_assignment.rb +13 -10
- data/lib/rubocop/cop/style/parallel_assignment.rb +14 -14
- data/lib/rubocop/cop/style/parentheses_around_condition.rb +6 -6
- data/lib/rubocop/cop/style/percent_literal_delimiters.rb +13 -19
- data/lib/rubocop/cop/style/percent_q_literals.rb +8 -10
- data/lib/rubocop/cop/style/perl_backrefs.rb +8 -10
- data/lib/rubocop/cop/style/preferred_hash_methods.rb +11 -14
- data/lib/rubocop/cop/style/proc.rb +6 -6
- data/lib/rubocop/cop/style/raise_args.rb +12 -24
- data/lib/rubocop/cop/style/random_with_offset.rb +19 -19
- data/lib/rubocop/cop/style/redundant_assignment.rb +8 -18
- data/lib/rubocop/cop/style/redundant_begin.rb +28 -12
- data/lib/rubocop/cop/style/redundant_capital_w.rb +6 -9
- data/lib/rubocop/cop/style/redundant_condition.rb +10 -7
- data/lib/rubocop/cop/style/redundant_conditional.rb +4 -5
- data/lib/rubocop/cop/style/redundant_exception.rb +1 -3
- data/lib/rubocop/cop/style/redundant_fetch_block.rb +3 -12
- data/lib/rubocop/cop/style/redundant_file_extension_in_require.rb +9 -8
- data/lib/rubocop/cop/style/redundant_freeze.rb +5 -7
- data/lib/rubocop/cop/style/redundant_interpolation.rb +31 -25
- data/lib/rubocop/cop/style/redundant_parentheses.rb +21 -15
- data/lib/rubocop/cop/style/redundant_percent_q.rb +9 -11
- data/lib/rubocop/cop/style/redundant_regexp_character_class.rb +44 -36
- data/lib/rubocop/cop/style/redundant_regexp_escape.rb +13 -29
- data/lib/rubocop/cop/style/redundant_return.rb +17 -17
- data/lib/rubocop/cop/style/redundant_self.rb +9 -11
- data/lib/rubocop/cop/style/redundant_self_assignment.rb +116 -0
- data/lib/rubocop/cop/style/redundant_sort.rb +12 -29
- data/lib/rubocop/cop/style/redundant_sort_by.rb +5 -9
- data/lib/rubocop/cop/style/regexp_literal.rb +10 -21
- data/lib/rubocop/cop/style/rescue_modifier.rb +29 -9
- data/lib/rubocop/cop/style/rescue_standard_error.rb +20 -16
- data/lib/rubocop/cop/style/return_nil.rb +5 -5
- data/lib/rubocop/cop/style/safe_navigation.rb +18 -12
- data/lib/rubocop/cop/style/sample.rb +12 -14
- data/lib/rubocop/cop/style/self_assignment.rb +26 -22
- data/lib/rubocop/cop/style/semicolon.rb +6 -9
- data/lib/rubocop/cop/style/send.rb +4 -5
- data/lib/rubocop/cop/style/signal_exception.rb +23 -19
- data/lib/rubocop/cop/style/single_argument_dig.rb +1 -0
- data/lib/rubocop/cop/style/single_line_block_params.rb +4 -2
- data/lib/rubocop/cop/style/single_line_methods.rb +17 -16
- data/lib/rubocop/cop/style/slicing_with_range.rb +6 -8
- data/lib/rubocop/cop/style/sole_nested_conditional.rb +66 -0
- data/lib/rubocop/cop/style/special_global_vars.rb +10 -15
- data/lib/rubocop/cop/style/stabby_lambda_parentheses.rb +17 -21
- data/lib/rubocop/cop/style/stderr_puts.rb +5 -6
- data/lib/rubocop/cop/style/string_concatenation.rb +17 -3
- data/lib/rubocop/cop/style/string_hash_keys.rb +6 -7
- data/lib/rubocop/cop/style/string_methods.rb +7 -17
- data/lib/rubocop/cop/style/strip.rb +9 -14
- data/lib/rubocop/cop/style/struct_inheritance.rb +3 -6
- data/lib/rubocop/cop/style/symbol_array.rb +5 -16
- data/lib/rubocop/cop/style/symbol_literal.rb +4 -6
- data/lib/rubocop/cop/style/symbol_proc.rb +14 -18
- data/lib/rubocop/cop/style/ternary_parentheses.rb +22 -22
- data/lib/rubocop/cop/style/trailing_body_on_class.rb +3 -6
- data/lib/rubocop/cop/style/trailing_body_on_method_definition.rb +4 -7
- data/lib/rubocop/cop/style/trailing_body_on_module.rb +3 -6
- data/lib/rubocop/cop/style/trailing_comma_in_arguments.rb +2 -5
- data/lib/rubocop/cop/style/trailing_comma_in_array_literal.rb +2 -5
- data/lib/rubocop/cop/style/trailing_comma_in_block_args.rb +11 -9
- data/lib/rubocop/cop/style/trailing_comma_in_hash_literal.rb +2 -5
- data/lib/rubocop/cop/style/trailing_underscore_variable.rb +8 -17
- data/lib/rubocop/cop/style/trivial_accessors.rb +26 -30
- data/lib/rubocop/cop/style/unless_else.rb +5 -8
- data/lib/rubocop/cop/style/unpack_first.rb +5 -8
- data/lib/rubocop/cop/style/variable_interpolation.rb +7 -10
- data/lib/rubocop/cop/style/when_then.rb +4 -6
- data/lib/rubocop/cop/style/while_until_do.rb +6 -16
- data/lib/rubocop/cop/style/while_until_modifier.rb +6 -20
- data/lib/rubocop/cop/style/word_array.rb +5 -23
- data/lib/rubocop/cop/style/yoda_condition.rb +4 -15
- data/lib/rubocop/cop/style/zero_length_predicate.rb +12 -18
- data/lib/rubocop/cop/team.rb +1 -0
- data/lib/rubocop/cop/util.rb +1 -2
- data/lib/rubocop/cop/utils/format_string.rb +3 -5
- data/lib/rubocop/cop/variable_force.rb +2 -0
- data/lib/rubocop/cop/variable_force/branch.rb +0 -4
- data/lib/rubocop/cops_documentation_generator.rb +4 -2
- data/lib/rubocop/core_ext/string.rb +2 -2
- data/lib/rubocop/directive_comment.rb +32 -0
- data/lib/rubocop/ext/regexp_node.rb +62 -0
- data/lib/rubocop/file_finder.rb +1 -0
- data/lib/rubocop/formatter/auto_gen_config_formatter.rb +2 -1
- data/lib/rubocop/formatter/disabled_config_formatter.rb +12 -5
- data/lib/rubocop/formatter/html_formatter.rb +2 -0
- data/lib/rubocop/formatter/progress_formatter.rb +2 -1
- data/lib/rubocop/formatter/quiet_formatter.rb +1 -1
- data/lib/rubocop/formatter/simple_text_formatter.rb +36 -6
- data/lib/rubocop/name_similarity.rb +1 -0
- data/lib/rubocop/options.rb +40 -17
- data/lib/rubocop/remote_config.rb +1 -0
- data/lib/rubocop/result_cache.rb +39 -15
- data/lib/rubocop/rspec/cop_helper.rb +5 -2
- data/lib/rubocop/rspec/expect_offense.rb +14 -9
- data/lib/rubocop/rspec/shared_contexts.rb +12 -0
- data/lib/rubocop/runner.rb +38 -18
- data/lib/rubocop/string_interpreter.rb +3 -0
- data/lib/rubocop/target_finder.rb +28 -26
- data/lib/rubocop/target_ruby.rb +7 -1
- data/lib/rubocop/version.rb +7 -1
- data/lib/rubocop/yaml_duplication_checker.rb +1 -0
- metadata +31 -17
- data/lib/rubocop/cop/mixin/regexp_literal_help.rb +0 -43
- data/lib/rubocop/cop/tokens_util.rb +0 -84
@@ -40,6 +40,18 @@ RSpec.shared_context 'isolated environment', :isolated_environment do
|
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
+
RSpec.shared_context 'maintain registry', :restore_registry do
|
44
|
+
around(:each) do |example|
|
45
|
+
RuboCop::Cop::Registry.with_temporary_global { example.run }
|
46
|
+
end
|
47
|
+
|
48
|
+
def stub_cop_class(name, inherit: RuboCop::Cop::Base, &block)
|
49
|
+
klass = Class.new(inherit, &block)
|
50
|
+
stub_const(name, klass)
|
51
|
+
klass
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
43
55
|
# This context assumes nothing and defines `cop`, among others.
|
44
56
|
RSpec.shared_context 'config', :config do # rubocop:disable Metrics/BlockLength
|
45
57
|
### Meant to be overridden at will
|
data/lib/rubocop/runner.rb
CHANGED
@@ -11,12 +11,20 @@ module RuboCop
|
|
11
11
|
class InfiniteCorrectionLoop < RuntimeError
|
12
12
|
attr_reader :offenses
|
13
13
|
|
14
|
-
def initialize(path,
|
15
|
-
|
16
|
-
|
14
|
+
def initialize(path, offenses_by_iteration, loop_start: -1)
|
15
|
+
@offenses = offenses_by_iteration.flatten.uniq
|
16
|
+
root_cause = offenses_by_iteration[loop_start..-1]
|
17
|
+
.map { |x| x.map(&:cop_name).uniq.join(', ') }
|
18
|
+
.join(' -> ')
|
19
|
+
|
20
|
+
message = 'Infinite loop detected'
|
21
|
+
message += " in #{path}" if path
|
22
|
+
message += " and caused by #{root_cause}" if root_cause
|
23
|
+
super message
|
17
24
|
end
|
18
25
|
end
|
19
26
|
|
27
|
+
# @api private
|
20
28
|
MAX_ITERATIONS = 200
|
21
29
|
|
22
30
|
attr_reader :errors, :warnings
|
@@ -80,7 +88,10 @@ module RuboCop
|
|
80
88
|
# OPTIMIZE: Calling `ResultCache.cleanup` takes time. This optimization
|
81
89
|
# mainly targets editors that integrates RuboCop. When RuboCop is run
|
82
90
|
# by an editor, it should be inspecting only one file.
|
83
|
-
|
91
|
+
if files.size > 1 && cached_run?
|
92
|
+
ResultCache.cleanup(@config_store, @options[:debug], @options[:cache_root])
|
93
|
+
end
|
94
|
+
|
84
95
|
formatter_set.finished(inspected_files.freeze)
|
85
96
|
formatter_set.close_output_files
|
86
97
|
end
|
@@ -232,18 +243,21 @@ module RuboCop
|
|
232
243
|
|
233
244
|
def do_inspection_loop(file)
|
234
245
|
processed_source = get_processed_source(file)
|
235
|
-
offenses
|
246
|
+
# This variable is 2d array used to track corrected offenses after each
|
247
|
+
# inspection iteration. This is used to output meaningful infinite loop
|
248
|
+
# error message.
|
249
|
+
offenses_by_iteration = []
|
236
250
|
|
237
251
|
# When running with --auto-correct, we need to inspect the file (which
|
238
252
|
# includes writing a corrected version of it) until no more corrections
|
239
253
|
# are made. This is because automatic corrections can introduce new
|
240
254
|
# offenses. In the normal case the loop is only executed once.
|
241
|
-
iterate_until_no_changes(processed_source,
|
255
|
+
iterate_until_no_changes(processed_source, offenses_by_iteration) do
|
242
256
|
# The offenses that couldn't be corrected will be found again so we
|
243
257
|
# only keep the corrected ones in order to avoid duplicate reporting.
|
244
|
-
|
258
|
+
!offenses_by_iteration.empty? && offenses_by_iteration.last.select!(&:corrected?)
|
245
259
|
new_offenses, updated_source_file = inspect_file(processed_source)
|
246
|
-
|
260
|
+
offenses_by_iteration.push(new_offenses)
|
247
261
|
|
248
262
|
# We have to reprocess the source to pickup the changes. Since the
|
249
263
|
# change could (theoretically) introduce parsing errors, we break the
|
@@ -253,10 +267,12 @@ module RuboCop
|
|
253
267
|
processed_source = get_processed_source(file)
|
254
268
|
end
|
255
269
|
|
270
|
+
# Return summary of corrected offenses after all iterations
|
271
|
+
offenses = offenses_by_iteration.flatten.uniq
|
256
272
|
[processed_source, offenses]
|
257
273
|
end
|
258
274
|
|
259
|
-
def iterate_until_no_changes(source,
|
275
|
+
def iterate_until_no_changes(source, offenses_by_iteration)
|
260
276
|
# Keep track of the state of the source. If a cop modifies the source
|
261
277
|
# and another cop undoes it producing identical source we have an
|
262
278
|
# infinite loop.
|
@@ -268,10 +284,10 @@ module RuboCop
|
|
268
284
|
iterations = 0
|
269
285
|
|
270
286
|
loop do
|
271
|
-
check_for_infinite_loop(source,
|
287
|
+
check_for_infinite_loop(source, offenses_by_iteration)
|
272
288
|
|
273
289
|
if (iterations += 1) > MAX_ITERATIONS
|
274
|
-
raise InfiniteCorrectionLoop.new(source.path,
|
290
|
+
raise InfiniteCorrectionLoop.new(source.path, offenses_by_iteration)
|
275
291
|
end
|
276
292
|
|
277
293
|
source = yield
|
@@ -281,11 +297,15 @@ module RuboCop
|
|
281
297
|
|
282
298
|
# Check whether a run created source identical to a previous run, which
|
283
299
|
# means that we definitely have an infinite loop.
|
284
|
-
def check_for_infinite_loop(processed_source,
|
300
|
+
def check_for_infinite_loop(processed_source, offenses_by_iteration)
|
285
301
|
checksum = processed_source.checksum
|
286
302
|
|
287
|
-
if @processed_sources.
|
288
|
-
raise InfiniteCorrectionLoop.new(
|
303
|
+
if (loop_start_index = @processed_sources.index(checksum))
|
304
|
+
raise InfiniteCorrectionLoop.new(
|
305
|
+
processed_source.path,
|
306
|
+
offenses_by_iteration,
|
307
|
+
loop_start: loop_start_index
|
308
|
+
)
|
289
309
|
end
|
290
310
|
|
291
311
|
@processed_sources << checksum
|
@@ -304,8 +324,8 @@ module RuboCop
|
|
304
324
|
end
|
305
325
|
|
306
326
|
def mobilized_cop_classes(config)
|
307
|
-
@mobilized_cop_classes ||= {}
|
308
|
-
@mobilized_cop_classes[config
|
327
|
+
@mobilized_cop_classes ||= {}.compare_by_identity
|
328
|
+
@mobilized_cop_classes[config] ||= begin
|
309
329
|
cop_classes = Cop::Registry.all
|
310
330
|
|
311
331
|
OptionsValidator.new(@options).validate_cop_options
|
@@ -379,8 +399,8 @@ module RuboCop
|
|
379
399
|
# otherwise dormant team that can be used for config- and option-
|
380
400
|
# level caching in ResultCache.
|
381
401
|
def standby_team(config)
|
382
|
-
@team_by_config ||= {}
|
383
|
-
@team_by_config[config
|
402
|
+
@team_by_config ||= {}.compare_by_identity
|
403
|
+
@team_by_config[config] ||=
|
384
404
|
Cop::Team.mobilize(mobilized_cop_classes(config), config, @options)
|
385
405
|
end
|
386
406
|
end
|
@@ -3,7 +3,10 @@
|
|
3
3
|
module RuboCop
|
4
4
|
# This class finds target files to inspect by scanning the directory tree
|
5
5
|
# and picking ruby files.
|
6
|
+
# @api private
|
6
7
|
class TargetFinder
|
8
|
+
HIDDEN_PATH_SUBSTRING = "#{File::SEPARATOR}."
|
9
|
+
|
7
10
|
def initialize(config_store, options = {})
|
8
11
|
@config_store = config_store
|
9
12
|
@options = options
|
@@ -54,7 +57,8 @@ module RuboCop
|
|
54
57
|
# Support Windows: Backslashes from command-line -> forward slashes
|
55
58
|
base_dir = base_dir.gsub(File::ALT_SEPARATOR, File::SEPARATOR) if File::ALT_SEPARATOR
|
56
59
|
all_files = find_files(base_dir, File::FNM_DOTMATCH)
|
57
|
-
|
60
|
+
# use file.include? for performance optimization
|
61
|
+
hidden_files = all_files.select { |file| file.include?(HIDDEN_PATH_SUBSTRING) }
|
58
62
|
base_dir_config = @config_store.for(base_dir)
|
59
63
|
|
60
64
|
target_files = all_files.select do |file|
|
@@ -77,34 +81,32 @@ module RuboCop
|
|
77
81
|
# the top level directories that are excluded in configuration in the
|
78
82
|
# normal way (dir/**/*).
|
79
83
|
def find_files(base_dir, flags)
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
84
|
+
# get all wanted directories first to improve speed of finding all files
|
85
|
+
exclude_pattern = combined_exclude_glob_patterns(base_dir)
|
86
|
+
dir_flags = flags | File::FNM_PATHNAME | File::FNM_EXTGLOB
|
87
|
+
patterns = wanted_dir_patterns(base_dir, exclude_pattern, dir_flags)
|
88
|
+
patterns.map! { |dir| File.join(dir, '*') }
|
89
|
+
# We need this special case to avoid creating the pattern
|
90
|
+
# /**/* which searches the entire file system.
|
91
|
+
patterns = [File.join(dir, '**/*')] if patterns.empty?
|
92
|
+
|
93
|
+
Dir.glob(patterns, flags).select { |path| FileTest.file?(path) }
|
94
|
+
end
|
95
|
+
|
96
|
+
def wanted_dir_patterns(base_dir, exclude_pattern, flags)
|
97
|
+
dirs = Dir.glob(File.join(base_dir, '*/'), flags)
|
98
|
+
.reject do |dir|
|
99
|
+
dir.end_with?('/./', '/../') || File.fnmatch?(exclude_pattern, dir, flags)
|
92
100
|
end
|
93
|
-
|
101
|
+
dirs.flat_map { |dir| wanted_dir_patterns(dir, exclude_pattern, flags) }
|
102
|
+
.unshift(base_dir)
|
94
103
|
end
|
95
104
|
|
96
|
-
def
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
def excluded_dirs(base_dir)
|
103
|
-
all_cops_config = @config_store.for(base_dir).for_all_cops
|
104
|
-
dir_tree_excludes = all_cops_config['Exclude'].select do |pattern|
|
105
|
-
pattern.is_a?(String) && pattern.end_with?('/**/*')
|
106
|
-
end
|
107
|
-
dir_tree_excludes.map { |pattern| pattern.sub(%r{/\*\*/\*$}, '') }
|
105
|
+
def combined_exclude_glob_patterns(base_dir)
|
106
|
+
exclude = @config_store.for(base_dir).for_all_cops['Exclude']
|
107
|
+
patterns = exclude.select { |pattern| pattern.is_a?(String) && pattern.end_with?('/**/*') }
|
108
|
+
.map { |pattern| pattern.sub("#{base_dir}/", '') }
|
109
|
+
"#{base_dir}/{#{patterns.join(',')}}"
|
108
110
|
end
|
109
111
|
|
110
112
|
def ruby_extension?(file)
|
data/lib/rubocop/target_ruby.rb
CHANGED
@@ -2,8 +2,9 @@
|
|
2
2
|
|
3
3
|
module RuboCop
|
4
4
|
# The kind of Ruby that code inspected by RuboCop is written in.
|
5
|
+
# @api private
|
5
6
|
class TargetRuby
|
6
|
-
KNOWN_RUBIES = [2.4, 2.5, 2.6, 2.7,
|
7
|
+
KNOWN_RUBIES = [2.4, 2.5, 2.6, 2.7, 3.0].freeze
|
7
8
|
DEFAULT_VERSION = KNOWN_RUBIES.first
|
8
9
|
|
9
10
|
OBSOLETE_RUBIES = {
|
@@ -12,6 +13,7 @@ module RuboCop
|
|
12
13
|
private_constant :KNOWN_RUBIES, :OBSOLETE_RUBIES
|
13
14
|
|
14
15
|
# A place where information about a target ruby version is found.
|
16
|
+
# @api private
|
15
17
|
class Source
|
16
18
|
attr_reader :version, :name
|
17
19
|
|
@@ -26,6 +28,7 @@ module RuboCop
|
|
26
28
|
end
|
27
29
|
|
28
30
|
# The target ruby version may be configured in RuboCop's config.
|
31
|
+
# @api private
|
29
32
|
class RuboCopConfig < Source
|
30
33
|
def name
|
31
34
|
"`TargetRubyVersion` parameter (in #{@config.smart_loaded_path})"
|
@@ -39,6 +42,7 @@ module RuboCop
|
|
39
42
|
end
|
40
43
|
|
41
44
|
# The target ruby version may be found in a .ruby-version file.
|
45
|
+
# @api private
|
42
46
|
class RubyVersionFile < Source
|
43
47
|
FILENAME = '.ruby-version'
|
44
48
|
|
@@ -68,6 +72,7 @@ module RuboCop
|
|
68
72
|
end
|
69
73
|
|
70
74
|
# The lock file of Bundler may identify the target ruby version.
|
75
|
+
# @api private
|
71
76
|
class BundlerLockFile < Source
|
72
77
|
def name
|
73
78
|
"`#{bundler_lock_file_path}`"
|
@@ -108,6 +113,7 @@ module RuboCop
|
|
108
113
|
end
|
109
114
|
|
110
115
|
# If all else fails, a default version will be picked.
|
116
|
+
# @api private
|
111
117
|
class Default < Source
|
112
118
|
def name
|
113
119
|
'default'
|
data/lib/rubocop/version.rb
CHANGED
@@ -3,12 +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.93.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
|
+
# @api private
|
12
13
|
def self.version(debug: false)
|
13
14
|
if debug
|
14
15
|
format(MSG, version: STRING, parser_version: Parser::VERSION,
|
@@ -19,5 +20,10 @@ module RuboCop
|
|
19
20
|
STRING
|
20
21
|
end
|
21
22
|
end
|
23
|
+
|
24
|
+
# @api private
|
25
|
+
def self.document_version
|
26
|
+
STRING.match('\d+\.\d+').to_s
|
27
|
+
end
|
22
28
|
end
|
23
29
|
end
|
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.93.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-08
|
13
|
+
date: 2020-10-08 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.1.
|
35
|
+
version: 2.7.1.5
|
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.1.
|
42
|
+
version: 2.7.1.5
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: rainbow
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,14 +66,14 @@ dependencies:
|
|
66
66
|
requirements:
|
67
67
|
- - ">="
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: '1.
|
69
|
+
version: '1.8'
|
70
70
|
type: :runtime
|
71
71
|
prerelease: false
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
74
|
- - ">="
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: '1.
|
76
|
+
version: '1.8'
|
77
77
|
- !ruby/object:Gem::Dependency
|
78
78
|
name: rexml
|
79
79
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,20 +94,14 @@ dependencies:
|
|
94
94
|
requirements:
|
95
95
|
- - ">="
|
96
96
|
- !ruby/object:Gem::Version
|
97
|
-
version: 0.
|
98
|
-
- - "<"
|
99
|
-
- !ruby/object:Gem::Version
|
100
|
-
version: '1.0'
|
97
|
+
version: 0.6.0
|
101
98
|
type: :runtime
|
102
99
|
prerelease: false
|
103
100
|
version_requirements: !ruby/object:Gem::Requirement
|
104
101
|
requirements:
|
105
102
|
- - ">="
|
106
103
|
- !ruby/object:Gem::Version
|
107
|
-
version: 0.
|
108
|
-
- - "<"
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '1.0'
|
104
|
+
version: 0.6.0
|
111
105
|
- !ruby/object:Gem::Dependency
|
112
106
|
name: ruby-progressbar
|
113
107
|
requirement: !ruby/object:Gem::Requirement
|
@@ -199,6 +193,7 @@ files:
|
|
199
193
|
- lib/rubocop/config_loader.rb
|
200
194
|
- lib/rubocop/config_loader_resolver.rb
|
201
195
|
- lib/rubocop/config_obsoletion.rb
|
196
|
+
- lib/rubocop/config_regeneration.rb
|
202
197
|
- lib/rubocop/config_store.rb
|
203
198
|
- lib/rubocop/config_validator.rb
|
204
199
|
- lib/rubocop/cop/autocorrect_logic.rb
|
@@ -226,6 +221,7 @@ files:
|
|
226
221
|
- lib/rubocop/cop/correctors/space_corrector.rb
|
227
222
|
- lib/rubocop/cop/correctors/string_literal_corrector.rb
|
228
223
|
- lib/rubocop/cop/correctors/unused_arg_corrector.rb
|
224
|
+
- lib/rubocop/cop/documentation.rb
|
229
225
|
- lib/rubocop/cop/force.rb
|
230
226
|
- lib/rubocop/cop/gemspec/duplicated_assignment.rb
|
231
227
|
- lib/rubocop/cop/gemspec/ordered_dependencies.rb
|
@@ -247,6 +243,7 @@ files:
|
|
247
243
|
- lib/rubocop/cop/layout/argument_alignment.rb
|
248
244
|
- lib/rubocop/cop/layout/array_alignment.rb
|
249
245
|
- lib/rubocop/cop/layout/assignment_indentation.rb
|
246
|
+
- lib/rubocop/cop/layout/begin_end_alignment.rb
|
250
247
|
- lib/rubocop/cop/layout/block_alignment.rb
|
251
248
|
- lib/rubocop/cop/layout/block_end_newline.rb
|
252
249
|
- lib/rubocop/cop/layout/case_indentation.rb
|
@@ -261,6 +258,7 @@ files:
|
|
261
258
|
- lib/rubocop/cop/layout/empty_comment.rb
|
262
259
|
- lib/rubocop/cop/layout/empty_line_after_guard_clause.rb
|
263
260
|
- lib/rubocop/cop/layout/empty_line_after_magic_comment.rb
|
261
|
+
- lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb
|
264
262
|
- lib/rubocop/cop/layout/empty_line_between_defs.rb
|
265
263
|
- lib/rubocop/cop/layout/empty_lines.rb
|
266
264
|
- lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb
|
@@ -343,6 +341,7 @@ files:
|
|
343
341
|
- lib/rubocop/cop/lint/binary_operator_with_identical_operands.rb
|
344
342
|
- lib/rubocop/cop/lint/boolean_symbol.rb
|
345
343
|
- lib/rubocop/cop/lint/circular_argument_reference.rb
|
344
|
+
- lib/rubocop/cop/lint/constant_definition_in_block.rb
|
346
345
|
- lib/rubocop/cop/lint/constant_resolution.rb
|
347
346
|
- lib/rubocop/cop/lint/debugger.rb
|
348
347
|
- lib/rubocop/cop/lint/deprecated_class_methods.rb
|
@@ -352,12 +351,14 @@ files:
|
|
352
351
|
- lib/rubocop/cop/lint/duplicate_elsif_condition.rb
|
353
352
|
- lib/rubocop/cop/lint/duplicate_hash_key.rb
|
354
353
|
- lib/rubocop/cop/lint/duplicate_methods.rb
|
354
|
+
- lib/rubocop/cop/lint/duplicate_require.rb
|
355
355
|
- lib/rubocop/cop/lint/duplicate_rescue_exception.rb
|
356
356
|
- lib/rubocop/cop/lint/each_with_object_argument.rb
|
357
357
|
- lib/rubocop/cop/lint/else_layout.rb
|
358
358
|
- lib/rubocop/cop/lint/empty_conditional_body.rb
|
359
359
|
- lib/rubocop/cop/lint/empty_ensure.rb
|
360
360
|
- lib/rubocop/cop/lint/empty_expression.rb
|
361
|
+
- lib/rubocop/cop/lint/empty_file.rb
|
361
362
|
- lib/rubocop/cop/lint/empty_interpolation.rb
|
362
363
|
- lib/rubocop/cop/lint/empty_when.rb
|
363
364
|
- lib/rubocop/cop/lint/ensure_return.rb
|
@@ -366,7 +367,9 @@ files:
|
|
366
367
|
- lib/rubocop/cop/lint/float_comparison.rb
|
367
368
|
- lib/rubocop/cop/lint/float_out_of_range.rb
|
368
369
|
- lib/rubocop/cop/lint/format_parameter_mismatch.rb
|
370
|
+
- lib/rubocop/cop/lint/hash_compare_by_identity.rb
|
369
371
|
- lib/rubocop/cop/lint/heredoc_method_call_position.rb
|
372
|
+
- lib/rubocop/cop/lint/identity_comparison.rb
|
370
373
|
- lib/rubocop/cop/lint/implicit_string_concatenation.rb
|
371
374
|
- lib/rubocop/cop/lint/ineffective_access_modifier.rb
|
372
375
|
- lib/rubocop/cop/lint/inherit_exception.rb
|
@@ -394,6 +397,7 @@ files:
|
|
394
397
|
- lib/rubocop/cop/lint/redundant_cop_disable_directive.rb
|
395
398
|
- lib/rubocop/cop/lint/redundant_cop_enable_directive.rb
|
396
399
|
- lib/rubocop/cop/lint/redundant_require_statement.rb
|
400
|
+
- lib/rubocop/cop/lint/redundant_safe_navigation.rb
|
397
401
|
- lib/rubocop/cop/lint/redundant_splat_expansion.rb
|
398
402
|
- lib/rubocop/cop/lint/redundant_string_coercion.rb
|
399
403
|
- lib/rubocop/cop/lint/redundant_with_index.rb
|
@@ -417,6 +421,7 @@ files:
|
|
417
421
|
- lib/rubocop/cop/lint/syntax.rb
|
418
422
|
- lib/rubocop/cop/lint/to_json.rb
|
419
423
|
- lib/rubocop/cop/lint/top_level_return_with_argument.rb
|
424
|
+
- lib/rubocop/cop/lint/trailing_comma_in_attribute_declaration.rb
|
420
425
|
- lib/rubocop/cop/lint/underscore_prefixed_variable_name.rb
|
421
426
|
- lib/rubocop/cop/lint/unified_integer.rb
|
422
427
|
- lib/rubocop/cop/lint/unreachable_code.rb
|
@@ -428,7 +433,9 @@ files:
|
|
428
433
|
- lib/rubocop/cop/lint/useless_access_modifier.rb
|
429
434
|
- lib/rubocop/cop/lint/useless_assignment.rb
|
430
435
|
- lib/rubocop/cop/lint/useless_else_without_rescue.rb
|
436
|
+
- lib/rubocop/cop/lint/useless_method_definition.rb
|
431
437
|
- lib/rubocop/cop/lint/useless_setter_call.rb
|
438
|
+
- lib/rubocop/cop/lint/useless_times.rb
|
432
439
|
- lib/rubocop/cop/lint/void.rb
|
433
440
|
- lib/rubocop/cop/message_annotator.rb
|
434
441
|
- lib/rubocop/cop/metrics/abc_size.rb
|
@@ -454,6 +461,7 @@ files:
|
|
454
461
|
- lib/rubocop/cop/mixin/check_assignment.rb
|
455
462
|
- lib/rubocop/cop/mixin/check_line_breakable.rb
|
456
463
|
- lib/rubocop/cop/mixin/code_length.rb
|
464
|
+
- lib/rubocop/cop/mixin/comments_help.rb
|
457
465
|
- lib/rubocop/cop/mixin/configurable_enforced_style.rb
|
458
466
|
- lib/rubocop/cop/mixin/configurable_formatting.rb
|
459
467
|
- lib/rubocop/cop/mixin/configurable_max.rb
|
@@ -495,7 +503,6 @@ files:
|
|
495
503
|
- lib/rubocop/cop/mixin/preferred_delimiters.rb
|
496
504
|
- lib/rubocop/cop/mixin/range_help.rb
|
497
505
|
- lib/rubocop/cop/mixin/rational_literal.rb
|
498
|
-
- lib/rubocop/cop/mixin/regexp_literal_help.rb
|
499
506
|
- lib/rubocop/cop/mixin/rescue_node.rb
|
500
507
|
- lib/rubocop/cop/mixin/safe_assignment.rb
|
501
508
|
- lib/rubocop/cop/mixin/space_after_punctuation.rb
|
@@ -553,11 +560,14 @@ files:
|
|
553
560
|
- lib/rubocop/cop/style/character_literal.rb
|
554
561
|
- lib/rubocop/cop/style/class_and_module_children.rb
|
555
562
|
- lib/rubocop/cop/style/class_check.rb
|
563
|
+
- lib/rubocop/cop/style/class_equality_comparison.rb
|
556
564
|
- lib/rubocop/cop/style/class_methods.rb
|
565
|
+
- lib/rubocop/cop/style/class_methods_definitions.rb
|
557
566
|
- lib/rubocop/cop/style/class_vars.rb
|
558
567
|
- lib/rubocop/cop/style/collection_methods.rb
|
559
568
|
- lib/rubocop/cop/style/colon_method_call.rb
|
560
569
|
- lib/rubocop/cop/style/colon_method_definition.rb
|
570
|
+
- lib/rubocop/cop/style/combinable_loops.rb
|
561
571
|
- lib/rubocop/cop/style/command_literal.rb
|
562
572
|
- lib/rubocop/cop/style/comment_annotation.rb
|
563
573
|
- lib/rubocop/cop/style/commented_keyword.rb
|
@@ -611,6 +621,7 @@ files:
|
|
611
621
|
- lib/rubocop/cop/style/inline_comment.rb
|
612
622
|
- lib/rubocop/cop/style/inverse_methods.rb
|
613
623
|
- lib/rubocop/cop/style/ip_addresses.rb
|
624
|
+
- lib/rubocop/cop/style/keyword_parameters_order.rb
|
614
625
|
- lib/rubocop/cop/style/lambda.rb
|
615
626
|
- lib/rubocop/cop/style/lambda_call.rb
|
616
627
|
- lib/rubocop/cop/style/line_end_concatenation.rb
|
@@ -678,6 +689,7 @@ files:
|
|
678
689
|
- lib/rubocop/cop/style/redundant_regexp_escape.rb
|
679
690
|
- lib/rubocop/cop/style/redundant_return.rb
|
680
691
|
- lib/rubocop/cop/style/redundant_self.rb
|
692
|
+
- lib/rubocop/cop/style/redundant_self_assignment.rb
|
681
693
|
- lib/rubocop/cop/style/redundant_sort.rb
|
682
694
|
- lib/rubocop/cop/style/redundant_sort_by.rb
|
683
695
|
- lib/rubocop/cop/style/regexp_literal.rb
|
@@ -694,6 +706,7 @@ files:
|
|
694
706
|
- lib/rubocop/cop/style/single_line_block_params.rb
|
695
707
|
- lib/rubocop/cop/style/single_line_methods.rb
|
696
708
|
- lib/rubocop/cop/style/slicing_with_range.rb
|
709
|
+
- lib/rubocop/cop/style/sole_nested_conditional.rb
|
697
710
|
- lib/rubocop/cop/style/special_global_vars.rb
|
698
711
|
- lib/rubocop/cop/style/stabby_lambda_parentheses.rb
|
699
712
|
- lib/rubocop/cop/style/stderr_puts.rb
|
@@ -728,7 +741,6 @@ files:
|
|
728
741
|
- lib/rubocop/cop/style/yoda_condition.rb
|
729
742
|
- lib/rubocop/cop/style/zero_length_predicate.rb
|
730
743
|
- lib/rubocop/cop/team.rb
|
731
|
-
- lib/rubocop/cop/tokens_util.rb
|
732
744
|
- lib/rubocop/cop/util.rb
|
733
745
|
- lib/rubocop/cop/utils/format_string.rb
|
734
746
|
- lib/rubocop/cop/variable_force.rb
|
@@ -741,8 +753,10 @@ files:
|
|
741
753
|
- lib/rubocop/cop/variable_force/variable_table.rb
|
742
754
|
- lib/rubocop/cops_documentation_generator.rb
|
743
755
|
- lib/rubocop/core_ext/string.rb
|
756
|
+
- lib/rubocop/directive_comment.rb
|
744
757
|
- lib/rubocop/error.rb
|
745
758
|
- lib/rubocop/ext/processed_source.rb
|
759
|
+
- lib/rubocop/ext/regexp_node.rb
|
746
760
|
- lib/rubocop/file_finder.rb
|
747
761
|
- lib/rubocop/formatter/auto_gen_config_formatter.rb
|
748
762
|
- lib/rubocop/formatter/base_formatter.rb
|
@@ -791,7 +805,7 @@ metadata:
|
|
791
805
|
homepage_uri: https://rubocop.org/
|
792
806
|
changelog_uri: https://github.com/rubocop-hq/rubocop/blob/master/CHANGELOG.md
|
793
807
|
source_code_uri: https://github.com/rubocop-hq/rubocop/
|
794
|
-
documentation_uri: https://docs.rubocop.org/
|
808
|
+
documentation_uri: https://docs.rubocop.org/rubocop/0.93/
|
795
809
|
bug_tracker_uri: https://github.com/rubocop-hq/rubocop/issues
|
796
810
|
post_install_message:
|
797
811
|
rdoc_options: []
|