rubocop 1.23.0 → 1.25.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +1 -1
- data/README.md +2 -3
- data/config/default.yml +60 -12
- data/lib/rubocop/cli/command/auto_genenerate_config.rb +1 -1
- data/lib/rubocop/cli/command/init_dotfile.rb +1 -1
- data/lib/rubocop/cli/command/show_docs_url.rb +48 -0
- data/lib/rubocop/cli/command/suggest_extensions.rb +1 -1
- data/lib/rubocop/cli.rb +1 -0
- data/lib/rubocop/config_loader_resolver.rb +1 -1
- data/lib/rubocop/cop/bundler/duplicated_gem.rb +1 -1
- data/lib/rubocop/cop/correctors/each_to_for_corrector.rb +1 -1
- data/lib/rubocop/cop/correctors/if_then_corrector.rb +55 -0
- data/lib/rubocop/cop/documentation.rb +19 -2
- data/lib/rubocop/cop/gemspec/require_mfa.rb +8 -10
- data/lib/rubocop/cop/gemspec/required_ruby_version.rb +10 -3
- data/lib/rubocop/cop/generator.rb +4 -3
- data/lib/rubocop/cop/internal_affairs/redundant_method_dispatch_node.rb +47 -0
- data/lib/rubocop/cop/internal_affairs/undefined_config.rb +3 -1
- data/lib/rubocop/cop/internal_affairs.rb +1 -0
- data/lib/rubocop/cop/layout/argument_alignment.rb +36 -9
- data/lib/rubocop/cop/layout/comment_indentation.rb +31 -2
- data/lib/rubocop/cop/layout/dot_position.rb +4 -0
- data/lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb +5 -1
- data/lib/rubocop/cop/layout/hash_alignment.rb +7 -2
- data/lib/rubocop/cop/layout/rescue_ensure_alignment.rb +1 -1
- data/lib/rubocop/cop/layout/space_after_colon.rb +1 -1
- data/lib/rubocop/cop/layout/space_before_first_arg.rb +4 -0
- data/lib/rubocop/cop/lint/ambiguous_regexp_literal.rb +5 -1
- data/lib/rubocop/cop/lint/constant_definition_in_block.rb +1 -1
- data/lib/rubocop/cop/lint/deprecated_class_methods.rb +16 -4
- data/lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb +6 -0
- data/lib/rubocop/cop/lint/each_with_object_argument.rb +1 -1
- data/lib/rubocop/cop/lint/incompatible_io_select_with_fiber_scheduler.rb +10 -5
- data/lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb +7 -4
- data/lib/rubocop/cop/metrics/block_length.rb +1 -0
- data/lib/rubocop/cop/metrics/cyclomatic_complexity.rb +0 -9
- data/lib/rubocop/cop/metrics/method_length.rb +1 -0
- data/lib/rubocop/cop/metrics/module_length.rb +1 -1
- data/lib/rubocop/cop/metrics/utils/code_length_calculator.rb +1 -1
- data/lib/rubocop/cop/metrics/utils/repeated_attribute_discount.rb +1 -1
- data/lib/rubocop/cop/mixin/enforce_superclass.rb +5 -0
- data/lib/rubocop/cop/mixin/hash_alignment_styles.rb +4 -3
- data/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb +82 -0
- data/lib/rubocop/cop/naming/block_forwarding.rb +121 -0
- data/lib/rubocop/cop/naming/method_parameter_name.rb +1 -1
- data/lib/rubocop/cop/security/open.rb +11 -1
- data/lib/rubocop/cop/style/character_literal.rb +8 -1
- data/lib/rubocop/cop/style/collection_compact.rb +31 -13
- data/lib/rubocop/cop/style/combinable_loops.rb +2 -2
- data/lib/rubocop/cop/style/empty_case_condition.rb +10 -0
- data/lib/rubocop/cop/style/file_read.rb +112 -0
- data/lib/rubocop/cop/style/file_write.rb +124 -0
- data/lib/rubocop/cop/style/hash_conversion.rb +2 -1
- data/lib/rubocop/cop/style/hash_syntax.rb +36 -0
- data/lib/rubocop/cop/style/hash_transform_keys.rb +6 -6
- data/lib/rubocop/cop/style/hash_transform_values.rb +6 -6
- data/lib/rubocop/cop/style/if_inside_else.rb +15 -0
- data/lib/rubocop/cop/style/if_with_boolean_literal_branches.rb +1 -1
- data/lib/rubocop/cop/style/map_to_hash.rb +68 -0
- data/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb +20 -0
- data/lib/rubocop/cop/style/method_call_with_args_parentheses.rb +3 -1
- data/lib/rubocop/cop/style/method_def_parentheses.rb +17 -13
- data/lib/rubocop/cop/style/numeric_literals.rb +10 -1
- data/lib/rubocop/cop/style/one_line_conditional.rb +18 -39
- data/lib/rubocop/cop/style/redundant_begin.rb +2 -6
- data/lib/rubocop/cop/style/redundant_interpolation.rb +17 -3
- data/lib/rubocop/cop/style/redundant_regexp_character_class.rb +5 -1
- data/lib/rubocop/cop/style/redundant_self.rb +1 -1
- data/lib/rubocop/cop/style/safe_navigation.rb +1 -5
- data/lib/rubocop/cop/style/sample.rb +5 -3
- data/lib/rubocop/cop/style/single_line_block_params.rb +2 -2
- data/lib/rubocop/cop/style/sole_nested_conditional.rb +3 -1
- data/lib/rubocop/cop/style/swap_values.rb +2 -0
- data/lib/rubocop/cop/style/ternary_parentheses.rb +16 -2
- data/lib/rubocop/cop/team.rb +1 -1
- data/lib/rubocop/cop/util.rb +9 -1
- data/lib/rubocop/formatter/disabled_config_formatter.rb +16 -2
- data/lib/rubocop/options.rb +6 -1
- data/lib/rubocop/remote_config.rb +1 -3
- data/lib/rubocop/result_cache.rb +1 -1
- data/lib/rubocop/version.rb +1 -1
- data/lib/rubocop.rb +7 -0
- metadata +15 -7
data/lib/rubocop.rb
CHANGED
@@ -94,6 +94,7 @@ require_relative 'rubocop/cop/mixin/line_length_help'
|
|
94
94
|
require_relative 'rubocop/cop/mixin/match_range'
|
95
95
|
require_relative 'rubocop/cop/metrics/utils/repeated_csend_discount'
|
96
96
|
require_relative 'rubocop/cop/metrics/utils/repeated_attribute_discount'
|
97
|
+
require_relative 'rubocop/cop/mixin/hash_shorthand_syntax'
|
97
98
|
require_relative 'rubocop/cop/mixin/method_complexity'
|
98
99
|
require_relative 'rubocop/cop/mixin/method_preference'
|
99
100
|
require_relative 'rubocop/cop/mixin/min_body_length'
|
@@ -139,6 +140,7 @@ require_relative 'rubocop/cop/correctors/condition_corrector'
|
|
139
140
|
require_relative 'rubocop/cop/correctors/each_to_for_corrector'
|
140
141
|
require_relative 'rubocop/cop/correctors/empty_line_corrector'
|
141
142
|
require_relative 'rubocop/cop/correctors/for_to_each_corrector'
|
143
|
+
require_relative 'rubocop/cop/correctors/if_then_corrector'
|
142
144
|
require_relative 'rubocop/cop/correctors/lambda_literal_to_method_corrector'
|
143
145
|
require_relative 'rubocop/cop/correctors/line_break_corrector'
|
144
146
|
require_relative 'rubocop/cop/correctors/multiline_literal_brace_corrector'
|
@@ -405,6 +407,7 @@ require_relative 'rubocop/cop/metrics/perceived_complexity'
|
|
405
407
|
|
406
408
|
require_relative 'rubocop/cop/naming/accessor_method_name'
|
407
409
|
require_relative 'rubocop/cop/naming/ascii_identifiers'
|
410
|
+
require_relative 'rubocop/cop/naming/block_forwarding'
|
408
411
|
require_relative 'rubocop/cop/naming/block_parameter_name'
|
409
412
|
require_relative 'rubocop/cop/naming/class_and_module_camel_case'
|
410
413
|
require_relative 'rubocop/cop/naming/constant_name'
|
@@ -481,6 +484,8 @@ require_relative 'rubocop/cop/style/even_odd'
|
|
481
484
|
require_relative 'rubocop/cop/style/expand_path_arguments'
|
482
485
|
require_relative 'rubocop/cop/style/explicit_block_argument'
|
483
486
|
require_relative 'rubocop/cop/style/exponential_notation'
|
487
|
+
require_relative 'rubocop/cop/style/file_read'
|
488
|
+
require_relative 'rubocop/cop/style/file_write'
|
484
489
|
require_relative 'rubocop/cop/style/float_division'
|
485
490
|
require_relative 'rubocop/cop/style/for'
|
486
491
|
require_relative 'rubocop/cop/style/format_string'
|
@@ -513,6 +518,7 @@ require_relative 'rubocop/cop/style/keyword_parameters_order'
|
|
513
518
|
require_relative 'rubocop/cop/style/lambda'
|
514
519
|
require_relative 'rubocop/cop/style/lambda_call'
|
515
520
|
require_relative 'rubocop/cop/style/line_end_concatenation'
|
521
|
+
require_relative 'rubocop/cop/style/map_to_hash'
|
516
522
|
require_relative 'rubocop/cop/style/method_call_without_args_parentheses'
|
517
523
|
require_relative 'rubocop/cop/style/method_call_with_args_parentheses'
|
518
524
|
require_relative 'rubocop/cop/style/multiline_in_pattern_then'
|
@@ -705,6 +711,7 @@ require_relative 'rubocop/cli/command/auto_genenerate_config'
|
|
705
711
|
require_relative 'rubocop/cli/command/execute_runner'
|
706
712
|
require_relative 'rubocop/cli/command/init_dotfile'
|
707
713
|
require_relative 'rubocop/cli/command/show_cops'
|
714
|
+
require_relative 'rubocop/cli/command/show_docs_url'
|
708
715
|
require_relative 'rubocop/cli/command/suggest_extensions'
|
709
716
|
require_relative 'rubocop/cli/command/version'
|
710
717
|
require_relative 'rubocop/config_regeneration'
|
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: 1.
|
4
|
+
version: 1.25.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bozhidar Batsov
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2022-02-03 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: parallel
|
@@ -32,14 +32,14 @@ dependencies:
|
|
32
32
|
requirements:
|
33
33
|
- - ">="
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: 3.
|
35
|
+
version: 3.1.0.0
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
40
|
- - ">="
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: 3.
|
42
|
+
version: 3.1.0.0
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: rainbow
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,7 +100,7 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 1.
|
103
|
+
version: 1.15.1
|
104
104
|
- - "<"
|
105
105
|
- !ruby/object:Gem::Version
|
106
106
|
version: '2.0'
|
@@ -110,7 +110,7 @@ dependencies:
|
|
110
110
|
requirements:
|
111
111
|
- - ">="
|
112
112
|
- !ruby/object:Gem::Version
|
113
|
-
version: 1.
|
113
|
+
version: 1.15.1
|
114
114
|
- - "<"
|
115
115
|
- !ruby/object:Gem::Version
|
116
116
|
version: '2.0'
|
@@ -196,6 +196,7 @@ files:
|
|
196
196
|
- lib/rubocop/cli/command/execute_runner.rb
|
197
197
|
- lib/rubocop/cli/command/init_dotfile.rb
|
198
198
|
- lib/rubocop/cli/command/show_cops.rb
|
199
|
+
- lib/rubocop/cli/command/show_docs_url.rb
|
199
200
|
- lib/rubocop/cli/command/suggest_extensions.rb
|
200
201
|
- lib/rubocop/cli/command/version.rb
|
201
202
|
- lib/rubocop/cli/environment.rb
|
@@ -233,6 +234,7 @@ files:
|
|
233
234
|
- lib/rubocop/cop/correctors/each_to_for_corrector.rb
|
234
235
|
- lib/rubocop/cop/correctors/empty_line_corrector.rb
|
235
236
|
- lib/rubocop/cop/correctors/for_to_each_corrector.rb
|
237
|
+
- lib/rubocop/cop/correctors/if_then_corrector.rb
|
236
238
|
- lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb
|
237
239
|
- lib/rubocop/cop/correctors/line_break_corrector.rb
|
238
240
|
- lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb
|
@@ -271,6 +273,7 @@ files:
|
|
271
273
|
- lib/rubocop/cop/internal_affairs/redundant_let_rubocop_config_new.rb
|
272
274
|
- lib/rubocop/cop/internal_affairs/redundant_location_argument.rb
|
273
275
|
- lib/rubocop/cop/internal_affairs/redundant_message_argument.rb
|
276
|
+
- lib/rubocop/cop/internal_affairs/redundant_method_dispatch_node.rb
|
274
277
|
- lib/rubocop/cop/internal_affairs/style_detected_api_use.rb
|
275
278
|
- lib/rubocop/cop/internal_affairs/undefined_config.rb
|
276
279
|
- lib/rubocop/cop/internal_affairs/useless_message_assertion.rb
|
@@ -542,6 +545,7 @@ files:
|
|
542
545
|
- lib/rubocop/cop/mixin/gem_declaration.rb
|
543
546
|
- lib/rubocop/cop/mixin/gemspec_help.rb
|
544
547
|
- lib/rubocop/cop/mixin/hash_alignment_styles.rb
|
548
|
+
- lib/rubocop/cop/mixin/hash_shorthand_syntax.rb
|
545
549
|
- lib/rubocop/cop/mixin/hash_transform_method.rb
|
546
550
|
- lib/rubocop/cop/mixin/heredoc.rb
|
547
551
|
- lib/rubocop/cop/mixin/ignored_methods.rb
|
@@ -587,6 +591,7 @@ files:
|
|
587
591
|
- lib/rubocop/cop/naming/accessor_method_name.rb
|
588
592
|
- lib/rubocop/cop/naming/ascii_identifiers.rb
|
589
593
|
- lib/rubocop/cop/naming/binary_operator_parameter_name.rb
|
594
|
+
- lib/rubocop/cop/naming/block_forwarding.rb
|
590
595
|
- lib/rubocop/cop/naming/block_parameter_name.rb
|
591
596
|
- lib/rubocop/cop/naming/class_and_module_camel_case.rb
|
592
597
|
- lib/rubocop/cop/naming/constant_name.rb
|
@@ -671,6 +676,8 @@ files:
|
|
671
676
|
- lib/rubocop/cop/style/expand_path_arguments.rb
|
672
677
|
- lib/rubocop/cop/style/explicit_block_argument.rb
|
673
678
|
- lib/rubocop/cop/style/exponential_notation.rb
|
679
|
+
- lib/rubocop/cop/style/file_read.rb
|
680
|
+
- lib/rubocop/cop/style/file_write.rb
|
674
681
|
- lib/rubocop/cop/style/float_division.rb
|
675
682
|
- lib/rubocop/cop/style/for.rb
|
676
683
|
- lib/rubocop/cop/style/format_string.rb
|
@@ -703,6 +710,7 @@ files:
|
|
703
710
|
- lib/rubocop/cop/style/lambda.rb
|
704
711
|
- lib/rubocop/cop/style/lambda_call.rb
|
705
712
|
- lib/rubocop/cop/style/line_end_concatenation.rb
|
713
|
+
- lib/rubocop/cop/style/map_to_hash.rb
|
706
714
|
- lib/rubocop/cop/style/method_call_with_args_parentheses.rb
|
707
715
|
- lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb
|
708
716
|
- lib/rubocop/cop/style/method_call_with_args_parentheses/require_parentheses.rb
|
@@ -903,7 +911,7 @@ metadata:
|
|
903
911
|
homepage_uri: https://rubocop.org/
|
904
912
|
changelog_uri: https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md
|
905
913
|
source_code_uri: https://github.com/rubocop/rubocop/
|
906
|
-
documentation_uri: https://docs.rubocop.org/rubocop/1.
|
914
|
+
documentation_uri: https://docs.rubocop.org/rubocop/1.25/
|
907
915
|
bug_tracker_uri: https://github.com/rubocop/rubocop/issues
|
908
916
|
rubygems_mfa_required: 'true'
|
909
917
|
post_install_message:
|