rubocop 0.80.0 → 0.84.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 +171 -34
- data/lib/rubocop.rb +15 -62
- data/lib/rubocop/ast_aliases.rb +8 -0
- data/lib/rubocop/cli.rb +11 -5
- data/lib/rubocop/cli/command/show_cops.rb +2 -6
- data/lib/rubocop/config.rb +41 -13
- data/lib/rubocop/config_loader.rb +40 -36
- data/lib/rubocop/config_loader_resolver.rb +27 -4
- data/lib/rubocop/config_obsoletion.rb +2 -0
- 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/insecure_protocol_source.rb +1 -1
- data/lib/rubocop/cop/corrector.rb +49 -27
- 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 +3 -3
- data/lib/rubocop/cop/correctors/line_break_corrector.rb +2 -2
- data/lib/rubocop/cop/correctors/parentheses_corrector.rb +1 -3
- 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/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 +0 -2
- data/lib/rubocop/cop/layout/first_array_element_indentation.rb +14 -10
- 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/heredoc_argument_closing_parenthesis.rb +4 -8
- data/lib/rubocop/cop/layout/heredoc_indentation.rb +2 -2
- 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 +7 -4
- data/lib/rubocop/cop/layout/multiline_block_layout.rb +2 -4
- 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_method_call_operator.rb +129 -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 +2 -6
- data/lib/rubocop/cop/layout/trailing_whitespace.rb +2 -2
- data/lib/rubocop/cop/lint/ambiguous_operator.rb +40 -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 +133 -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 +18 -1
- data/lib/rubocop/cop/lint/erb_new_arguments.rb +3 -7
- 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 +6 -4
- 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/non_deterministic_require_order.rb +2 -2
- data/lib/rubocop/cop/lint/number_conversion.rb +1 -1
- data/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb +31 -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_string_coercion.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 +20 -25
- data/lib/rubocop/cop/lint/syntax.rb +1 -3
- data/lib/rubocop/cop/lint/unified_integer.rb +0 -2
- 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 +5 -0
- data/lib/rubocop/cop/migration/department_name.rb +21 -12
- data/lib/rubocop/cop/mixin/alignment.rb +1 -3
- data/lib/rubocop/cop/mixin/array_min_size.rb +2 -6
- data/lib/rubocop/cop/mixin/check_line_breakable.rb +4 -12
- data/lib/rubocop/cop/mixin/configurable_enforced_style.rb +1 -3
- data/lib/rubocop/cop/mixin/configurable_formatting.rb +1 -3
- 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 -3
- data/lib/rubocop/cop/mixin/line_length_help.rb +2 -1
- data/lib/rubocop/cop/mixin/method_complexity.rb +5 -0
- data/lib/rubocop/cop/mixin/multiline_element_indentation.rb +1 -3
- data/lib/rubocop/cop/mixin/parser_diagnostic.rb +1 -1
- data/lib/rubocop/cop/mixin/statement_modifier.rb +7 -22
- data/lib/rubocop/cop/mixin/surrounding_space.rb +1 -3
- 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/naming/class_and_module_camel_case.rb +1 -1
- data/lib/rubocop/cop/naming/constant_name.rb +2 -1
- data/lib/rubocop/cop/naming/file_name.rb +1 -3
- 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/rescued_exceptions_variable_name.rb +1 -1
- data/lib/rubocop/cop/registry.rb +13 -10
- 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 +1 -1
- data/lib/rubocop/cop/style/attr.rb +1 -3
- 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 +1 -1
- 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 +1 -5
- 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/frozen_string_literal_comment.rb +2 -4
- data/lib/rubocop/cop/style/guard_clause.rb +25 -2
- data/lib/rubocop/cop/style/hash_each_methods.rb +5 -3
- data/lib/rubocop/cop/style/hash_syntax.rb +15 -10
- 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/inverse_methods.rb +9 -5
- 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/nested_parenthesized_calls.rb +4 -4
- 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 +4 -4
- 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 +18 -6
- 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 +2 -2
- 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 +1 -1
- 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 +2 -6
- data/lib/rubocop/cop/style/trivial_accessors.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/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/util.rb +24 -0
- 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 +2 -6
- 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 +17 -6
- data/lib/rubocop/formatter/pacman_formatter.rb +1 -1
- data/lib/rubocop/formatter/tap_formatter.rb +1 -1
- data/lib/rubocop/name_similarity.rb +12 -9
- data/lib/rubocop/options.rb +20 -13
- data/lib/rubocop/remote_config.rb +1 -3
- data/lib/rubocop/result_cache.rb +1 -3
- data/lib/rubocop/rspec/cop_helper.rb +2 -4
- data/lib/rubocop/rspec/expect_offense.rb +4 -10
- data/lib/rubocop/rspec/shared_contexts.rb +54 -20
- data/lib/rubocop/runner.rb +15 -12
- data/lib/rubocop/target_finder.rb +5 -7
- data/lib/rubocop/target_ruby.rb +2 -2
- data/lib/rubocop/version.rb +5 -3
- metadata +32 -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
@@ -56,9 +56,7 @@ module RuboCop
|
|
56
56
|
def generate_request(uri)
|
57
57
|
request = Net::HTTP::Get.new(uri.request_uri)
|
58
58
|
|
59
|
-
if cache_path_exists?
|
60
|
-
request['If-Modified-Since'] = File.stat(cache_path).mtime.rfc2822
|
61
|
-
end
|
59
|
+
request['If-Modified-Since'] = File.stat(cache_path).mtime.rfc2822 if cache_path_exists?
|
62
60
|
|
63
61
|
yield request
|
64
62
|
end
|
data/lib/rubocop/result_cache.rb
CHANGED
@@ -40,9 +40,7 @@ module RuboCop
|
|
40
40
|
# Add 1 to half the number of files, so that we remove the file if
|
41
41
|
# there's only 1 left.
|
42
42
|
remove_count = 1 + files.length / 2
|
43
|
-
if verbose
|
44
|
-
puts "Removing the #{remove_count} oldest files from #{cache_root}"
|
45
|
-
end
|
43
|
+
puts "Removing the #{remove_count} oldest files from #{cache_root}" if verbose
|
46
44
|
sorted = files.sort_by { |path| File.mtime(path) }
|
47
45
|
remove_files(sorted, dirs, remove_count)
|
48
46
|
rescue Errno::ENOENT
|
@@ -6,7 +6,7 @@ require 'tempfile'
|
|
6
6
|
module CopHelper
|
7
7
|
extend RSpec::SharedContext
|
8
8
|
|
9
|
-
let(:ruby_version) { 2.
|
9
|
+
let(:ruby_version) { 2.4 }
|
10
10
|
let(:rails_version) { false }
|
11
11
|
|
12
12
|
def inspect_source_file(source)
|
@@ -57,9 +57,7 @@ module CopHelper
|
|
57
57
|
|
58
58
|
source = new_source
|
59
59
|
cnt += 1
|
60
|
-
if cnt > RuboCop::Runner::MAX_ITERATIONS
|
61
|
-
raise RuboCop::Runner::InfiniteCorrectionLoop.new(file, [])
|
62
|
-
end
|
60
|
+
raise RuboCop::Runner::InfiniteCorrectionLoop.new(file, []) if cnt > RuboCop::Runner::MAX_ITERATIONS
|
63
61
|
end
|
64
62
|
end
|
65
63
|
|
@@ -88,9 +88,7 @@ module RuboCop
|
|
88
88
|
@processed_source = parse_source(expected_annotations.plain_source,
|
89
89
|
file)
|
90
90
|
|
91
|
-
unless @processed_source.valid_syntax?
|
92
|
-
raise 'Error parsing example code'
|
93
|
-
end
|
91
|
+
raise 'Error parsing example code' unless @processed_source.valid_syntax?
|
94
92
|
|
95
93
|
_investigate(cop, @processed_source)
|
96
94
|
actual_annotations =
|
@@ -101,9 +99,7 @@ module RuboCop
|
|
101
99
|
# rubocop:enable Metrics/AbcSize, Metrics/MethodLength
|
102
100
|
|
103
101
|
def expect_correction(correction)
|
104
|
-
unless @processed_source
|
105
|
-
raise '`expect_correction` must follow `expect_offense`'
|
106
|
-
end
|
102
|
+
raise '`expect_correction` must follow `expect_offense`' unless @processed_source
|
107
103
|
|
108
104
|
corrector =
|
109
105
|
RuboCop::Cop::Corrector.new(@processed_source.buffer, cop.corrections)
|
@@ -113,9 +109,7 @@ module RuboCop
|
|
113
109
|
end
|
114
110
|
|
115
111
|
def expect_no_corrections
|
116
|
-
unless @processed_source
|
117
|
-
raise '`expect_no_corrections` must follow `expect_offense`'
|
118
|
-
end
|
112
|
+
raise '`expect_no_corrections` must follow `expect_offense`' unless @processed_source
|
119
113
|
|
120
114
|
return if cop.corrections.empty?
|
121
115
|
|
@@ -153,7 +147,7 @@ module RuboCop
|
|
153
147
|
annotations = []
|
154
148
|
|
155
149
|
annotated_source.each_line do |source_line|
|
156
|
-
if source_line
|
150
|
+
if ANNOTATION_PATTERN.match?(source_line)
|
157
151
|
annotations << [source.size, source_line]
|
158
152
|
else
|
159
153
|
source << source_line
|
@@ -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 overriden 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
|
+
### Usefull intermediary steps (less likely to be overriden)
|
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
|
@@ -201,9 +204,7 @@ module RuboCop
|
|
201
204
|
end
|
202
205
|
|
203
206
|
def file_finished(file, offenses)
|
204
|
-
if @options[:display_only_fail_level_offenses]
|
205
|
-
offenses = offenses.select { |o| considered_failure?(o) }
|
206
|
-
end
|
207
|
+
offenses = offenses.select { |o| considered_failure?(o) } if @options[:display_only_fail_level_offenses]
|
207
208
|
formatter_set.file_finished(file, offenses)
|
208
209
|
end
|
209
210
|
|
@@ -283,9 +284,7 @@ module RuboCop
|
|
283
284
|
def check_for_infinite_loop(processed_source, offenses)
|
284
285
|
checksum = processed_source.checksum
|
285
286
|
|
286
|
-
if @processed_sources.include?(checksum)
|
287
|
-
raise InfiniteCorrectionLoop.new(processed_source.path, offenses)
|
288
|
-
end
|
287
|
+
raise InfiniteCorrectionLoop.new(processed_source.path, offenses) if @processed_sources.include?(checksum)
|
289
288
|
|
290
289
|
@processed_sources << checksum
|
291
290
|
end
|
@@ -314,7 +313,7 @@ module RuboCop
|
|
314
313
|
|
315
314
|
cop_classes.reject! { |c| c.match?(@options[:except]) }
|
316
315
|
|
317
|
-
Cop::Registry.new(cop_classes)
|
316
|
+
Cop::Registry.new(cop_classes, @options)
|
318
317
|
end
|
319
318
|
end
|
320
319
|
|
@@ -362,7 +361,11 @@ module RuboCop
|
|
362
361
|
if @options[:stdin]
|
363
362
|
ProcessedSource.new(@options[:stdin], ruby_version, file)
|
364
363
|
else
|
365
|
-
|
364
|
+
begin
|
365
|
+
ProcessedSource.from_file(file, ruby_version)
|
366
|
+
rescue Errno::ENOENT
|
367
|
+
raise RuboCop::Error, "No such file or directory: #{file}"
|
368
|
+
end
|
366
369
|
end
|
367
370
|
end
|
368
371
|
|
@@ -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,10 @@ 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
|
-
files.select! { |file| included_file?(file) }
|
173
|
+
files.select! { |file| included_file?(file) } if mode == :only_recognized_file_types || force_exclusion?
|
176
174
|
|
177
175
|
return files unless force_exclusion?
|
178
176
|
|
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.82'
|
11
11
|
}.freeze
|
12
12
|
private_constant :KNOWN_RUBIES, :OBSOLETE_RUBIES
|
13
13
|
|
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.84.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.84.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-05-21 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
|
@@ -88,6 +74,20 @@ dependencies:
|
|
88
74
|
- - ">="
|
89
75
|
- !ruby/object:Gem::Version
|
90
76
|
version: '0'
|
77
|
+
- !ruby/object:Gem::Dependency
|
78
|
+
name: rubocop-ast
|
79
|
+
requirement: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: 0.0.3
|
84
|
+
type: :runtime
|
85
|
+
prerelease: false
|
86
|
+
version_requirements: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: 0.0.3
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: ruby-progressbar
|
93
93
|
requirement: !ruby/object:Gem::Requirement
|
@@ -111,7 +111,7 @@ dependencies:
|
|
111
111
|
version: 1.4.0
|
112
112
|
- - "<"
|
113
113
|
- !ruby/object:Gem::Version
|
114
|
-
version: '
|
114
|
+
version: '2.0'
|
115
115
|
type: :runtime
|
116
116
|
prerelease: false
|
117
117
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -121,7 +121,7 @@ dependencies:
|
|
121
121
|
version: 1.4.0
|
122
122
|
- - "<"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: '
|
124
|
+
version: '2.0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: bundler
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -162,56 +162,7 @@ files:
|
|
162
162
|
- config/default.yml
|
163
163
|
- exe/rubocop
|
164
164
|
- 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
|
165
|
+
- lib/rubocop/ast_aliases.rb
|
215
166
|
- lib/rubocop/cached_data.rb
|
216
167
|
- lib/rubocop/cli.rb
|
217
168
|
- lib/rubocop/cli/command.rb
|
@@ -292,6 +243,7 @@ files:
|
|
292
243
|
- lib/rubocop/cop/layout/empty_lines.rb
|
293
244
|
- lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb
|
294
245
|
- lib/rubocop/cop/layout/empty_lines_around_arguments.rb
|
246
|
+
- lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb
|
295
247
|
- lib/rubocop/cop/layout/empty_lines_around_begin_body.rb
|
296
248
|
- lib/rubocop/cop/layout/empty_lines_around_block_body.rb
|
297
249
|
- lib/rubocop/cop/layout/empty_lines_around_class_body.rb
|
@@ -313,6 +265,7 @@ files:
|
|
313
265
|
- lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb
|
314
266
|
- lib/rubocop/cop/layout/heredoc_indentation.rb
|
315
267
|
- lib/rubocop/cop/layout/indentation_consistency.rb
|
268
|
+
- lib/rubocop/cop/layout/indentation_style.rb
|
316
269
|
- lib/rubocop/cop/layout/indentation_width.rb
|
317
270
|
- lib/rubocop/cop/layout/initial_indentation.rb
|
318
271
|
- lib/rubocop/cop/layout/leading_comment_space.rb
|
@@ -339,6 +292,7 @@ files:
|
|
339
292
|
- lib/rubocop/cop/layout/space_around_block_parameters.rb
|
340
293
|
- lib/rubocop/cop/layout/space_around_equals_in_parameter_default.rb
|
341
294
|
- lib/rubocop/cop/layout/space_around_keyword.rb
|
295
|
+
- lib/rubocop/cop/layout/space_around_method_call_operator.rb
|
342
296
|
- lib/rubocop/cop/layout/space_around_operators.rb
|
343
297
|
- lib/rubocop/cop/layout/space_before_block_braces.rb
|
344
298
|
- lib/rubocop/cop/layout/space_before_comma.rb
|
@@ -355,7 +309,6 @@ files:
|
|
355
309
|
- lib/rubocop/cop/layout/space_inside_range_literal.rb
|
356
310
|
- lib/rubocop/cop/layout/space_inside_reference_brackets.rb
|
357
311
|
- lib/rubocop/cop/layout/space_inside_string_interpolation.rb
|
358
|
-
- lib/rubocop/cop/layout/tab.rb
|
359
312
|
- lib/rubocop/cop/layout/trailing_empty_lines.rb
|
360
313
|
- lib/rubocop/cop/layout/trailing_whitespace.rb
|
361
314
|
- lib/rubocop/cop/lint/ambiguous_block_association.rb
|
@@ -367,6 +320,7 @@ files:
|
|
367
320
|
- lib/rubocop/cop/lint/circular_argument_reference.rb
|
368
321
|
- lib/rubocop/cop/lint/debugger.rb
|
369
322
|
- lib/rubocop/cop/lint/deprecated_class_methods.rb
|
323
|
+
- lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb
|
370
324
|
- lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb
|
371
325
|
- lib/rubocop/cop/lint/duplicate_case_condition.rb
|
372
326
|
- lib/rubocop/cop/lint/duplicate_hash_key.rb
|
@@ -377,7 +331,6 @@ files:
|
|
377
331
|
- lib/rubocop/cop/lint/empty_expression.rb
|
378
332
|
- lib/rubocop/cop/lint/empty_interpolation.rb
|
379
333
|
- lib/rubocop/cop/lint/empty_when.rb
|
380
|
-
- lib/rubocop/cop/lint/end_in_method.rb
|
381
334
|
- lib/rubocop/cop/lint/ensure_return.rb
|
382
335
|
- lib/rubocop/cop/lint/erb_new_arguments.rb
|
383
336
|
- lib/rubocop/cop/lint/flip_flop.rb
|
@@ -403,6 +356,7 @@ files:
|
|
403
356
|
- lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb
|
404
357
|
- lib/rubocop/cop/lint/percent_string_array.rb
|
405
358
|
- lib/rubocop/cop/lint/percent_symbol_array.rb
|
359
|
+
- lib/rubocop/cop/lint/raise_exception.rb
|
406
360
|
- lib/rubocop/cop/lint/rand_one.rb
|
407
361
|
- lib/rubocop/cop/lint/redundant_cop_disable_directive.rb
|
408
362
|
- lib/rubocop/cop/lint/redundant_cop_enable_directive.rb
|
@@ -424,6 +378,7 @@ files:
|
|
424
378
|
- lib/rubocop/cop/lint/shadowed_argument.rb
|
425
379
|
- lib/rubocop/cop/lint/shadowed_exception.rb
|
426
380
|
- lib/rubocop/cop/lint/shadowing_outer_local_variable.rb
|
381
|
+
- lib/rubocop/cop/lint/struct_new_override.rb
|
427
382
|
- lib/rubocop/cop/lint/suppressed_exception.rb
|
428
383
|
- lib/rubocop/cop/lint/syntax.rb
|
429
384
|
- lib/rubocop/cop/lint/to_json.rb
|
@@ -569,6 +524,7 @@ files:
|
|
569
524
|
- lib/rubocop/cop/style/date_time.rb
|
570
525
|
- lib/rubocop/cop/style/def_with_parentheses.rb
|
571
526
|
- lib/rubocop/cop/style/dir.rb
|
527
|
+
- lib/rubocop/cop/style/disable_cops_within_source_code_directive.rb
|
572
528
|
- lib/rubocop/cop/style/documentation.rb
|
573
529
|
- lib/rubocop/cop/style/documentation_method.rb
|
574
530
|
- lib/rubocop/cop/style/double_cop_disable_directive.rb
|
@@ -586,6 +542,7 @@ files:
|
|
586
542
|
- lib/rubocop/cop/style/eval_with_location.rb
|
587
543
|
- lib/rubocop/cop/style/even_odd.rb
|
588
544
|
- lib/rubocop/cop/style/expand_path_arguments.rb
|
545
|
+
- lib/rubocop/cop/style/exponential_notation.rb
|
589
546
|
- lib/rubocop/cop/style/float_division.rb
|
590
547
|
- lib/rubocop/cop/style/for.rb
|
591
548
|
- lib/rubocop/cop/style/format_string.rb
|
@@ -683,6 +640,7 @@ files:
|
|
683
640
|
- lib/rubocop/cop/style/signal_exception.rb
|
684
641
|
- lib/rubocop/cop/style/single_line_block_params.rb
|
685
642
|
- lib/rubocop/cop/style/single_line_methods.rb
|
643
|
+
- lib/rubocop/cop/style/slicing_with_range.rb
|
686
644
|
- lib/rubocop/cop/style/special_global_vars.rb
|
687
645
|
- lib/rubocop/cop/style/stabby_lambda_parentheses.rb
|
688
646
|
- lib/rubocop/cop/style/stderr_puts.rb
|
@@ -701,6 +659,7 @@ files:
|
|
701
659
|
- lib/rubocop/cop/style/trailing_body_on_module.rb
|
702
660
|
- lib/rubocop/cop/style/trailing_comma_in_arguments.rb
|
703
661
|
- lib/rubocop/cop/style/trailing_comma_in_array_literal.rb
|
662
|
+
- lib/rubocop/cop/style/trailing_comma_in_block_args.rb
|
704
663
|
- lib/rubocop/cop/style/trailing_comma_in_hash_literal.rb
|
705
664
|
- lib/rubocop/cop/style/trailing_method_end_statement.rb
|
706
665
|
- lib/rubocop/cop/style/trailing_underscore_variable.rb
|
@@ -727,13 +686,13 @@ files:
|
|
727
686
|
- lib/rubocop/cop/variable_force/variable_table.rb
|
728
687
|
- lib/rubocop/core_ext/string.rb
|
729
688
|
- lib/rubocop/error.rb
|
689
|
+
- lib/rubocop/ext/processed_source.rb
|
730
690
|
- lib/rubocop/file_finder.rb
|
731
691
|
- lib/rubocop/formatter/auto_gen_config_formatter.rb
|
732
692
|
- lib/rubocop/formatter/base_formatter.rb
|
733
693
|
- lib/rubocop/formatter/clang_style_formatter.rb
|
734
694
|
- lib/rubocop/formatter/colorizable.rb
|
735
695
|
- lib/rubocop/formatter/disabled_config_formatter.rb
|
736
|
-
- lib/rubocop/formatter/disabled_lines_formatter.rb
|
737
696
|
- lib/rubocop/formatter/emacs_style_formatter.rb
|
738
697
|
- lib/rubocop/formatter/file_list_formatter.rb
|
739
698
|
- lib/rubocop/formatter/formatter_set.rb
|
@@ -751,11 +710,9 @@ files:
|
|
751
710
|
- lib/rubocop/formatter/worst_offenders_formatter.rb
|
752
711
|
- lib/rubocop/magic_comment.rb
|
753
712
|
- lib/rubocop/name_similarity.rb
|
754
|
-
- lib/rubocop/node_pattern.rb
|
755
713
|
- lib/rubocop/options.rb
|
756
714
|
- lib/rubocop/path_util.rb
|
757
715
|
- lib/rubocop/platform.rb
|
758
|
-
- lib/rubocop/processed_source.rb
|
759
716
|
- lib/rubocop/rake_task.rb
|
760
717
|
- lib/rubocop/remote_config.rb
|
761
718
|
- lib/rubocop/result_cache.rb
|
@@ -766,10 +723,8 @@ files:
|
|
766
723
|
- lib/rubocop/rspec/support.rb
|
767
724
|
- lib/rubocop/runner.rb
|
768
725
|
- lib/rubocop/string_interpreter.rb
|
769
|
-
- lib/rubocop/string_util.rb
|
770
726
|
- lib/rubocop/target_finder.rb
|
771
727
|
- lib/rubocop/target_ruby.rb
|
772
|
-
- lib/rubocop/token.rb
|
773
728
|
- lib/rubocop/version.rb
|
774
729
|
- lib/rubocop/warning.rb
|
775
730
|
- lib/rubocop/yaml_duplication_checker.rb
|
@@ -790,14 +745,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
790
745
|
requirements:
|
791
746
|
- - ">="
|
792
747
|
- !ruby/object:Gem::Version
|
793
|
-
version: 2.
|
748
|
+
version: 2.4.0
|
794
749
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
795
750
|
requirements:
|
796
751
|
- - ">="
|
797
752
|
- !ruby/object:Gem::Version
|
798
753
|
version: '0'
|
799
754
|
requirements: []
|
800
|
-
rubygems_version: 3.
|
755
|
+
rubygems_version: 3.1.2
|
801
756
|
signing_key:
|
802
757
|
specification_version: 4
|
803
758
|
summary: Automatic Ruby code style checking tool.
|