rubocop 0.75.1 → 0.76.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 +1 -1
- data/config/default.yml +52 -53
- data/lib/rubocop.rb +10 -9
- data/lib/rubocop/ast/builder.rb +1 -0
- data/lib/rubocop/ast/node.rb +4 -0
- data/lib/rubocop/ast/node/return_node.rb +24 -0
- data/lib/rubocop/cli.rb +7 -4
- data/lib/rubocop/comment_config.rb +2 -2
- data/lib/rubocop/config.rb +7 -0
- data/lib/rubocop/config_loader.rb +1 -1
- data/lib/rubocop/config_loader_resolver.rb +2 -1
- data/lib/rubocop/config_obsoletion.rb +9 -0
- data/lib/rubocop/config_validator.rb +24 -15
- data/lib/rubocop/cop/commissioner.rb +15 -7
- data/lib/rubocop/cop/cop.rb +10 -6
- data/lib/rubocop/cop/corrector.rb +8 -7
- data/lib/rubocop/cop/generator/configuration_injector.rb +1 -1
- data/lib/rubocop/cop/layout/align_hash.rb +6 -2
- data/lib/rubocop/cop/layout/comment_indentation.rb +10 -13
- data/lib/rubocop/cop/layout/empty_comment.rb +7 -16
- data/lib/rubocop/cop/layout/end_of_line.rb +8 -3
- data/lib/rubocop/cop/layout/indent_first_argument.rb +9 -7
- data/lib/rubocop/cop/layout/indent_first_hash_element.rb +1 -1
- data/lib/rubocop/cop/layout/multiline_assignment_layout.rb +1 -1
- data/lib/rubocop/cop/layout/rescue_ensure_alignment.rb +2 -0
- data/lib/rubocop/cop/layout/space_in_lambda_literal.rb +9 -7
- data/lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb +7 -4
- data/lib/rubocop/cop/layout/space_inside_parens.rb +6 -6
- data/lib/rubocop/cop/layout/trailing_whitespace.rb +18 -2
- data/lib/rubocop/cop/lint/erb_new_arguments.rb +9 -8
- data/lib/rubocop/cop/lint/missing_cop_enable_directive.rb +2 -2
- data/lib/rubocop/cop/lint/{unneeded_cop_disable_directive.rb → redundant_cop_disable_directive.rb} +23 -23
- data/lib/rubocop/cop/lint/{unneeded_cop_enable_directive.rb → redundant_cop_enable_directive.rb} +6 -8
- data/lib/rubocop/cop/lint/{unneeded_require_statement.rb → redundant_require_statement.rb} +1 -1
- data/lib/rubocop/cop/lint/{unneeded_splat_expansion.rb → redundant_splat_expansion.rb} +5 -5
- data/lib/rubocop/cop/lint/safe_navigation_chain.rb +5 -6
- data/lib/rubocop/cop/lint/void.rb +4 -4
- data/lib/rubocop/cop/metrics/abc_size.rb +1 -1
- data/lib/rubocop/cop/metrics/line_length.rb +1 -4
- data/lib/rubocop/cop/metrics/utils/abc_size_calculator.rb +23 -6
- data/lib/rubocop/cop/mixin/method_complexity.rb +2 -1
- data/lib/rubocop/cop/mixin/statement_modifier.rb +5 -2
- data/lib/rubocop/cop/mixin/trailing_comma.rb +8 -6
- data/lib/rubocop/cop/naming/file_name.rb +12 -5
- data/lib/rubocop/cop/registry.rb +1 -1
- data/lib/rubocop/cop/style/attr.rb +2 -2
- data/lib/rubocop/cop/style/braces_around_hash_parameters.rb +6 -6
- data/lib/rubocop/cop/style/comment_annotation.rb +5 -5
- data/lib/rubocop/cop/style/copyright.rb +11 -7
- data/lib/rubocop/cop/style/double_cop_disable_directive.rb +2 -2
- data/lib/rubocop/cop/style/empty_case_condition.rb +2 -2
- data/lib/rubocop/cop/style/empty_literal.rb +2 -2
- data/lib/rubocop/cop/style/empty_method.rb +5 -5
- data/lib/rubocop/cop/style/format_string.rb +10 -7
- data/lib/rubocop/cop/style/format_string_token.rb +2 -0
- data/lib/rubocop/cop/style/frozen_string_literal_comment.rb +10 -0
- data/lib/rubocop/cop/style/hash_syntax.rb +2 -2
- data/lib/rubocop/cop/style/if_unless_modifier.rb +9 -2
- data/lib/rubocop/cop/style/infinite_loop.rb +4 -3
- data/lib/rubocop/cop/style/inverse_methods.rb +19 -13
- data/lib/rubocop/cop/style/line_end_concatenation.rb +14 -10
- data/lib/rubocop/cop/style/method_def_parentheses.rb +17 -9
- data/lib/rubocop/cop/style/multiline_when_then.rb +1 -1
- data/lib/rubocop/cop/style/nested_modifier.rb +4 -2
- data/lib/rubocop/cop/style/non_nil_check.rb +21 -9
- data/lib/rubocop/cop/style/{unneeded_capital_w.rb → redundant_capital_w.rb} +1 -1
- data/lib/rubocop/cop/style/{unneeded_condition.rb → redundant_condition.rb} +3 -3
- data/lib/rubocop/cop/style/{unneeded_interpolation.rb → redundant_interpolation.rb} +1 -1
- data/lib/rubocop/cop/style/{unneeded_percent_q.rb → redundant_percent_q.rb} +1 -1
- data/lib/rubocop/cop/style/redundant_return.rb +25 -21
- data/lib/rubocop/cop/style/{unneeded_sort.rb → redundant_sort.rb} +4 -4
- data/lib/rubocop/cop/style/safe_navigation.rb +13 -10
- data/lib/rubocop/cop/style/semicolon.rb +2 -2
- data/lib/rubocop/cop/style/special_global_vars.rb +5 -7
- data/lib/rubocop/cop/util.rb +1 -1
- data/lib/rubocop/cop/utils/format_string.rb +10 -18
- data/lib/rubocop/cop/variable_force.rb +7 -5
- data/lib/rubocop/node_pattern.rb +3 -1
- data/lib/rubocop/options.rb +12 -6
- data/lib/rubocop/result_cache.rb +1 -1
- data/lib/rubocop/runner.rb +32 -27
- data/lib/rubocop/target_finder.rb +12 -6
- data/lib/rubocop/version.rb +1 -1
- metadata +12 -11
@@ -65,12 +65,7 @@ module RuboCop
|
|
65
65
|
to_inspect?(file, hidden_files, base_dir_config)
|
66
66
|
end
|
67
67
|
|
68
|
-
|
69
|
-
# Most recently modified file first.
|
70
|
-
target_files.sort_by! { |path| -Integer(File.mtime(path)) }
|
71
|
-
else
|
72
|
-
target_files.sort!
|
73
|
-
end
|
68
|
+
target_files.sort_by!(&order)
|
74
69
|
end
|
75
70
|
|
76
71
|
def to_inspect?(file, hidden_files, base_dir_config)
|
@@ -186,5 +181,16 @@ module RuboCop
|
|
186
181
|
config.file_to_exclude?(file)
|
187
182
|
end
|
188
183
|
end
|
184
|
+
|
185
|
+
private
|
186
|
+
|
187
|
+
def order
|
188
|
+
if fail_fast?
|
189
|
+
# Most recently modified file first.
|
190
|
+
->(path) { -Integer(File.mtime(path)) }
|
191
|
+
else
|
192
|
+
:itself
|
193
|
+
end
|
194
|
+
end
|
189
195
|
end
|
190
196
|
end
|
data/lib/rubocop/version.rb
CHANGED
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.76.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: 2019-10-
|
13
|
+
date: 2019-10-28 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: jaro_winkler
|
@@ -185,6 +185,7 @@ files:
|
|
185
185
|
- lib/rubocop/ast/node/regexp_node.rb
|
186
186
|
- lib/rubocop/ast/node/resbody_node.rb
|
187
187
|
- lib/rubocop/ast/node/retry_node.rb
|
188
|
+
- lib/rubocop/ast/node/return_node.rb
|
188
189
|
- lib/rubocop/ast/node/self_class_node.rb
|
189
190
|
- lib/rubocop/ast/node/send_node.rb
|
190
191
|
- lib/rubocop/ast/node/str_node.rb
|
@@ -378,6 +379,10 @@ files:
|
|
378
379
|
- lib/rubocop/cop/lint/percent_string_array.rb
|
379
380
|
- lib/rubocop/cop/lint/percent_symbol_array.rb
|
380
381
|
- lib/rubocop/cop/lint/rand_one.rb
|
382
|
+
- lib/rubocop/cop/lint/redundant_cop_disable_directive.rb
|
383
|
+
- lib/rubocop/cop/lint/redundant_cop_enable_directive.rb
|
384
|
+
- lib/rubocop/cop/lint/redundant_require_statement.rb
|
385
|
+
- lib/rubocop/cop/lint/redundant_splat_expansion.rb
|
381
386
|
- lib/rubocop/cop/lint/redundant_with_index.rb
|
382
387
|
- lib/rubocop/cop/lint/redundant_with_object.rb
|
383
388
|
- lib/rubocop/cop/lint/regexp_as_condition.rb
|
@@ -398,10 +403,6 @@ files:
|
|
398
403
|
- lib/rubocop/cop/lint/to_json.rb
|
399
404
|
- lib/rubocop/cop/lint/underscore_prefixed_variable_name.rb
|
400
405
|
- lib/rubocop/cop/lint/unified_integer.rb
|
401
|
-
- lib/rubocop/cop/lint/unneeded_cop_disable_directive.rb
|
402
|
-
- lib/rubocop/cop/lint/unneeded_cop_enable_directive.rb
|
403
|
-
- lib/rubocop/cop/lint/unneeded_require_statement.rb
|
404
|
-
- lib/rubocop/cop/lint/unneeded_splat_expansion.rb
|
405
406
|
- lib/rubocop/cop/lint/unreachable_code.rb
|
406
407
|
- lib/rubocop/cop/lint/unused_block_argument.rb
|
407
408
|
- lib/rubocop/cop/lint/unused_method_argument.rb
|
@@ -627,12 +628,17 @@ files:
|
|
627
628
|
- lib/rubocop/cop/style/raise_args.rb
|
628
629
|
- lib/rubocop/cop/style/random_with_offset.rb
|
629
630
|
- lib/rubocop/cop/style/redundant_begin.rb
|
631
|
+
- lib/rubocop/cop/style/redundant_capital_w.rb
|
632
|
+
- lib/rubocop/cop/style/redundant_condition.rb
|
630
633
|
- lib/rubocop/cop/style/redundant_conditional.rb
|
631
634
|
- lib/rubocop/cop/style/redundant_exception.rb
|
632
635
|
- lib/rubocop/cop/style/redundant_freeze.rb
|
636
|
+
- lib/rubocop/cop/style/redundant_interpolation.rb
|
633
637
|
- lib/rubocop/cop/style/redundant_parentheses.rb
|
638
|
+
- lib/rubocop/cop/style/redundant_percent_q.rb
|
634
639
|
- lib/rubocop/cop/style/redundant_return.rb
|
635
640
|
- lib/rubocop/cop/style/redundant_self.rb
|
641
|
+
- lib/rubocop/cop/style/redundant_sort.rb
|
636
642
|
- lib/rubocop/cop/style/redundant_sort_by.rb
|
637
643
|
- lib/rubocop/cop/style/regexp_literal.rb
|
638
644
|
- lib/rubocop/cop/style/rescue_modifier.rb
|
@@ -669,11 +675,6 @@ files:
|
|
669
675
|
- lib/rubocop/cop/style/trailing_underscore_variable.rb
|
670
676
|
- lib/rubocop/cop/style/trivial_accessors.rb
|
671
677
|
- lib/rubocop/cop/style/unless_else.rb
|
672
|
-
- lib/rubocop/cop/style/unneeded_capital_w.rb
|
673
|
-
- lib/rubocop/cop/style/unneeded_condition.rb
|
674
|
-
- lib/rubocop/cop/style/unneeded_interpolation.rb
|
675
|
-
- lib/rubocop/cop/style/unneeded_percent_q.rb
|
676
|
-
- lib/rubocop/cop/style/unneeded_sort.rb
|
677
678
|
- lib/rubocop/cop/style/unpack_first.rb
|
678
679
|
- lib/rubocop/cop/style/variable_interpolation.rb
|
679
680
|
- lib/rubocop/cop/style/when_then.rb
|