rubocop 1.48.0 → 1.50.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/config/default.yml +22 -7
  4. data/lib/rubocop/cli/command/execute_runner.rb +7 -2
  5. data/lib/rubocop/cli.rb +6 -6
  6. data/lib/rubocop/config.rb +3 -3
  7. data/lib/rubocop/config_loader.rb +8 -8
  8. data/lib/rubocop/cop/autocorrect_logic.rb +28 -12
  9. data/lib/rubocop/cop/cop.rb +2 -2
  10. data/lib/rubocop/cop/correctors/parentheses_corrector.rb +1 -1
  11. data/lib/rubocop/cop/correctors/percent_literal_corrector.rb +2 -2
  12. data/lib/rubocop/cop/gemspec/dependency_version.rb +1 -1
  13. data/lib/rubocop/cop/gemspec/deprecated_attribute_assignment.rb +1 -1
  14. data/lib/rubocop/cop/internal_affairs/cop_description.rb +1 -1
  15. data/lib/rubocop/cop/internal_affairs/example_heredoc_delimiter.rb +2 -2
  16. data/lib/rubocop/cop/internal_affairs/inherit_deprecated_cop_class.rb +1 -1
  17. data/lib/rubocop/cop/internal_affairs/redundant_source_range.rb +29 -2
  18. data/lib/rubocop/cop/layout/block_end_newline.rb +7 -21
  19. data/lib/rubocop/cop/layout/class_structure.rb +1 -0
  20. data/lib/rubocop/cop/layout/empty_comment.rb +1 -1
  21. data/lib/rubocop/cop/layout/empty_lines.rb +1 -1
  22. data/lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb +2 -0
  23. data/lib/rubocop/cop/layout/end_alignment.rb +5 -1
  24. data/lib/rubocop/cop/layout/extra_spacing.rb +6 -1
  25. data/lib/rubocop/cop/layout/first_argument_indentation.rb +6 -1
  26. data/lib/rubocop/cop/layout/first_array_element_line_break.rb +25 -34
  27. data/lib/rubocop/cop/layout/first_hash_element_line_break.rb +7 -19
  28. data/lib/rubocop/cop/layout/first_method_argument_line_break.rb +42 -52
  29. data/lib/rubocop/cop/layout/first_method_parameter_line_break.rb +38 -55
  30. data/lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb +2 -2
  31. data/lib/rubocop/cop/layout/initial_indentation.rb +1 -1
  32. data/lib/rubocop/cop/layout/multiline_array_line_breaks.rb +8 -27
  33. data/lib/rubocop/cop/layout/multiline_hash_key_line_breaks.rb +7 -26
  34. data/lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb +4 -21
  35. data/lib/rubocop/cop/layout/multiline_method_parameter_line_breaks.rb +6 -30
  36. data/lib/rubocop/cop/layout/redundant_line_break.rb +6 -7
  37. data/lib/rubocop/cop/layout/space_before_first_arg.rb +1 -1
  38. data/lib/rubocop/cop/layout/space_inside_parens.rb +2 -2
  39. data/lib/rubocop/cop/lint/deprecated_class_methods.rb +3 -3
  40. data/lib/rubocop/cop/lint/duplicate_match_pattern.rb +122 -0
  41. data/lib/rubocop/cop/lint/empty_interpolation.rb +1 -1
  42. data/lib/rubocop/cop/lint/nested_method_definition.rb +2 -2
  43. data/lib/rubocop/cop/lint/redundant_cop_disable_directive.rb +1 -1
  44. data/lib/rubocop/cop/lint/redundant_string_coercion.rb +35 -15
  45. data/lib/rubocop/cop/lint/syntax.rb +4 -0
  46. data/lib/rubocop/cop/lint/to_enum_arguments.rb +7 -1
  47. data/lib/rubocop/cop/lint/unreachable_loop.rb +3 -3
  48. data/lib/rubocop/cop/lint/useless_method_definition.rb +10 -2
  49. data/lib/rubocop/cop/lint/useless_rescue.rb +4 -1
  50. data/lib/rubocop/cop/lint/void.rb +7 -3
  51. data/lib/rubocop/cop/metrics/block_nesting.rb +1 -1
  52. data/lib/rubocop/cop/metrics/class_length.rb +1 -0
  53. data/lib/rubocop/cop/metrics/utils/code_length_calculator.rb +1 -1
  54. data/lib/rubocop/cop/mixin/comments_help.rb +1 -1
  55. data/lib/rubocop/cop/mixin/hash_shorthand_syntax.rb +1 -0
  56. data/lib/rubocop/cop/mixin/hash_transform_method.rb +1 -1
  57. data/lib/rubocop/cop/mixin/statement_modifier.rb +1 -1
  58. data/lib/rubocop/cop/naming/ascii_identifiers.rb +1 -1
  59. data/lib/rubocop/cop/naming/inclusive_language.rb +23 -4
  60. data/lib/rubocop/cop/naming/method_name.rb +2 -2
  61. data/lib/rubocop/cop/style/accessor_grouping.rb +4 -4
  62. data/lib/rubocop/cop/style/class_and_module_children.rb +1 -1
  63. data/lib/rubocop/cop/style/class_equality_comparison.rb +42 -9
  64. data/lib/rubocop/cop/style/collection_compact.rb +3 -0
  65. data/lib/rubocop/cop/style/copyright.rb +1 -1
  66. data/lib/rubocop/cop/style/data_inheritance.rb +75 -0
  67. data/lib/rubocop/cop/style/disable_cops_within_source_code_directive.rb +2 -2
  68. data/lib/rubocop/cop/style/document_dynamic_eval_definition.rb +1 -1
  69. data/lib/rubocop/cop/style/double_negation.rb +2 -2
  70. data/lib/rubocop/cop/style/file_empty.rb +3 -3
  71. data/lib/rubocop/cop/style/frozen_string_literal_comment.rb +1 -1
  72. data/lib/rubocop/cop/style/hash_except.rb +4 -4
  73. data/lib/rubocop/cop/style/hash_syntax.rb +4 -1
  74. data/lib/rubocop/cop/style/if_unless_modifier.rb +38 -12
  75. data/lib/rubocop/cop/style/map_to_hash.rb +4 -1
  76. data/lib/rubocop/cop/style/map_to_set.rb +4 -1
  77. data/lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb +3 -7
  78. data/lib/rubocop/cop/style/method_call_with_args_parentheses.rb +43 -36
  79. data/lib/rubocop/cop/style/multiline_method_signature.rb +6 -3
  80. data/lib/rubocop/cop/style/parallel_assignment.rb +26 -18
  81. data/lib/rubocop/cop/style/percent_literal_delimiters.rb +2 -3
  82. data/lib/rubocop/cop/style/percent_q_literals.rb +1 -1
  83. data/lib/rubocop/cop/style/redundant_fetch_block.rb +6 -4
  84. data/lib/rubocop/cop/style/redundant_line_continuation.rb +179 -0
  85. data/lib/rubocop/cop/style/redundant_parentheses.rb +1 -1
  86. data/lib/rubocop/cop/style/redundant_percent_q.rb +1 -1
  87. data/lib/rubocop/cop/style/redundant_regexp_character_class.rb +2 -2
  88. data/lib/rubocop/cop/style/redundant_regexp_escape.rb +1 -1
  89. data/lib/rubocop/cop/style/redundant_string_escape.rb +2 -3
  90. data/lib/rubocop/cop/style/sole_nested_conditional.rb +2 -2
  91. data/lib/rubocop/cop/style/struct_inheritance.rb +1 -1
  92. data/lib/rubocop/cop/style/trailing_body_on_class.rb +1 -0
  93. data/lib/rubocop/cop/style/trivial_accessors.rb +1 -1
  94. data/lib/rubocop/cop/style/unless_logical_operators.rb +1 -0
  95. data/lib/rubocop/cops_documentation_generator.rb +10 -3
  96. data/lib/rubocop/ext/regexp_node.rb +1 -1
  97. data/lib/rubocop/ext/regexp_parser.rb +1 -1
  98. data/lib/rubocop/formatter/simple_text_formatter.rb +1 -1
  99. data/lib/rubocop/options.rb +4 -1
  100. data/lib/rubocop/result_cache.rb +1 -1
  101. data/lib/rubocop/rspec/support.rb +1 -0
  102. data/lib/rubocop/server/cache.rb +1 -1
  103. data/lib/rubocop/server/helper.rb +1 -1
  104. data/lib/rubocop/server/server_command/exec.rb +1 -1
  105. data/lib/rubocop/version.rb +1 -1
  106. data/lib/rubocop.rb +3 -0
  107. metadata +12 -9
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.48.0
4
+ version: 1.50.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bozhidar Batsov
8
8
  - Jonas Arvidsson
9
9
  - Yuji Nakayama
10
- autorequire:
10
+ autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2023-03-06 00:00:00.000000000 Z
13
+ date: 2023-04-17 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: json
@@ -120,7 +120,7 @@ dependencies:
120
120
  requirements:
121
121
  - - ">="
122
122
  - !ruby/object:Gem::Version
123
- version: 1.26.0
123
+ version: 1.28.0
124
124
  - - "<"
125
125
  - !ruby/object:Gem::Version
126
126
  version: '2.0'
@@ -130,7 +130,7 @@ dependencies:
130
130
  requirements:
131
131
  - - ">="
132
132
  - !ruby/object:Gem::Version
133
- version: 1.26.0
133
+ version: 1.28.0
134
134
  - - "<"
135
135
  - !ruby/object:Gem::Version
136
136
  version: '2.0'
@@ -420,6 +420,7 @@ files:
420
420
  - lib/rubocop/cop/lint/duplicate_elsif_condition.rb
421
421
  - lib/rubocop/cop/lint/duplicate_hash_key.rb
422
422
  - lib/rubocop/cop/lint/duplicate_magic_comment.rb
423
+ - lib/rubocop/cop/lint/duplicate_match_pattern.rb
423
424
  - lib/rubocop/cop/lint/duplicate_methods.rb
424
425
  - lib/rubocop/cop/lint/duplicate_regexp_character_class_element.rb
425
426
  - lib/rubocop/cop/lint/duplicate_require.rb
@@ -683,6 +684,7 @@ files:
683
684
  - lib/rubocop/cop/style/conditional_assignment.rb
684
685
  - lib/rubocop/cop/style/constant_visibility.rb
685
686
  - lib/rubocop/cop/style/copyright.rb
687
+ - lib/rubocop/cop/style/data_inheritance.rb
686
688
  - lib/rubocop/cop/style/date_time.rb
687
689
  - lib/rubocop/cop/style/def_with_parentheses.rb
688
690
  - lib/rubocop/cop/style/dir.rb
@@ -827,6 +829,7 @@ files:
827
829
  - lib/rubocop/cop/style/redundant_heredoc_delimiter_quotes.rb
828
830
  - lib/rubocop/cop/style/redundant_initialize.rb
829
831
  - lib/rubocop/cop/style/redundant_interpolation.rb
832
+ - lib/rubocop/cop/style/redundant_line_continuation.rb
830
833
  - lib/rubocop/cop/style/redundant_parentheses.rb
831
834
  - lib/rubocop/cop/style/redundant_percent_q.rb
832
835
  - lib/rubocop/cop/style/redundant_regexp_character_class.rb
@@ -988,10 +991,10 @@ metadata:
988
991
  homepage_uri: https://rubocop.org/
989
992
  changelog_uri: https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md
990
993
  source_code_uri: https://github.com/rubocop/rubocop/
991
- documentation_uri: https://docs.rubocop.org/rubocop/1.48/
994
+ documentation_uri: https://docs.rubocop.org/rubocop/1.50/
992
995
  bug_tracker_uri: https://github.com/rubocop/rubocop/issues
993
996
  rubygems_mfa_required: 'true'
994
- post_install_message:
997
+ post_install_message:
995
998
  rdoc_options: []
996
999
  require_paths:
997
1000
  - lib
@@ -1006,8 +1009,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1006
1009
  - !ruby/object:Gem::Version
1007
1010
  version: '0'
1008
1011
  requirements: []
1009
- rubygems_version: 3.3.7
1010
- signing_key:
1012
+ rubygems_version: 3.4.6
1013
+ signing_key:
1011
1014
  specification_version: 4
1012
1015
  summary: Automatic Ruby code style checking tool.
1013
1016
  test_files: []