rubocop 0.80.1 → 0.85.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/config/default.yml +202 -49
- data/lib/rubocop.rb +20 -61
- data/lib/rubocop/ast_aliases.rb +8 -0
- data/lib/rubocop/cli.rb +13 -7
- data/lib/rubocop/cli/command/auto_genenerate_config.rb +2 -2
- data/lib/rubocop/cli/command/show_cops.rb +2 -6
- data/lib/rubocop/comment_config.rb +1 -1
- data/lib/rubocop/config.rb +14 -2
- data/lib/rubocop/config_loader.rb +37 -33
- data/lib/rubocop/config_loader_resolver.rb +45 -6
- data/lib/rubocop/config_obsoletion.rb +2 -0
- data/lib/rubocop/config_store.rb +12 -2
- data/lib/rubocop/config_validator.rb +18 -1
- data/lib/rubocop/cop/autocorrect_logic.rb +1 -2
- data/lib/rubocop/cop/badge.rb +5 -5
- data/lib/rubocop/cop/bundler/gem_comment.rb +70 -1
- data/lib/rubocop/cop/bundler/insecure_protocol_source.rb +1 -1
- data/lib/rubocop/cop/commissioner.rb +0 -21
- data/lib/rubocop/cop/cop.rb +14 -6
- data/lib/rubocop/cop/corrector.rb +48 -24
- data/lib/rubocop/cop/correctors/alignment_corrector.rb +4 -8
- data/lib/rubocop/cop/correctors/condition_corrector.rb +1 -2
- data/lib/rubocop/cop/correctors/empty_line_corrector.rb +1 -1
- data/lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb +4 -4
- data/lib/rubocop/cop/correctors/line_break_corrector.rb +2 -2
- data/lib/rubocop/cop/correctors/percent_literal_corrector.rb +1 -1
- data/lib/rubocop/cop/correctors/space_corrector.rb +1 -3
- data/lib/rubocop/cop/correctors/string_literal_corrector.rb +2 -2
- data/lib/rubocop/cop/gemspec/ordered_dependencies.rb +1 -3
- data/lib/rubocop/cop/generator.rb +4 -3
- data/lib/rubocop/cop/ignored_node.rb +1 -3
- data/lib/rubocop/cop/internal_affairs/offense_location_keyword.rb +1 -1
- data/lib/rubocop/cop/layout/array_alignment.rb +53 -10
- data/lib/rubocop/cop/layout/block_end_newline.rb +5 -3
- data/lib/rubocop/cop/layout/case_indentation.rb +3 -3
- data/lib/rubocop/cop/layout/class_structure.rb +19 -16
- data/lib/rubocop/cop/layout/condition_position.rb +12 -2
- data/lib/rubocop/cop/layout/dot_position.rb +1 -1
- data/lib/rubocop/cop/layout/else_alignment.rb +8 -0
- data/lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb +2 -6
- data/lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb +126 -0
- data/lib/rubocop/cop/layout/end_of_line.rb +2 -2
- data/lib/rubocop/cop/layout/first_argument_indentation.rb +1 -3
- data/lib/rubocop/cop/layout/first_array_element_indentation.rb +14 -10
- data/lib/rubocop/cop/layout/first_array_element_line_break.rb +1 -1
- data/lib/rubocop/cop/layout/first_hash_element_indentation.rb +1 -1
- data/lib/rubocop/cop/layout/first_method_argument_line_break.rb +1 -3
- data/lib/rubocop/cop/layout/first_parameter_indentation.rb +2 -2
- data/lib/rubocop/cop/layout/hash_alignment.rb +6 -6
- data/lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb +5 -9
- data/lib/rubocop/cop/layout/heredoc_indentation.rb +20 -103
- data/lib/rubocop/cop/layout/{tab.rb → indentation_style.rb} +48 -6
- data/lib/rubocop/cop/layout/indentation_width.rb +1 -3
- data/lib/rubocop/cop/layout/leading_comment_space.rb +1 -1
- data/lib/rubocop/cop/layout/line_length.rb +23 -20
- data/lib/rubocop/cop/layout/multiline_block_layout.rb +1 -1
- data/lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb +1 -3
- data/lib/rubocop/cop/layout/multiline_method_call_indentation.rb +1 -1
- data/lib/rubocop/cop/layout/multiline_operation_indentation.rb +13 -4
- data/lib/rubocop/cop/layout/space_around_block_parameters.rb +3 -3
- data/lib/rubocop/cop/layout/space_around_keyword.rb +2 -2
- data/lib/rubocop/cop/layout/space_around_method_call_operator.rb +131 -0
- data/lib/rubocop/cop/layout/space_around_operators.rb +19 -2
- data/lib/rubocop/cop/layout/space_before_comment.rb +1 -3
- data/lib/rubocop/cop/layout/space_in_lambda_literal.rb +1 -1
- data/lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb +1 -3
- data/lib/rubocop/cop/layout/space_inside_block_braces.rb +2 -2
- data/lib/rubocop/cop/layout/space_inside_range_literal.rb +2 -2
- data/lib/rubocop/cop/layout/space_inside_reference_brackets.rb +1 -3
- data/lib/rubocop/cop/layout/trailing_whitespace.rb +2 -2
- data/lib/rubocop/cop/lint/ambiguous_operator.rb +41 -0
- data/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb +14 -0
- data/lib/rubocop/cop/lint/boolean_symbol.rb +12 -0
- data/lib/rubocop/cop/lint/debugger.rb +1 -1
- data/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb +137 -0
- data/lib/rubocop/cop/lint/duplicate_methods.rb +1 -5
- data/lib/rubocop/cop/lint/empty_when.rb +29 -6
- data/lib/rubocop/cop/lint/ensure_return.rb +19 -2
- data/lib/rubocop/cop/lint/erb_new_arguments.rb +2 -4
- data/lib/rubocop/cop/lint/implicit_string_concatenation.rb +1 -1
- data/lib/rubocop/cop/lint/inherit_exception.rb +1 -1
- data/lib/rubocop/cop/lint/interpolation_check.rb +1 -1
- data/lib/rubocop/cop/lint/literal_as_condition.rb +10 -13
- data/lib/rubocop/cop/lint/literal_in_interpolation.rb +1 -1
- data/lib/rubocop/cop/lint/loop.rb +7 -5
- data/lib/rubocop/cop/lint/mixed_regexp_capture_types.rb +62 -0
- data/lib/rubocop/cop/lint/multiple_comparison.rb +1 -1
- data/lib/rubocop/cop/lint/nested_method_definition.rb +2 -2
- data/lib/rubocop/cop/lint/nested_percent_literal.rb +1 -1
- data/lib/rubocop/cop/lint/non_deterministic_require_order.rb +2 -2
- data/lib/rubocop/cop/lint/non_local_exit_from_iterator.rb +7 -7
- data/lib/rubocop/cop/lint/number_conversion.rb +1 -1
- data/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb +33 -11
- data/lib/rubocop/cop/lint/percent_string_array.rb +2 -4
- data/lib/rubocop/cop/lint/raise_exception.rb +75 -0
- data/lib/rubocop/cop/lint/redundant_cop_disable_directive.rb +1 -6
- data/lib/rubocop/cop/lint/redundant_require_statement.rb +3 -3
- data/lib/rubocop/cop/lint/redundant_string_coercion.rb +1 -1
- data/lib/rubocop/cop/lint/rescue_exception.rb +1 -1
- data/lib/rubocop/cop/lint/safe_navigation_chain.rb +1 -1
- data/lib/rubocop/cop/lint/struct_new_override.rb +58 -0
- data/lib/rubocop/cop/lint/suppressed_exception.rb +23 -26
- data/lib/rubocop/cop/lint/syntax.rb +1 -3
- data/lib/rubocop/cop/lint/unified_integer.rb +0 -2
- data/lib/rubocop/cop/lint/unreachable_code.rb +1 -1
- data/lib/rubocop/cop/lint/unused_method_argument.rb +32 -6
- data/lib/rubocop/cop/lint/uri_regexp.rb +4 -4
- data/lib/rubocop/cop/lint/useless_access_modifier.rb +13 -3
- data/lib/rubocop/cop/lint/useless_assignment.rb +3 -2
- data/lib/rubocop/cop/lint/useless_else_without_rescue.rb +6 -1
- data/lib/rubocop/cop/lint/useless_setter_call.rb +1 -1
- data/lib/rubocop/cop/migration/department_name.rb +22 -9
- data/lib/rubocop/cop/mixin/alignment.rb +1 -3
- data/lib/rubocop/cop/mixin/array_min_size.rb +1 -3
- data/lib/rubocop/cop/mixin/check_line_breakable.rb +3 -9
- data/lib/rubocop/cop/mixin/configurable_enforced_style.rb +1 -3
- data/lib/rubocop/cop/mixin/configurable_formatting.rb +2 -4
- data/lib/rubocop/cop/mixin/end_keyword_alignment.rb +6 -1
- data/lib/rubocop/cop/mixin/frozen_string_literal.rb +10 -1
- data/lib/rubocop/cop/mixin/hash_transform_method.rb +9 -2
- data/lib/rubocop/cop/mixin/ignored_pattern.rb +1 -1
- data/lib/rubocop/cop/mixin/line_length_help.rb +3 -2
- data/lib/rubocop/cop/mixin/method_complexity.rb +5 -0
- data/lib/rubocop/cop/mixin/parser_diagnostic.rb +1 -1
- data/lib/rubocop/cop/mixin/regexp_literal_help.rb +16 -0
- data/lib/rubocop/cop/mixin/statement_modifier.rb +7 -22
- data/lib/rubocop/cop/mixin/target_ruby_version.rb +5 -1
- data/lib/rubocop/cop/mixin/trailing_comma.rb +2 -4
- data/lib/rubocop/cop/mixin/uncommunicative_name.rb +1 -1
- data/lib/rubocop/cop/naming/class_and_module_camel_case.rb +11 -1
- data/lib/rubocop/cop/naming/constant_name.rb +2 -1
- data/lib/rubocop/cop/naming/file_name.rb +27 -14
- data/lib/rubocop/cop/naming/heredoc_delimiter_naming.rb +1 -1
- data/lib/rubocop/cop/naming/method_name.rb +26 -0
- data/lib/rubocop/cop/naming/predicate_name.rb +1 -1
- data/lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb +1 -1
- data/lib/rubocop/cop/registry.rb +12 -7
- data/lib/rubocop/cop/severity.rb +1 -3
- data/lib/rubocop/cop/style/access_modifier_declarations.rb +26 -6
- data/lib/rubocop/cop/style/alias.rb +4 -4
- data/lib/rubocop/cop/style/and_or.rb +7 -8
- data/lib/rubocop/cop/style/array_join.rb +2 -2
- data/lib/rubocop/cop/style/attr.rb +1 -3
- data/lib/rubocop/cop/style/bare_percent_literals.rb +1 -1
- data/lib/rubocop/cop/style/block_delimiters.rb +2 -8
- data/lib/rubocop/cop/style/case_equality.rb +24 -1
- data/lib/rubocop/cop/style/character_literal.rb +2 -2
- data/lib/rubocop/cop/style/collection_methods.rb +2 -0
- data/lib/rubocop/cop/style/conditional_assignment.rb +9 -11
- data/lib/rubocop/cop/style/copyright.rb +3 -3
- data/lib/rubocop/cop/style/dir.rb +1 -1
- data/lib/rubocop/cop/style/disable_cops_within_source_code_directive.rb +49 -0
- data/lib/rubocop/cop/style/documentation.rb +43 -5
- data/lib/rubocop/cop/style/double_cop_disable_directive.rb +1 -1
- data/lib/rubocop/cop/style/double_negation.rb +41 -4
- data/lib/rubocop/cop/style/each_for_simple_loop.rb +1 -1
- data/lib/rubocop/cop/style/each_with_object.rb +3 -3
- data/lib/rubocop/cop/style/empty_literal.rb +1 -3
- data/lib/rubocop/cop/style/empty_method.rb +2 -6
- data/lib/rubocop/cop/style/end_block.rb +6 -0
- data/lib/rubocop/cop/style/even_odd.rb +1 -1
- data/lib/rubocop/cop/style/expand_path_arguments.rb +3 -3
- data/lib/rubocop/cop/style/exponential_notation.rb +119 -0
- data/lib/rubocop/cop/style/format_string.rb +2 -2
- data/lib/rubocop/cop/style/format_string_token.rb +2 -3
- data/lib/rubocop/cop/style/frozen_string_literal_comment.rb +3 -6
- data/lib/rubocop/cop/style/guard_clause.rb +25 -2
- data/lib/rubocop/cop/style/hash_each_methods.rb +6 -4
- data/lib/rubocop/cop/style/hash_syntax.rb +19 -12
- data/lib/rubocop/cop/style/hash_transform_keys.rb +6 -2
- data/lib/rubocop/cop/style/hash_transform_values.rb +6 -5
- data/lib/rubocop/cop/style/if_unless_modifier.rb +23 -3
- data/lib/rubocop/cop/style/if_with_semicolon.rb +16 -0
- data/lib/rubocop/cop/style/inline_comment.rb +1 -1
- data/lib/rubocop/cop/style/inverse_methods.rb +1 -1
- data/lib/rubocop/cop/style/lambda.rb +3 -2
- data/lib/rubocop/cop/style/lambda_call.rb +1 -21
- data/lib/rubocop/cop/style/method_call_with_args_parentheses/require_parentheses.rb +1 -3
- data/lib/rubocop/cop/style/method_call_without_args_parentheses.rb +1 -3
- data/lib/rubocop/cop/style/mixin_grouping.rb +1 -1
- data/lib/rubocop/cop/style/module_function.rb +58 -12
- data/lib/rubocop/cop/style/multiline_if_modifier.rb +1 -1
- data/lib/rubocop/cop/style/multiline_memoization.rb +1 -1
- data/lib/rubocop/cop/style/multiline_when_then.rb +16 -1
- data/lib/rubocop/cop/style/mutable_constant.rb +2 -4
- data/lib/rubocop/cop/style/negated_if.rb +3 -3
- data/lib/rubocop/cop/style/negated_unless.rb +3 -3
- data/lib/rubocop/cop/style/nested_parenthesized_calls.rb +2 -2
- data/lib/rubocop/cop/style/next.rb +2 -2
- data/lib/rubocop/cop/style/nil_comparison.rb +1 -1
- data/lib/rubocop/cop/style/non_nil_check.rb +5 -5
- data/lib/rubocop/cop/style/not.rb +1 -1
- data/lib/rubocop/cop/style/numeric_literal_prefix.rb +1 -1
- data/lib/rubocop/cop/style/numeric_literals.rb +1 -1
- data/lib/rubocop/cop/style/numeric_predicate.rb +1 -1
- data/lib/rubocop/cop/style/one_line_conditional.rb +6 -9
- data/lib/rubocop/cop/style/optional_arguments.rb +1 -1
- data/lib/rubocop/cop/style/or_assignment.rb +1 -1
- data/lib/rubocop/cop/style/percent_q_literals.rb +1 -1
- data/lib/rubocop/cop/style/perl_backrefs.rb +2 -2
- data/lib/rubocop/cop/style/proc.rb +1 -1
- data/lib/rubocop/cop/style/raise_args.rb +1 -1
- data/lib/rubocop/cop/style/random_with_offset.rb +3 -3
- data/lib/rubocop/cop/style/redundant_condition.rb +3 -4
- data/lib/rubocop/cop/style/redundant_conditional.rb +1 -1
- data/lib/rubocop/cop/style/redundant_exception.rb +3 -3
- data/lib/rubocop/cop/style/redundant_interpolation.rb +2 -2
- data/lib/rubocop/cop/style/redundant_parentheses.rb +2 -6
- data/lib/rubocop/cop/style/redundant_percent_q.rb +3 -3
- data/lib/rubocop/cop/style/redundant_regexp_character_class.rb +89 -0
- data/lib/rubocop/cop/style/redundant_regexp_escape.rb +130 -0
- data/lib/rubocop/cop/style/redundant_return.rb +5 -7
- data/lib/rubocop/cop/style/redundant_self.rb +1 -1
- data/lib/rubocop/cop/style/redundant_sort.rb +2 -2
- data/lib/rubocop/cop/style/rescue_modifier.rb +1 -1
- data/lib/rubocop/cop/style/return_nil.rb +1 -1
- data/lib/rubocop/cop/style/safe_navigation.rb +3 -7
- data/lib/rubocop/cop/style/self_assignment.rb +1 -1
- data/lib/rubocop/cop/style/slicing_with_range.rb +39 -0
- data/lib/rubocop/cop/style/special_global_vars.rb +3 -7
- data/lib/rubocop/cop/style/stabby_lambda_parentheses.rb +1 -4
- data/lib/rubocop/cop/style/string_hash_keys.rb +1 -1
- data/lib/rubocop/cop/style/symbol_array.rb +2 -2
- data/lib/rubocop/cop/style/symbol_literal.rb +2 -2
- data/lib/rubocop/cop/style/ternary_parentheses.rb +2 -5
- data/lib/rubocop/cop/style/trailing_comma_in_arguments.rb +35 -0
- data/lib/rubocop/cop/style/trailing_comma_in_array_literal.rb +41 -0
- data/lib/rubocop/cop/style/trailing_comma_in_block_args.rb +88 -0
- data/lib/rubocop/cop/style/trailing_comma_in_hash_literal.rb +44 -0
- data/lib/rubocop/cop/style/trailing_underscore_variable.rb +1 -3
- data/lib/rubocop/cop/style/trivial_accessors.rb +1 -1
- data/lib/rubocop/cop/style/unless_else.rb +1 -1
- data/lib/rubocop/cop/style/unpack_first.rb +0 -4
- data/lib/rubocop/cop/style/variable_interpolation.rb +1 -1
- data/lib/rubocop/cop/style/when_then.rb +1 -1
- data/lib/rubocop/cop/style/while_until_modifier.rb +1 -1
- data/lib/rubocop/cop/style/word_array.rb +1 -1
- data/lib/rubocop/cop/style/zero_length_predicate.rb +1 -1
- data/lib/rubocop/cop/team.rb +61 -25
- data/lib/rubocop/cop/util.rb +25 -1
- data/lib/rubocop/cop/variable_force.rb +3 -9
- data/lib/rubocop/cop/variable_force/assignment.rb +1 -0
- data/lib/rubocop/cop/variable_force/branch.rb +1 -3
- data/lib/rubocop/cop/variable_force/scope.rb +1 -0
- data/lib/rubocop/cop/variable_force/variable.rb +3 -6
- data/lib/rubocop/ext/processed_source.rb +18 -0
- data/lib/rubocop/formatter/base_formatter.rb +0 -4
- data/lib/rubocop/formatter/clang_style_formatter.rb +1 -1
- data/lib/rubocop/formatter/disabled_config_formatter.rb +4 -12
- data/lib/rubocop/formatter/formatter_set.rb +1 -4
- data/lib/rubocop/formatter/junit_formatter.rb +27 -6
- data/lib/rubocop/formatter/pacman_formatter.rb +1 -1
- data/lib/rubocop/formatter/tap_formatter.rb +1 -1
- data/lib/rubocop/magic_comment.rb +1 -1
- data/lib/rubocop/name_similarity.rb +12 -9
- data/lib/rubocop/options.rb +33 -12
- data/lib/rubocop/remote_config.rb +1 -3
- data/lib/rubocop/result_cache.rb +5 -7
- data/lib/rubocop/rspec/cop_helper.rb +3 -26
- data/lib/rubocop/rspec/expect_offense.rb +46 -16
- data/lib/rubocop/rspec/shared_contexts.rb +54 -20
- data/lib/rubocop/runner.rb +21 -14
- data/lib/rubocop/target_finder.rb +7 -7
- data/lib/rubocop/target_ruby.rb +5 -2
- data/lib/rubocop/version.rb +5 -3
- metadata +50 -77
- data/lib/rubocop/ast/builder.rb +0 -83
- data/lib/rubocop/ast/node.rb +0 -632
- data/lib/rubocop/ast/node/alias_node.rb +0 -24
- data/lib/rubocop/ast/node/and_node.rb +0 -29
- data/lib/rubocop/ast/node/args_node.rb +0 -29
- data/lib/rubocop/ast/node/array_node.rb +0 -57
- data/lib/rubocop/ast/node/block_node.rb +0 -117
- data/lib/rubocop/ast/node/break_node.rb +0 -17
- data/lib/rubocop/ast/node/case_node.rb +0 -56
- data/lib/rubocop/ast/node/class_node.rb +0 -31
- data/lib/rubocop/ast/node/def_node.rb +0 -82
- data/lib/rubocop/ast/node/defined_node.rb +0 -17
- data/lib/rubocop/ast/node/ensure_node.rb +0 -17
- data/lib/rubocop/ast/node/float_node.rb +0 -12
- data/lib/rubocop/ast/node/for_node.rb +0 -53
- data/lib/rubocop/ast/node/forward_args_node.rb +0 -18
- data/lib/rubocop/ast/node/hash_node.rb +0 -109
- data/lib/rubocop/ast/node/if_node.rb +0 -175
- data/lib/rubocop/ast/node/int_node.rb +0 -12
- data/lib/rubocop/ast/node/keyword_splat_node.rb +0 -45
- data/lib/rubocop/ast/node/mixin/basic_literal_node.rb +0 -16
- data/lib/rubocop/ast/node/mixin/binary_operator_node.rb +0 -43
- data/lib/rubocop/ast/node/mixin/collection_node.rb +0 -15
- data/lib/rubocop/ast/node/mixin/conditional_node.rb +0 -45
- data/lib/rubocop/ast/node/mixin/hash_element_node.rb +0 -125
- data/lib/rubocop/ast/node/mixin/method_dispatch_node.rb +0 -261
- data/lib/rubocop/ast/node/mixin/method_identifier_predicates.rb +0 -114
- data/lib/rubocop/ast/node/mixin/modifier_node.rb +0 -17
- data/lib/rubocop/ast/node/mixin/numeric_node.rb +0 -21
- data/lib/rubocop/ast/node/mixin/parameterized_node.rb +0 -61
- data/lib/rubocop/ast/node/mixin/predicate_operator_node.rb +0 -35
- data/lib/rubocop/ast/node/module_node.rb +0 -24
- data/lib/rubocop/ast/node/or_node.rb +0 -29
- data/lib/rubocop/ast/node/pair_node.rb +0 -63
- data/lib/rubocop/ast/node/range_node.rb +0 -18
- data/lib/rubocop/ast/node/regexp_node.rb +0 -33
- data/lib/rubocop/ast/node/resbody_node.rb +0 -24
- data/lib/rubocop/ast/node/retry_node.rb +0 -17
- data/lib/rubocop/ast/node/return_node.rb +0 -24
- data/lib/rubocop/ast/node/self_class_node.rb +0 -24
- data/lib/rubocop/ast/node/send_node.rb +0 -13
- data/lib/rubocop/ast/node/str_node.rb +0 -16
- data/lib/rubocop/ast/node/super_node.rb +0 -21
- data/lib/rubocop/ast/node/symbol_node.rb +0 -12
- data/lib/rubocop/ast/node/until_node.rb +0 -35
- data/lib/rubocop/ast/node/when_node.rb +0 -53
- data/lib/rubocop/ast/node/while_node.rb +0 -35
- data/lib/rubocop/ast/node/yield_node.rb +0 -21
- data/lib/rubocop/ast/sexp.rb +0 -16
- data/lib/rubocop/ast/traversal.rb +0 -200
- data/lib/rubocop/cop/lint/end_in_method.rb +0 -40
- data/lib/rubocop/formatter/disabled_lines_formatter.rb +0 -57
- data/lib/rubocop/node_pattern.rb +0 -887
- data/lib/rubocop/processed_source.rb +0 -216
- data/lib/rubocop/string_util.rb +0 -14
- data/lib/rubocop/token.rb +0 -114
@@ -38,28 +38,66 @@ RSpec.shared_context 'isolated environment', :isolated_environment do
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
-
#
|
42
|
-
RSpec.shared_context 'config', :config do
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
raise '`config` must be used in `describe SomeCopClass do .. end`'
|
47
|
-
end
|
41
|
+
# This context assumes nothing and defines `cop`, among others.
|
42
|
+
RSpec.shared_context 'config', :config do # rubocop:disable Metrics/BlockLength
|
43
|
+
### Meant to be overridden at will
|
44
|
+
|
45
|
+
let(:source) { 'code = {some: :ruby}' }
|
48
46
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
.default_configuration[cop_name]
|
55
|
-
.merge('Enabled' => true) # in case it is 'pending'
|
56
|
-
.merge(cop_config)
|
47
|
+
let(:cop_class) do
|
48
|
+
if described_class.is_a?(Class) && described_class < RuboCop::Cop::Cop
|
49
|
+
described_class
|
50
|
+
else
|
51
|
+
RuboCop::Cop::Cop
|
57
52
|
end
|
53
|
+
end
|
54
|
+
|
55
|
+
let(:cop_config) { {} }
|
56
|
+
|
57
|
+
let(:other_cops) { {} }
|
58
|
+
|
59
|
+
let(:cop_options) { {} }
|
60
|
+
|
61
|
+
### Utilities
|
62
|
+
|
63
|
+
def source_range(range, buffer: source_buffer)
|
64
|
+
Parser::Source::Range.new(buffer, range.begin,
|
65
|
+
range.exclude_end? ? range.end : range.end + 1)
|
66
|
+
end
|
67
|
+
|
68
|
+
### Useful intermediary steps (less likely to be overridden)
|
58
69
|
|
59
|
-
|
70
|
+
let(:processed_source) { parse_source(source, 'test') }
|
71
|
+
|
72
|
+
let(:source_buffer) { processed_source.buffer }
|
73
|
+
|
74
|
+
let(:all_cops_config) do
|
75
|
+
rails = { 'TargetRubyVersion' => ruby_version }
|
76
|
+
rails['TargetRailsVersion'] = rails_version if rails_version
|
77
|
+
rails
|
78
|
+
end
|
79
|
+
|
80
|
+
let(:cur_cop_config) do
|
81
|
+
RuboCop::ConfigLoader
|
82
|
+
.default_configuration.for_cop(cop_class)
|
83
|
+
.merge({
|
84
|
+
'Enabled' => true, # in case it is 'pending'
|
85
|
+
'AutoCorrect' => true # in case defaults set it to false
|
86
|
+
})
|
87
|
+
.merge(cop_config)
|
88
|
+
end
|
89
|
+
|
90
|
+
let(:config) do
|
91
|
+
hash = { 'AllCops' => all_cops_config,
|
92
|
+
cop_class.cop_name => cur_cop_config }.merge!(other_cops)
|
60
93
|
|
61
94
|
RuboCop::Config.new(hash, "#{Dir.pwd}/.rubocop.yml")
|
62
95
|
end
|
96
|
+
|
97
|
+
let(:cop) do
|
98
|
+
cop_class.new(config, cop_options)
|
99
|
+
.tap { |cop| cop.processed_source = processed_source }
|
100
|
+
end
|
63
101
|
end
|
64
102
|
|
65
103
|
RSpec.shared_context 'mock console output' do
|
@@ -74,10 +112,6 @@ RSpec.shared_context 'mock console output' do
|
|
74
112
|
end
|
75
113
|
end
|
76
114
|
|
77
|
-
RSpec.shared_context 'ruby 2.3', :ruby23 do
|
78
|
-
let(:ruby_version) { 2.3 }
|
79
|
-
end
|
80
|
-
|
81
115
|
RSpec.shared_context 'ruby 2.4', :ruby24 do
|
82
116
|
let(:ruby_version) { 2.4 }
|
83
117
|
end
|
data/lib/rubocop/runner.rb
CHANGED
@@ -61,7 +61,12 @@ module RuboCop
|
|
61
61
|
|
62
62
|
def find_target_files(paths)
|
63
63
|
target_finder = TargetFinder.new(@config_store, @options)
|
64
|
-
|
64
|
+
mode = if @options[:only_recognized_file_types]
|
65
|
+
:only_recognized_file_types
|
66
|
+
else
|
67
|
+
:all_file_types
|
68
|
+
end
|
69
|
+
target_files = target_finder.find(paths, mode)
|
65
70
|
target_files.each(&:freeze).freeze
|
66
71
|
end
|
67
72
|
|
@@ -75,9 +80,7 @@ module RuboCop
|
|
75
80
|
# OPTIMIZE: Calling `ResultCache.cleanup` takes time. This optimization
|
76
81
|
# mainly targets editors that integrates RuboCop. When RuboCop is run
|
77
82
|
# by an editor, it should be inspecting only one file.
|
78
|
-
if files.size > 1 && cached_run?
|
79
|
-
ResultCache.cleanup(@config_store, @options[:debug])
|
80
|
-
end
|
83
|
+
ResultCache.cleanup(@config_store, @options[:debug]) if files.size > 1 && cached_run?
|
81
84
|
formatter_set.finished(inspected_files.freeze)
|
82
85
|
formatter_set.close_output_files
|
83
86
|
end
|
@@ -126,7 +129,7 @@ module RuboCop
|
|
126
129
|
end
|
127
130
|
|
128
131
|
def file_offense_cache(file)
|
129
|
-
config = @config_store.
|
132
|
+
config = @config_store.for_file(file)
|
130
133
|
cache = cached_result(file, standby_team(config)) if cached_run?
|
131
134
|
|
132
135
|
if cache&.valid?
|
@@ -165,7 +168,7 @@ module RuboCop
|
|
165
168
|
end
|
166
169
|
|
167
170
|
def redundant_cop_disable_directive(file)
|
168
|
-
config = @config_store.
|
171
|
+
config = @config_store.for_file(file)
|
169
172
|
if config.for_cop(Cop::Lint::RedundantCopDisableDirective)
|
170
173
|
.fetch('Enabled')
|
171
174
|
cop = Cop::Lint::RedundantCopDisableDirective.new(config, @options)
|
@@ -180,7 +183,7 @@ module RuboCop
|
|
180
183
|
def autocorrect_redundant_disables(file, source, cop, offenses)
|
181
184
|
cop.processed_source = source
|
182
185
|
|
183
|
-
team = Cop::Team.
|
186
|
+
team = Cop::Team.mobilize(RuboCop::Cop::Registry.new, nil, @options)
|
184
187
|
team.autocorrect(source.buffer, [cop])
|
185
188
|
|
186
189
|
return [] unless team.updated_source_file?
|
@@ -211,7 +214,7 @@ module RuboCop
|
|
211
214
|
@cached_run ||=
|
212
215
|
(@options[:cache] == 'true' ||
|
213
216
|
@options[:cache] != 'false' &&
|
214
|
-
@config_store.
|
217
|
+
@config_store.for_dir(Dir.pwd).for_all_cops['UseCache']) &&
|
215
218
|
# When running --auto-gen-config, there's some processing done in the
|
216
219
|
# cops related to calculating the Max parameters for Metrics cops. We
|
217
220
|
# need to do that processing and cannot use caching.
|
@@ -291,8 +294,8 @@ module RuboCop
|
|
291
294
|
end
|
292
295
|
|
293
296
|
def inspect_file(processed_source)
|
294
|
-
config = @config_store.
|
295
|
-
team = Cop::Team.
|
297
|
+
config = @config_store.for_file(processed_source.path)
|
298
|
+
team = Cop::Team.mobilize(mobilized_cop_classes(config), config, @options)
|
296
299
|
offenses = team.inspect_file(processed_source)
|
297
300
|
@errors.concat(team.errors)
|
298
301
|
@warnings.concat(team.warnings)
|
@@ -314,7 +317,7 @@ module RuboCop
|
|
314
317
|
|
315
318
|
cop_classes.reject! { |c| c.match?(@options[:except]) }
|
316
319
|
|
317
|
-
Cop::Registry.new(cop_classes)
|
320
|
+
Cop::Registry.new(cop_classes, @options)
|
318
321
|
end
|
319
322
|
end
|
320
323
|
|
@@ -357,12 +360,16 @@ module RuboCop
|
|
357
360
|
end
|
358
361
|
|
359
362
|
def get_processed_source(file)
|
360
|
-
ruby_version = @config_store.
|
363
|
+
ruby_version = @config_store.for_file(file).target_ruby_version
|
361
364
|
|
362
365
|
if @options[:stdin]
|
363
366
|
ProcessedSource.new(@options[:stdin], ruby_version, file)
|
364
367
|
else
|
365
|
-
|
368
|
+
begin
|
369
|
+
ProcessedSource.from_file(file, ruby_version)
|
370
|
+
rescue Errno::ENOENT
|
371
|
+
raise RuboCop::Error, "No such file or directory: #{file}"
|
372
|
+
end
|
366
373
|
end
|
367
374
|
end
|
368
375
|
|
@@ -373,7 +380,7 @@ module RuboCop
|
|
373
380
|
def standby_team(config)
|
374
381
|
@team_by_config ||= {}
|
375
382
|
@team_by_config[config.object_id] ||=
|
376
|
-
Cop::Team.
|
383
|
+
Cop::Team.mobilize(mobilized_cop_classes(config), config, @options)
|
377
384
|
end
|
378
385
|
end
|
379
386
|
end
|
@@ -27,7 +27,7 @@ module RuboCop
|
|
27
27
|
# (if any). If args is empty, recursively find all Ruby source
|
28
28
|
# files under the current directory
|
29
29
|
# @return [Array] array of file paths
|
30
|
-
def find(args)
|
30
|
+
def find(args, mode)
|
31
31
|
return target_files_in_dir if args.empty?
|
32
32
|
|
33
33
|
files = []
|
@@ -36,7 +36,7 @@ module RuboCop
|
|
36
36
|
files += if File.directory?(arg)
|
37
37
|
target_files_in_dir(arg.chomp(File::SEPARATOR))
|
38
38
|
else
|
39
|
-
process_explicit_path(arg)
|
39
|
+
process_explicit_path(arg, mode)
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
@@ -54,9 +54,7 @@ module RuboCop
|
|
54
54
|
# @return [Array] Array of filenames
|
55
55
|
def target_files_in_dir(base_dir = Dir.pwd)
|
56
56
|
# Support Windows: Backslashes from command-line -> forward slashes
|
57
|
-
if File::ALT_SEPARATOR
|
58
|
-
base_dir = base_dir.gsub(File::ALT_SEPARATOR, File::SEPARATOR)
|
59
|
-
end
|
57
|
+
base_dir = base_dir.gsub(File::ALT_SEPARATOR, File::SEPARATOR) if File::ALT_SEPARATOR
|
60
58
|
all_files = find_files(base_dir, File::FNM_DOTMATCH)
|
61
59
|
hidden_files = Set.new(all_files - find_files(base_dir, 0))
|
62
60
|
base_dir_config = @config_store.for(base_dir)
|
@@ -169,10 +167,12 @@ module RuboCop
|
|
169
167
|
ruby_file?(file) || configured_include?(file)
|
170
168
|
end
|
171
169
|
|
172
|
-
def process_explicit_path(path)
|
170
|
+
def process_explicit_path(path, mode)
|
173
171
|
files = path.include?('*') ? Dir[path] : [path]
|
174
172
|
|
175
|
-
|
173
|
+
if mode == :only_recognized_file_types || force_exclusion?
|
174
|
+
files.select! { |file| included_file?(file) }
|
175
|
+
end
|
176
176
|
|
177
177
|
return files unless force_exclusion?
|
178
178
|
|
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.
|
6
|
+
KNOWN_RUBIES = [2.4, 2.5, 2.6, 2.7].freeze
|
7
7
|
DEFAULT_VERSION = KNOWN_RUBIES.first
|
8
8
|
|
9
9
|
OBSOLETE_RUBIES = {
|
10
|
-
1.9 => '0.50', 2.0 => '0.50', 2.1 => '0.58', 2.2 => '0.69'
|
10
|
+
1.9 => '0.50', 2.0 => '0.50', 2.1 => '0.58', 2.2 => '0.69', 2.3 => '0.81'
|
11
11
|
}.freeze
|
12
12
|
private_constant :KNOWN_RUBIES, :OBSOLETE_RUBIES
|
13
13
|
|
@@ -52,7 +52,10 @@ module RuboCop
|
|
52
52
|
file = ruby_version_file
|
53
53
|
return unless file && File.file?(file)
|
54
54
|
|
55
|
+
# rubocop:disable Lint/MixedRegexpCaptureTypes
|
56
|
+
# `(ruby-)` is not a capture type.
|
55
57
|
File.read(file).match(/\A(ruby-)?(?<version>\d+\.\d+)/) do |md|
|
58
|
+
# rubocop:enable Lint/MixedRegexpCaptureTypes
|
56
59
|
md[:version].to_f
|
57
60
|
end
|
58
61
|
end
|
data/lib/rubocop/version.rb
CHANGED
@@ -3,14 +3,16 @@
|
|
3
3
|
module RuboCop
|
4
4
|
# This module holds the RuboCop version information.
|
5
5
|
module Version
|
6
|
-
STRING = '0.
|
6
|
+
STRING = '0.85.0'
|
7
7
|
|
8
|
-
MSG = '%<version>s (using Parser %<parser_version>s,
|
9
|
-
'
|
8
|
+
MSG = '%<version>s (using Parser %<parser_version>s, '\
|
9
|
+
'rubocop-ast %<rubocop_ast_version>s, ' \
|
10
|
+
'running on %<ruby_engine>s %<ruby_version>s %<ruby_platform>s)'
|
10
11
|
|
11
12
|
def self.version(debug = false)
|
12
13
|
if debug
|
13
14
|
format(MSG, version: STRING, parser_version: Parser::VERSION,
|
15
|
+
rubocop_ast_version: RuboCop::AST::Version::STRING,
|
14
16
|
ruby_engine: RUBY_ENGINE, ruby_version: RUBY_VERSION,
|
15
17
|
ruby_platform: RUBY_PLATFORM)
|
16
18
|
else
|
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.85.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bozhidar Batsov
|
@@ -10,22 +10,8 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2020-
|
13
|
+
date: 2020-06-01 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
|
-
- !ruby/object:Gem::Dependency
|
16
|
-
name: jaro_winkler
|
17
|
-
requirement: !ruby/object:Gem::Requirement
|
18
|
-
requirements:
|
19
|
-
- - "~>"
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: 1.5.1
|
22
|
-
type: :runtime
|
23
|
-
prerelease: false
|
24
|
-
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
requirements:
|
26
|
-
- - "~>"
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
version: 1.5.1
|
29
15
|
- !ruby/object:Gem::Dependency
|
30
16
|
name: parallel
|
31
17
|
requirement: !ruby/object:Gem::Requirement
|
@@ -74,6 +60,20 @@ dependencies:
|
|
74
60
|
- - "<"
|
75
61
|
- !ruby/object:Gem::Version
|
76
62
|
version: '4.0'
|
63
|
+
- !ruby/object:Gem::Dependency
|
64
|
+
name: regexp_parser
|
65
|
+
requirement: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '1.7'
|
70
|
+
type: :runtime
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '1.7'
|
77
77
|
- !ruby/object:Gem::Dependency
|
78
78
|
name: rexml
|
79
79
|
requirement: !ruby/object:Gem::Requirement
|
@@ -88,6 +88,20 @@ dependencies:
|
|
88
88
|
- - ">="
|
89
89
|
- !ruby/object:Gem::Version
|
90
90
|
version: '0'
|
91
|
+
- !ruby/object:Gem::Dependency
|
92
|
+
name: rubocop-ast
|
93
|
+
requirement: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: 0.0.3
|
98
|
+
type: :runtime
|
99
|
+
prerelease: false
|
100
|
+
version_requirements: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: 0.0.3
|
91
105
|
- !ruby/object:Gem::Dependency
|
92
106
|
name: ruby-progressbar
|
93
107
|
requirement: !ruby/object:Gem::Requirement
|
@@ -111,7 +125,7 @@ dependencies:
|
|
111
125
|
version: 1.4.0
|
112
126
|
- - "<"
|
113
127
|
- !ruby/object:Gem::Version
|
114
|
-
version: '
|
128
|
+
version: '2.0'
|
115
129
|
type: :runtime
|
116
130
|
prerelease: false
|
117
131
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -121,7 +135,7 @@ dependencies:
|
|
121
135
|
version: 1.4.0
|
122
136
|
- - "<"
|
123
137
|
- !ruby/object:Gem::Version
|
124
|
-
version: '
|
138
|
+
version: '2.0'
|
125
139
|
- !ruby/object:Gem::Dependency
|
126
140
|
name: bundler
|
127
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -162,56 +176,7 @@ files:
|
|
162
176
|
- config/default.yml
|
163
177
|
- exe/rubocop
|
164
178
|
- lib/rubocop.rb
|
165
|
-
- lib/rubocop/
|
166
|
-
- lib/rubocop/ast/node.rb
|
167
|
-
- lib/rubocop/ast/node/alias_node.rb
|
168
|
-
- lib/rubocop/ast/node/and_node.rb
|
169
|
-
- lib/rubocop/ast/node/args_node.rb
|
170
|
-
- lib/rubocop/ast/node/array_node.rb
|
171
|
-
- lib/rubocop/ast/node/block_node.rb
|
172
|
-
- lib/rubocop/ast/node/break_node.rb
|
173
|
-
- lib/rubocop/ast/node/case_node.rb
|
174
|
-
- lib/rubocop/ast/node/class_node.rb
|
175
|
-
- lib/rubocop/ast/node/def_node.rb
|
176
|
-
- lib/rubocop/ast/node/defined_node.rb
|
177
|
-
- lib/rubocop/ast/node/ensure_node.rb
|
178
|
-
- lib/rubocop/ast/node/float_node.rb
|
179
|
-
- lib/rubocop/ast/node/for_node.rb
|
180
|
-
- lib/rubocop/ast/node/forward_args_node.rb
|
181
|
-
- lib/rubocop/ast/node/hash_node.rb
|
182
|
-
- lib/rubocop/ast/node/if_node.rb
|
183
|
-
- lib/rubocop/ast/node/int_node.rb
|
184
|
-
- lib/rubocop/ast/node/keyword_splat_node.rb
|
185
|
-
- lib/rubocop/ast/node/mixin/basic_literal_node.rb
|
186
|
-
- lib/rubocop/ast/node/mixin/binary_operator_node.rb
|
187
|
-
- lib/rubocop/ast/node/mixin/collection_node.rb
|
188
|
-
- lib/rubocop/ast/node/mixin/conditional_node.rb
|
189
|
-
- lib/rubocop/ast/node/mixin/hash_element_node.rb
|
190
|
-
- lib/rubocop/ast/node/mixin/method_dispatch_node.rb
|
191
|
-
- lib/rubocop/ast/node/mixin/method_identifier_predicates.rb
|
192
|
-
- lib/rubocop/ast/node/mixin/modifier_node.rb
|
193
|
-
- lib/rubocop/ast/node/mixin/numeric_node.rb
|
194
|
-
- lib/rubocop/ast/node/mixin/parameterized_node.rb
|
195
|
-
- lib/rubocop/ast/node/mixin/predicate_operator_node.rb
|
196
|
-
- lib/rubocop/ast/node/module_node.rb
|
197
|
-
- lib/rubocop/ast/node/or_node.rb
|
198
|
-
- lib/rubocop/ast/node/pair_node.rb
|
199
|
-
- lib/rubocop/ast/node/range_node.rb
|
200
|
-
- lib/rubocop/ast/node/regexp_node.rb
|
201
|
-
- lib/rubocop/ast/node/resbody_node.rb
|
202
|
-
- lib/rubocop/ast/node/retry_node.rb
|
203
|
-
- lib/rubocop/ast/node/return_node.rb
|
204
|
-
- lib/rubocop/ast/node/self_class_node.rb
|
205
|
-
- lib/rubocop/ast/node/send_node.rb
|
206
|
-
- lib/rubocop/ast/node/str_node.rb
|
207
|
-
- lib/rubocop/ast/node/super_node.rb
|
208
|
-
- lib/rubocop/ast/node/symbol_node.rb
|
209
|
-
- lib/rubocop/ast/node/until_node.rb
|
210
|
-
- lib/rubocop/ast/node/when_node.rb
|
211
|
-
- lib/rubocop/ast/node/while_node.rb
|
212
|
-
- lib/rubocop/ast/node/yield_node.rb
|
213
|
-
- lib/rubocop/ast/sexp.rb
|
214
|
-
- lib/rubocop/ast/traversal.rb
|
179
|
+
- lib/rubocop/ast_aliases.rb
|
215
180
|
- lib/rubocop/cached_data.rb
|
216
181
|
- lib/rubocop/cli.rb
|
217
182
|
- lib/rubocop/cli/command.rb
|
@@ -292,6 +257,7 @@ files:
|
|
292
257
|
- lib/rubocop/cop/layout/empty_lines.rb
|
293
258
|
- lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb
|
294
259
|
- lib/rubocop/cop/layout/empty_lines_around_arguments.rb
|
260
|
+
- lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb
|
295
261
|
- lib/rubocop/cop/layout/empty_lines_around_begin_body.rb
|
296
262
|
- lib/rubocop/cop/layout/empty_lines_around_block_body.rb
|
297
263
|
- lib/rubocop/cop/layout/empty_lines_around_class_body.rb
|
@@ -313,6 +279,7 @@ files:
|
|
313
279
|
- lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb
|
314
280
|
- lib/rubocop/cop/layout/heredoc_indentation.rb
|
315
281
|
- lib/rubocop/cop/layout/indentation_consistency.rb
|
282
|
+
- lib/rubocop/cop/layout/indentation_style.rb
|
316
283
|
- lib/rubocop/cop/layout/indentation_width.rb
|
317
284
|
- lib/rubocop/cop/layout/initial_indentation.rb
|
318
285
|
- lib/rubocop/cop/layout/leading_comment_space.rb
|
@@ -339,6 +306,7 @@ files:
|
|
339
306
|
- lib/rubocop/cop/layout/space_around_block_parameters.rb
|
340
307
|
- lib/rubocop/cop/layout/space_around_equals_in_parameter_default.rb
|
341
308
|
- lib/rubocop/cop/layout/space_around_keyword.rb
|
309
|
+
- lib/rubocop/cop/layout/space_around_method_call_operator.rb
|
342
310
|
- lib/rubocop/cop/layout/space_around_operators.rb
|
343
311
|
- lib/rubocop/cop/layout/space_before_block_braces.rb
|
344
312
|
- lib/rubocop/cop/layout/space_before_comma.rb
|
@@ -355,7 +323,6 @@ files:
|
|
355
323
|
- lib/rubocop/cop/layout/space_inside_range_literal.rb
|
356
324
|
- lib/rubocop/cop/layout/space_inside_reference_brackets.rb
|
357
325
|
- lib/rubocop/cop/layout/space_inside_string_interpolation.rb
|
358
|
-
- lib/rubocop/cop/layout/tab.rb
|
359
326
|
- lib/rubocop/cop/layout/trailing_empty_lines.rb
|
360
327
|
- lib/rubocop/cop/layout/trailing_whitespace.rb
|
361
328
|
- lib/rubocop/cop/lint/ambiguous_block_association.rb
|
@@ -367,6 +334,7 @@ files:
|
|
367
334
|
- lib/rubocop/cop/lint/circular_argument_reference.rb
|
368
335
|
- lib/rubocop/cop/lint/debugger.rb
|
369
336
|
- lib/rubocop/cop/lint/deprecated_class_methods.rb
|
337
|
+
- lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb
|
370
338
|
- lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb
|
371
339
|
- lib/rubocop/cop/lint/duplicate_case_condition.rb
|
372
340
|
- lib/rubocop/cop/lint/duplicate_hash_key.rb
|
@@ -377,7 +345,6 @@ files:
|
|
377
345
|
- lib/rubocop/cop/lint/empty_expression.rb
|
378
346
|
- lib/rubocop/cop/lint/empty_interpolation.rb
|
379
347
|
- lib/rubocop/cop/lint/empty_when.rb
|
380
|
-
- lib/rubocop/cop/lint/end_in_method.rb
|
381
348
|
- lib/rubocop/cop/lint/ensure_return.rb
|
382
349
|
- lib/rubocop/cop/lint/erb_new_arguments.rb
|
383
350
|
- lib/rubocop/cop/lint/flip_flop.rb
|
@@ -392,6 +359,7 @@ files:
|
|
392
359
|
- lib/rubocop/cop/lint/literal_in_interpolation.rb
|
393
360
|
- lib/rubocop/cop/lint/loop.rb
|
394
361
|
- lib/rubocop/cop/lint/missing_cop_enable_directive.rb
|
362
|
+
- lib/rubocop/cop/lint/mixed_regexp_capture_types.rb
|
395
363
|
- lib/rubocop/cop/lint/multiple_comparison.rb
|
396
364
|
- lib/rubocop/cop/lint/nested_method_definition.rb
|
397
365
|
- lib/rubocop/cop/lint/nested_percent_literal.rb
|
@@ -403,6 +371,7 @@ files:
|
|
403
371
|
- lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb
|
404
372
|
- lib/rubocop/cop/lint/percent_string_array.rb
|
405
373
|
- lib/rubocop/cop/lint/percent_symbol_array.rb
|
374
|
+
- lib/rubocop/cop/lint/raise_exception.rb
|
406
375
|
- lib/rubocop/cop/lint/rand_one.rb
|
407
376
|
- lib/rubocop/cop/lint/redundant_cop_disable_directive.rb
|
408
377
|
- lib/rubocop/cop/lint/redundant_cop_enable_directive.rb
|
@@ -424,6 +393,7 @@ files:
|
|
424
393
|
- lib/rubocop/cop/lint/shadowed_argument.rb
|
425
394
|
- lib/rubocop/cop/lint/shadowed_exception.rb
|
426
395
|
- lib/rubocop/cop/lint/shadowing_outer_local_variable.rb
|
396
|
+
- lib/rubocop/cop/lint/struct_new_override.rb
|
427
397
|
- lib/rubocop/cop/lint/suppressed_exception.rb
|
428
398
|
- lib/rubocop/cop/lint/syntax.rb
|
429
399
|
- lib/rubocop/cop/lint/to_json.rb
|
@@ -502,6 +472,7 @@ files:
|
|
502
472
|
- lib/rubocop/cop/mixin/preferred_delimiters.rb
|
503
473
|
- lib/rubocop/cop/mixin/range_help.rb
|
504
474
|
- lib/rubocop/cop/mixin/rational_literal.rb
|
475
|
+
- lib/rubocop/cop/mixin/regexp_literal_help.rb
|
505
476
|
- lib/rubocop/cop/mixin/rescue_node.rb
|
506
477
|
- lib/rubocop/cop/mixin/safe_assignment.rb
|
507
478
|
- lib/rubocop/cop/mixin/space_after_punctuation.rb
|
@@ -569,6 +540,7 @@ files:
|
|
569
540
|
- lib/rubocop/cop/style/date_time.rb
|
570
541
|
- lib/rubocop/cop/style/def_with_parentheses.rb
|
571
542
|
- lib/rubocop/cop/style/dir.rb
|
543
|
+
- lib/rubocop/cop/style/disable_cops_within_source_code_directive.rb
|
572
544
|
- lib/rubocop/cop/style/documentation.rb
|
573
545
|
- lib/rubocop/cop/style/documentation_method.rb
|
574
546
|
- lib/rubocop/cop/style/double_cop_disable_directive.rb
|
@@ -586,6 +558,7 @@ files:
|
|
586
558
|
- lib/rubocop/cop/style/eval_with_location.rb
|
587
559
|
- lib/rubocop/cop/style/even_odd.rb
|
588
560
|
- lib/rubocop/cop/style/expand_path_arguments.rb
|
561
|
+
- lib/rubocop/cop/style/exponential_notation.rb
|
589
562
|
- lib/rubocop/cop/style/float_division.rb
|
590
563
|
- lib/rubocop/cop/style/for.rb
|
591
564
|
- lib/rubocop/cop/style/format_string.rb
|
@@ -667,6 +640,8 @@ files:
|
|
667
640
|
- lib/rubocop/cop/style/redundant_interpolation.rb
|
668
641
|
- lib/rubocop/cop/style/redundant_parentheses.rb
|
669
642
|
- lib/rubocop/cop/style/redundant_percent_q.rb
|
643
|
+
- lib/rubocop/cop/style/redundant_regexp_character_class.rb
|
644
|
+
- lib/rubocop/cop/style/redundant_regexp_escape.rb
|
670
645
|
- lib/rubocop/cop/style/redundant_return.rb
|
671
646
|
- lib/rubocop/cop/style/redundant_self.rb
|
672
647
|
- lib/rubocop/cop/style/redundant_sort.rb
|
@@ -683,6 +658,7 @@ files:
|
|
683
658
|
- lib/rubocop/cop/style/signal_exception.rb
|
684
659
|
- lib/rubocop/cop/style/single_line_block_params.rb
|
685
660
|
- lib/rubocop/cop/style/single_line_methods.rb
|
661
|
+
- lib/rubocop/cop/style/slicing_with_range.rb
|
686
662
|
- lib/rubocop/cop/style/special_global_vars.rb
|
687
663
|
- lib/rubocop/cop/style/stabby_lambda_parentheses.rb
|
688
664
|
- lib/rubocop/cop/style/stderr_puts.rb
|
@@ -701,6 +677,7 @@ files:
|
|
701
677
|
- lib/rubocop/cop/style/trailing_body_on_module.rb
|
702
678
|
- lib/rubocop/cop/style/trailing_comma_in_arguments.rb
|
703
679
|
- lib/rubocop/cop/style/trailing_comma_in_array_literal.rb
|
680
|
+
- lib/rubocop/cop/style/trailing_comma_in_block_args.rb
|
704
681
|
- lib/rubocop/cop/style/trailing_comma_in_hash_literal.rb
|
705
682
|
- lib/rubocop/cop/style/trailing_method_end_statement.rb
|
706
683
|
- lib/rubocop/cop/style/trailing_underscore_variable.rb
|
@@ -727,13 +704,13 @@ files:
|
|
727
704
|
- lib/rubocop/cop/variable_force/variable_table.rb
|
728
705
|
- lib/rubocop/core_ext/string.rb
|
729
706
|
- lib/rubocop/error.rb
|
707
|
+
- lib/rubocop/ext/processed_source.rb
|
730
708
|
- lib/rubocop/file_finder.rb
|
731
709
|
- lib/rubocop/formatter/auto_gen_config_formatter.rb
|
732
710
|
- lib/rubocop/formatter/base_formatter.rb
|
733
711
|
- lib/rubocop/formatter/clang_style_formatter.rb
|
734
712
|
- lib/rubocop/formatter/colorizable.rb
|
735
713
|
- lib/rubocop/formatter/disabled_config_formatter.rb
|
736
|
-
- lib/rubocop/formatter/disabled_lines_formatter.rb
|
737
714
|
- lib/rubocop/formatter/emacs_style_formatter.rb
|
738
715
|
- lib/rubocop/formatter/file_list_formatter.rb
|
739
716
|
- lib/rubocop/formatter/formatter_set.rb
|
@@ -751,11 +728,9 @@ files:
|
|
751
728
|
- lib/rubocop/formatter/worst_offenders_formatter.rb
|
752
729
|
- lib/rubocop/magic_comment.rb
|
753
730
|
- lib/rubocop/name_similarity.rb
|
754
|
-
- lib/rubocop/node_pattern.rb
|
755
731
|
- lib/rubocop/options.rb
|
756
732
|
- lib/rubocop/path_util.rb
|
757
733
|
- lib/rubocop/platform.rb
|
758
|
-
- lib/rubocop/processed_source.rb
|
759
734
|
- lib/rubocop/rake_task.rb
|
760
735
|
- lib/rubocop/remote_config.rb
|
761
736
|
- lib/rubocop/result_cache.rb
|
@@ -766,10 +741,8 @@ files:
|
|
766
741
|
- lib/rubocop/rspec/support.rb
|
767
742
|
- lib/rubocop/runner.rb
|
768
743
|
- lib/rubocop/string_interpreter.rb
|
769
|
-
- lib/rubocop/string_util.rb
|
770
744
|
- lib/rubocop/target_finder.rb
|
771
745
|
- lib/rubocop/target_ruby.rb
|
772
|
-
- lib/rubocop/token.rb
|
773
746
|
- lib/rubocop/version.rb
|
774
747
|
- lib/rubocop/warning.rb
|
775
748
|
- lib/rubocop/yaml_duplication_checker.rb
|
@@ -777,7 +750,7 @@ homepage: https://github.com/rubocop-hq/rubocop
|
|
777
750
|
licenses:
|
778
751
|
- MIT
|
779
752
|
metadata:
|
780
|
-
homepage_uri: https://
|
753
|
+
homepage_uri: https://rubocop.org/
|
781
754
|
changelog_uri: https://github.com/rubocop-hq/rubocop/blob/master/CHANGELOG.md
|
782
755
|
source_code_uri: https://github.com/rubocop-hq/rubocop/
|
783
756
|
documentation_uri: https://docs.rubocop.org/
|
@@ -790,7 +763,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
790
763
|
requirements:
|
791
764
|
- - ">="
|
792
765
|
- !ruby/object:Gem::Version
|
793
|
-
version: 2.
|
766
|
+
version: 2.4.0
|
794
767
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
795
768
|
requirements:
|
796
769
|
- - ">="
|