rubocop 0.76.0 → 0.77.0

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 (81) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/config/default.yml +252 -239
  4. data/lib/rubocop.rb +27 -20
  5. data/lib/rubocop/ast/node.rb +1 -1
  6. data/lib/rubocop/ast/node/block_node.rb +2 -0
  7. data/lib/rubocop/cli.rb +11 -230
  8. data/lib/rubocop/cli/command.rb +21 -0
  9. data/lib/rubocop/cli/command/auto_genenerate_config.rb +105 -0
  10. data/lib/rubocop/cli/command/base.rb +33 -0
  11. data/lib/rubocop/cli/command/execute_runner.rb +76 -0
  12. data/lib/rubocop/cli/command/init_dotfile.rb +45 -0
  13. data/lib/rubocop/cli/command/show_cops.rb +73 -0
  14. data/lib/rubocop/cli/command/version.rb +17 -0
  15. data/lib/rubocop/cli/environment.rb +21 -0
  16. data/lib/rubocop/config_obsoletion.rb +62 -9
  17. data/lib/rubocop/config_validator.rb +1 -3
  18. data/lib/rubocop/cop/bundler/gem_comment.rb +4 -4
  19. data/lib/rubocop/cop/cop.rb +19 -0
  20. data/lib/rubocop/cop/correctors/space_corrector.rb +1 -2
  21. data/lib/rubocop/cop/internal_affairs.rb +1 -0
  22. data/lib/rubocop/cop/internal_affairs/method_name_equal.rb +59 -0
  23. data/lib/rubocop/cop/layout/{align_arguments.rb → argument_alignment.rb} +1 -1
  24. data/lib/rubocop/cop/layout/{align_array.rb → array_alignment.rb} +1 -1
  25. data/lib/rubocop/cop/layout/{indent_assignment.rb → assignment_indentation.rb} +1 -1
  26. data/lib/rubocop/cop/layout/extra_spacing.rb +1 -1
  27. data/lib/rubocop/cop/layout/{indent_first_argument.rb → first_argument_indentation.rb} +3 -3
  28. data/lib/rubocop/cop/layout/{indent_first_array_element.rb → first_array_element_indentation.rb} +4 -4
  29. data/lib/rubocop/cop/layout/{indent_first_hash_element.rb → first_hash_element_indentation.rb} +3 -3
  30. data/lib/rubocop/cop/layout/{indent_first_parameter.rb → first_parameter_indentation.rb} +3 -3
  31. data/lib/rubocop/cop/layout/{align_hash.rb → hash_alignment.rb} +2 -2
  32. data/lib/rubocop/cop/layout/{indent_heredoc.rb → heredoc_indentation.rb} +1 -1
  33. data/lib/rubocop/cop/layout/{leading_blank_lines.rb → leading_empty_lines.rb} +1 -1
  34. data/lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb +1 -1
  35. data/lib/rubocop/cop/layout/{align_parameters.rb → parameter_alignment.rb} +1 -1
  36. data/lib/rubocop/cop/layout/space_around_keyword.rb +12 -0
  37. data/lib/rubocop/cop/layout/space_around_operators.rb +1 -1
  38. data/lib/rubocop/cop/layout/{trailing_blank_lines.rb → trailing_empty_lines.rb} +1 -1
  39. data/lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb +1 -1
  40. data/lib/rubocop/cop/lint/{duplicated_key.rb → duplicate_hash_key.rb} +1 -1
  41. data/lib/rubocop/cop/lint/ineffective_access_modifier.rb +1 -1
  42. data/lib/rubocop/cop/lint/{multiple_compare.rb → multiple_comparison.rb} +1 -1
  43. data/lib/rubocop/cop/lint/redundant_splat_expansion.rb +1 -1
  44. data/lib/rubocop/cop/lint/{string_conversion_in_interpolation.rb → redundant_string_coercion.rb} +1 -1
  45. data/lib/rubocop/cop/lint/redundant_with_index.rb +2 -2
  46. data/lib/rubocop/cop/lint/redundant_with_object.rb +2 -2
  47. data/lib/rubocop/cop/lint/{handle_exceptions.rb → suppressed_exception.rb} +1 -1
  48. data/lib/rubocop/cop/lint/useless_access_modifier.rb +57 -23
  49. data/lib/rubocop/cop/lint/useless_setter_call.rb +1 -1
  50. data/lib/rubocop/cop/metrics/line_length.rb +41 -38
  51. data/lib/rubocop/cop/metrics/method_length.rb +1 -1
  52. data/lib/rubocop/cop/mixin/{hash_alignment.rb → hash_alignment_styles.rb} +1 -1
  53. data/lib/rubocop/cop/mixin/nil_methods.rb +4 -4
  54. data/lib/rubocop/cop/naming/{uncommunicative_block_param_name.rb → block_parameter_name.rb} +3 -3
  55. data/lib/rubocop/cop/naming/heredoc_delimiter_naming.rb +5 -5
  56. data/lib/rubocop/cop/naming/{uncommunicative_method_param_name.rb → method_parameter_name.rb} +3 -3
  57. data/lib/rubocop/cop/naming/predicate_name.rb +6 -6
  58. data/lib/rubocop/cop/style/alias.rb +1 -1
  59. data/lib/rubocop/cop/style/array_join.rb +1 -1
  60. data/lib/rubocop/cop/style/eval_with_location.rb +1 -1
  61. data/lib/rubocop/cop/style/even_odd.rb +1 -1
  62. data/lib/rubocop/cop/style/ip_addresses.rb +4 -4
  63. data/lib/rubocop/cop/style/mixin_grouping.rb +1 -1
  64. data/lib/rubocop/cop/style/nested_parenthesized_calls.rb +5 -5
  65. data/lib/rubocop/cop/style/next.rb +5 -5
  66. data/lib/rubocop/cop/style/numeric_literals.rb +7 -3
  67. data/lib/rubocop/cop/style/option_hash.rb +3 -3
  68. data/lib/rubocop/cop/style/redundant_parentheses.rb +3 -3
  69. data/lib/rubocop/cop/style/redundant_return.rb +2 -8
  70. data/lib/rubocop/cop/style/redundant_sort.rb +1 -1
  71. data/lib/rubocop/cop/style/trivial_accessors.rb +5 -5
  72. data/lib/rubocop/cop/team.rb +5 -0
  73. data/lib/rubocop/formatter/clang_style_formatter.rb +1 -3
  74. data/lib/rubocop/formatter/tap_formatter.rb +1 -3
  75. data/lib/rubocop/processed_source.rb +1 -1
  76. data/lib/rubocop/rake_task.rb +1 -0
  77. data/lib/rubocop/result_cache.rb +21 -7
  78. data/lib/rubocop/runner.rb +13 -1
  79. data/lib/rubocop/version.rb +1 -1
  80. metadata +30 -22
  81. data/lib/rubocop/cop/mixin/safe_mode.rb +0 -24
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bd5622915d19930481b80ac553a18b3500306bca922491f83290451a3cd267c9
4
- data.tar.gz: 73002e0e186887f12add4e88154bf2510280d531ecd66f73b9eb57fb842d7f2a
3
+ metadata.gz: 8789393bf78c1ae637e196f15a3b312a261b8239996ce92bcd99670ab358bea0
4
+ data.tar.gz: 6b1e83fe89bcd3e003ea5f95307d212b3e5adce496ddc26dfe6ff92ea4dc3356
5
5
  SHA512:
6
- metadata.gz: 7a866f9130e0388351acd83aee37bf7a15f1e64c94c51a3d58f3c439b90cbffb5a173837b48aae3ba86ab8005bbe73e6b088c905000910c4cf523395c8887b39
7
- data.tar.gz: e8c2655aa3c419850da067790d456ed96c67bb43eee41d4cd9389185dbb9965329f405a2146949062daf57cd15a8e0d375b00df4df09fbc03fd06d9369f213ce
6
+ metadata.gz: d0a92b3b466939337e7d100d255a9c08ff7db25c235c3645ad65e878151899000749a5e20b01eda2be3ec7e4384272cfed2dce12053dd87df4b01be83453c3d9
7
+ data.tar.gz: d646dad7e86dcacd75a286f70c2843934acb9a7416a40edec51fa373d9f0b3da05f74eac21ad869c24b92b550e2efb66cdf0229dc6ef2fb772edc7a7a6ee5107
data/README.md CHANGED
@@ -53,7 +53,7 @@ haven't reached version 1.0 yet). To prevent an unwanted RuboCop update you
53
53
  might want to use a conservative version lock in your `Gemfile`:
54
54
 
55
55
  ```rb
56
- gem 'rubocop', '~> 0.76.0', require: false
56
+ gem 'rubocop', '~> 0.77.0', require: false
57
57
  ```
58
58
 
59
59
  ## Quickstart
@@ -74,7 +74,7 @@ You can read a lot more about RuboCop in its [official docs](https://docs.ruboco
74
74
  RuboCop supports the following Ruby implementations:
75
75
 
76
76
  * MRI 2.3+
77
- * JRuby 9.1+
77
+ * JRuby 9.2+
78
78
 
79
79
  ## Team
80
80
 
@@ -141,11 +141,12 @@ Bundler/GemComment:
141
141
  Description: 'Add a comment describing each gem.'
142
142
  Enabled: false
143
143
  VersionAdded: '0.59'
144
+ VersionChanged: '0.77'
144
145
  Include:
145
146
  - '**/*.gemfile'
146
147
  - '**/Gemfile'
147
148
  - '**/gems.rb'
148
- Whitelist: []
149
+ IgnoredGems: []
149
150
 
150
151
  Bundler/InsecureProtocolSource:
151
152
  Description: >-
@@ -218,13 +219,14 @@ Layout/AccessModifierIndentation:
218
219
  # But it can be overridden by setting this parameter
219
220
  IndentationWidth: ~
220
221
 
221
- Layout/AlignArguments:
222
+ Layout/ArgumentAlignment:
222
223
  Description: >-
223
224
  Align the arguments of a method call if they span more
224
225
  than one line.
225
226
  StyleGuide: '#no-double-indent'
226
227
  Enabled: true
227
228
  VersionAdded: '0.68'
229
+ VersionChanged: '0.77'
228
230
  # Alignment of arguments in multi-line method calls.
229
231
  #
230
232
  # The `with_first_argument` style aligns the following lines along the same
@@ -246,117 +248,23 @@ Layout/AlignArguments:
246
248
  # But it can be overridden by setting this parameter
247
249
  IndentationWidth: ~
248
250
 
249
- Layout/AlignArray:
251
+ Layout/ArrayAlignment:
250
252
  Description: >-
251
253
  Align the elements of an array literal if they span more than
252
254
  one line.
253
255
  StyleGuide: '#align-multiline-arrays'
254
256
  Enabled: true
255
257
  VersionAdded: '0.49'
258
+ VersionChanged: '0.77'
256
259
 
257
- Layout/AlignHash:
260
+ Layout/AssignmentIndentation:
258
261
  Description: >-
259
- Align the elements of a hash literal if they span more than
260
- one line.
262
+ Checks the indentation of the first line of the
263
+ right-hand-side of a multi-line assignment.
261
264
  Enabled: true
262
- AllowMultipleStyles: true
263
265
  VersionAdded: '0.49'
264
- # Alignment of entries using hash rocket as separator. Valid values are:
265
- #
266
- # key - left alignment of keys
267
- # 'a' => 2
268
- # 'bb' => 3
269
- # separator - alignment of hash rockets, keys are right aligned
270
- # 'a' => 2
271
- # 'bb' => 3
272
- # table - left alignment of keys, hash rockets, and values
273
- # 'a' => 2
274
- # 'bb' => 3
275
- EnforcedHashRocketStyle: key
276
- SupportedHashRocketStyles:
277
- - key
278
- - separator
279
- - table
280
- # Alignment of entries using colon as separator. Valid values are:
281
- #
282
- # key - left alignment of keys
283
- # a: 0
284
- # bb: 1
285
- # separator - alignment of colons, keys are right aligned
286
- # a: 0
287
- # bb: 1
288
- # table - left alignment of keys and values
289
- # a: 0
290
- # bb: 1
291
- EnforcedColonStyle: key
292
- SupportedColonStyles:
293
- - key
294
- - separator
295
- - table
296
- # Select whether hashes that are the last argument in a method call should be
297
- # inspected? Valid values are:
298
- #
299
- # always_inspect - Inspect both implicit and explicit hashes.
300
- # Registers an offense for:
301
- # function(a: 1,
302
- # b: 2)
303
- # Registers an offense for:
304
- # function({a: 1,
305
- # b: 2})
306
- # always_ignore - Ignore both implicit and explicit hashes.
307
- # Accepts:
308
- # function(a: 1,
309
- # b: 2)
310
- # Accepts:
311
- # function({a: 1,
312
- # b: 2})
313
- # ignore_implicit - Ignore only implicit hashes.
314
- # Accepts:
315
- # function(a: 1,
316
- # b: 2)
317
- # Registers an offense for:
318
- # function({a: 1,
319
- # b: 2})
320
- # ignore_explicit - Ignore only explicit hashes.
321
- # Accepts:
322
- # function({a: 1,
323
- # b: 2})
324
- # Registers an offense for:
325
- # function(a: 1,
326
- # b: 2)
327
- EnforcedLastArgumentHashStyle: always_inspect
328
- SupportedLastArgumentHashStyles:
329
- - always_inspect
330
- - always_ignore
331
- - ignore_implicit
332
- - ignore_explicit
333
-
334
- Layout/AlignParameters:
335
- Description: >-
336
- Align the parameters of a method definition if they span more
337
- than one line.
338
- StyleGuide: '#no-double-indent'
339
- Enabled: true
340
- VersionAdded: '0.49'
341
- VersionChanged: '0.68'
342
- # Alignment of parameters in multi-line method calls.
343
- #
344
- # The `with_first_parameter` style aligns the following lines along the same
345
- # column as the first parameter.
346
- #
347
- # def method_foo(a,
348
- # b)
349
- #
350
- # The `with_fixed_indentation` style aligns the following lines with one
351
- # level of indentation relative to the start of the line with the method call.
352
- #
353
- # def method_foo(a,
354
- # b)
355
- EnforcedStyle: with_first_parameter
356
- SupportedStyles:
357
- - with_first_parameter
358
- - with_fixed_indentation
359
- # By default, the indentation width from Layout/IndentationWidth is used
266
+ VersionChanged: '0.77'
267
+ # By default, the indentation width from `Layout/IndentationWidth` is used
360
268
  # But it can be overridden by setting this parameter
361
269
  IndentationWidth: ~
362
270
 
@@ -624,56 +532,11 @@ Layout/ExtraSpacing:
624
532
  # When true, forces the alignment of `=` in assignments on consecutive lines.
625
533
  ForceEqualSignAlignment: false
626
534
 
627
- Layout/FirstArrayElementLineBreak:
628
- Description: >-
629
- Checks for a line break before the first element in a
630
- multi-line array.
631
- Enabled: false
632
- VersionAdded: '0.49'
633
-
634
- Layout/FirstHashElementLineBreak:
635
- Description: >-
636
- Checks for a line break before the first element in a
637
- multi-line hash.
638
- Enabled: false
639
- VersionAdded: '0.49'
640
-
641
- Layout/FirstMethodArgumentLineBreak:
642
- Description: >-
643
- Checks for a line break before the first argument in a
644
- multi-line method call.
645
- Enabled: false
646
- VersionAdded: '0.49'
647
-
648
- Layout/FirstMethodParameterLineBreak:
649
- Description: >-
650
- Checks for a line break before the first parameter in a
651
- multi-line method parameter definition.
652
- Enabled: false
653
- VersionAdded: '0.49'
654
-
655
- Layout/HeredocArgumentClosingParenthesis:
656
- Description: >-
657
- Checks for the placement of the closing parenthesis in a
658
- method call that passes a HEREDOC string as an argument.
659
- Enabled: false
660
- StyleGuide: '#heredoc-argument-closing-parentheses'
661
- VersionAdded: '0.68'
662
-
663
- Layout/IndentAssignment:
664
- Description: >-
665
- Checks the indentation of the first line of the
666
- right-hand-side of a multi-line assignment.
667
- Enabled: true
668
- VersionAdded: '0.49'
669
- # By default, the indentation width from `Layout/IndentationWidth` is used
670
- # But it can be overridden by setting this parameter
671
- IndentationWidth: ~
672
-
673
- Layout/IndentFirstArgument:
535
+ Layout/FirstArgumentIndentation:
674
536
  Description: 'Checks the indentation of the first argument in a method call.'
675
537
  Enabled: true
676
538
  VersionAdded: '0.68'
539
+ VersionChanged: '0.77'
677
540
  EnforcedStyle: special_for_inner_method_call_in_parentheses
678
541
  SupportedStyles:
679
542
  # The first parameter should always be indented one step more than the
@@ -694,12 +557,13 @@ Layout/IndentFirstArgument:
694
557
  # But it can be overridden by setting this parameter
695
558
  IndentationWidth: ~
696
559
 
697
- Layout/IndentFirstArrayElement:
560
+ Layout/FirstArrayElementIndentation:
698
561
  Description: >-
699
562
  Checks the indentation of the first element in an array
700
563
  literal.
701
564
  Enabled: true
702
565
  VersionAdded: '0.68'
566
+ VersionChanged: '0.77'
703
567
  # The value `special_inside_parentheses` means that array literals with
704
568
  # brackets that have their opening bracket on the same line as a surrounding
705
569
  # opening round parenthesis, shall have their first element indented relative
@@ -720,10 +584,18 @@ Layout/IndentFirstArrayElement:
720
584
  # But it can be overridden by setting this parameter
721
585
  IndentationWidth: ~
722
586
 
723
- Layout/IndentFirstHashElement:
587
+ Layout/FirstArrayElementLineBreak:
588
+ Description: >-
589
+ Checks for a line break before the first element in a
590
+ multi-line array.
591
+ Enabled: false
592
+ VersionAdded: '0.49'
593
+
594
+ Layout/FirstHashElementIndentation:
724
595
  Description: 'Checks the indentation of the first key in a hash literal.'
725
596
  Enabled: true
726
597
  VersionAdded: '0.68'
598
+ VersionChanged: '0.77'
727
599
  # The value `special_inside_parentheses` means that hash literals with braces
728
600
  # that have their opening brace on the same line as a surrounding opening
729
601
  # round parenthesis, shall have their first key indented relative to the
@@ -744,13 +616,34 @@ Layout/IndentFirstHashElement:
744
616
  # But it can be overridden by setting this parameter
745
617
  IndentationWidth: ~
746
618
 
747
- Layout/IndentFirstParameter:
619
+ Layout/FirstHashElementLineBreak:
620
+ Description: >-
621
+ Checks for a line break before the first element in a
622
+ multi-line hash.
623
+ Enabled: false
624
+ VersionAdded: '0.49'
625
+
626
+ Layout/FirstMethodArgumentLineBreak:
627
+ Description: >-
628
+ Checks for a line break before the first argument in a
629
+ multi-line method call.
630
+ Enabled: false
631
+ VersionAdded: '0.49'
632
+
633
+ Layout/FirstMethodParameterLineBreak:
634
+ Description: >-
635
+ Checks for a line break before the first parameter in a
636
+ multi-line method parameter definition.
637
+ Enabled: false
638
+ VersionAdded: '0.49'
639
+
640
+ Layout/FirstParameterIndentation:
748
641
  Description: >-
749
642
  Checks the indentation of the first parameter in a
750
643
  method definition.
751
644
  Enabled: true
752
645
  VersionAdded: '0.49'
753
- VersionChanged: '0.68'
646
+ VersionChanged: '0.77'
754
647
  EnforcedStyle: consistent
755
648
  SupportedStyles:
756
649
  - consistent
@@ -759,12 +652,98 @@ Layout/IndentFirstParameter:
759
652
  # But it can be overridden by setting this parameter
760
653
  IndentationWidth: ~
761
654
 
762
- Layout/IndentHeredoc:
655
+ Layout/HashAlignment:
656
+ Description: >-
657
+ Align the elements of a hash literal if they span more than
658
+ one line.
659
+ Enabled: true
660
+ AllowMultipleStyles: true
661
+ VersionAdded: '0.49'
662
+ VersionChanged: '0.77'
663
+ # Alignment of entries using hash rocket as separator. Valid values are:
664
+ #
665
+ # key - left alignment of keys
666
+ # 'a' => 2
667
+ # 'bb' => 3
668
+ # separator - alignment of hash rockets, keys are right aligned
669
+ # 'a' => 2
670
+ # 'bb' => 3
671
+ # table - left alignment of keys, hash rockets, and values
672
+ # 'a' => 2
673
+ # 'bb' => 3
674
+ EnforcedHashRocketStyle: key
675
+ SupportedHashRocketStyles:
676
+ - key
677
+ - separator
678
+ - table
679
+ # Alignment of entries using colon as separator. Valid values are:
680
+ #
681
+ # key - left alignment of keys
682
+ # a: 0
683
+ # bb: 1
684
+ # separator - alignment of colons, keys are right aligned
685
+ # a: 0
686
+ # bb: 1
687
+ # table - left alignment of keys and values
688
+ # a: 0
689
+ # bb: 1
690
+ EnforcedColonStyle: key
691
+ SupportedColonStyles:
692
+ - key
693
+ - separator
694
+ - table
695
+ # Select whether hashes that are the last argument in a method call should be
696
+ # inspected? Valid values are:
697
+ #
698
+ # always_inspect - Inspect both implicit and explicit hashes.
699
+ # Registers an offense for:
700
+ # function(a: 1,
701
+ # b: 2)
702
+ # Registers an offense for:
703
+ # function({a: 1,
704
+ # b: 2})
705
+ # always_ignore - Ignore both implicit and explicit hashes.
706
+ # Accepts:
707
+ # function(a: 1,
708
+ # b: 2)
709
+ # Accepts:
710
+ # function({a: 1,
711
+ # b: 2})
712
+ # ignore_implicit - Ignore only implicit hashes.
713
+ # Accepts:
714
+ # function(a: 1,
715
+ # b: 2)
716
+ # Registers an offense for:
717
+ # function({a: 1,
718
+ # b: 2})
719
+ # ignore_explicit - Ignore only explicit hashes.
720
+ # Accepts:
721
+ # function({a: 1,
722
+ # b: 2})
723
+ # Registers an offense for:
724
+ # function(a: 1,
725
+ # b: 2)
726
+ EnforcedLastArgumentHashStyle: always_inspect
727
+ SupportedLastArgumentHashStyles:
728
+ - always_inspect
729
+ - always_ignore
730
+ - ignore_implicit
731
+ - ignore_explicit
732
+
733
+ Layout/HeredocArgumentClosingParenthesis:
734
+ Description: >-
735
+ Checks for the placement of the closing parenthesis in a
736
+ method call that passes a HEREDOC string as an argument.
737
+ Enabled: false
738
+ StyleGuide: '#heredoc-argument-closing-parentheses'
739
+ VersionAdded: '0.68'
740
+
741
+ Layout/HeredocIndentation:
763
742
  Description: 'This cop checks the indentation of the here document bodies.'
764
743
  StyleGuide: '#squiggly-heredocs'
765
744
  Enabled: true
766
745
  VersionAdded: '0.49'
767
- VersionChanged: '0.69'
746
+ VersionChanged: '0.77'
768
747
  EnforcedStyle: squiggly
769
748
  SupportedStyles:
770
749
  - squiggly
@@ -806,11 +785,6 @@ Layout/InitialIndentation:
806
785
  Enabled: true
807
786
  VersionAdded: '0.49'
808
787
 
809
- Layout/LeadingBlankLines:
810
- Description: Check for unnecessary blank lines at the beginning of a file.
811
- Enabled: true
812
- VersionAdded: '0.57'
813
-
814
788
  Layout/LeadingCommentSpace:
815
789
  Description: 'Comments should start with a space.'
816
790
  StyleGuide: '#hash-space'
@@ -819,6 +793,12 @@ Layout/LeadingCommentSpace:
819
793
  VersionChanged: '0.73'
820
794
  AllowDoxygenCommentStyle: false
821
795
 
796
+ Layout/LeadingEmptyLines:
797
+ Description: Check for unnecessary blank lines at the beginning of a file.
798
+ Enabled: true
799
+ VersionAdded: '0.57'
800
+ VersionChanged: '0.77'
801
+
822
802
  Layout/MultilineArrayBraceLayout:
823
803
  Description: >-
824
804
  Checks that the closing brace in an array literal is
@@ -960,6 +940,35 @@ Layout/MultilineOperationIndentation:
960
940
  # But it can be overridden by setting this parameter
961
941
  IndentationWidth: ~
962
942
 
943
+ Layout/ParameterAlignment:
944
+ Description: >-
945
+ Align the parameters of a method definition if they span more
946
+ than one line.
947
+ StyleGuide: '#no-double-indent'
948
+ Enabled: true
949
+ VersionAdded: '0.49'
950
+ VersionChanged: '0.77'
951
+ # Alignment of parameters in multi-line method calls.
952
+ #
953
+ # The `with_first_parameter` style aligns the following lines along the same
954
+ # column as the first parameter.
955
+ #
956
+ # def method_foo(a,
957
+ # b)
958
+ #
959
+ # The `with_fixed_indentation` style aligns the following lines with one
960
+ # level of indentation relative to the start of the line with the method call.
961
+ #
962
+ # def method_foo(a,
963
+ # b)
964
+ EnforcedStyle: with_first_parameter
965
+ SupportedStyles:
966
+ - with_first_parameter
967
+ - with_fixed_indentation
968
+ # By default, the indentation width from Layout/IndentationWidth is used
969
+ # But it can be overridden by setting this parameter
970
+ IndentationWidth: ~
971
+
963
972
  Layout/RescueEnsureAlignment:
964
973
  Description: 'Align rescues and ensures correctly.'
965
974
  Enabled: true
@@ -1202,11 +1211,12 @@ Layout/Tab:
1202
1211
  # replace each tab.
1203
1212
  IndentationWidth: ~
1204
1213
 
1205
- Layout/TrailingBlankLines:
1214
+ Layout/TrailingEmptyLines:
1206
1215
  Description: 'Checks trailing blank lines and final newline.'
1207
1216
  StyleGuide: '#newline-eof'
1208
1217
  Enabled: true
1209
1218
  VersionAdded: '0.49'
1219
+ VersionChanged: '0.77'
1210
1220
  EnforcedStyle: final_newline
1211
1221
  SupportedStyles:
1212
1222
  - final_newline
@@ -1290,16 +1300,17 @@ Lint/DuplicateCaseCondition:
1290
1300
  Enabled: true
1291
1301
  VersionAdded: '0.45'
1292
1302
 
1303
+ Lint/DuplicateHashKey:
1304
+ Description: 'Check for duplicate keys in hash literals.'
1305
+ Enabled: true
1306
+ VersionAdded: '0.34'
1307
+ VersionChanged: '0.77'
1308
+
1293
1309
  Lint/DuplicateMethods:
1294
1310
  Description: 'Check for duplicate method definitions.'
1295
1311
  Enabled: true
1296
1312
  VersionAdded: '0.29'
1297
1313
 
1298
- Lint/DuplicatedKey:
1299
- Description: 'Check for duplicate keys in hash literals.'
1300
- Enabled: true
1301
- VersionAdded: '0.34'
1302
-
1303
1314
  Lint/EachWithObjectArgument:
1304
1315
  Description: 'Check for immutable argument given to each_with_object.'
1305
1316
  Enabled: true
@@ -1367,14 +1378,6 @@ Lint/FormatParameterMismatch:
1367
1378
  Enabled: true
1368
1379
  VersionAdded: '0.33'
1369
1380
 
1370
- Lint/HandleExceptions:
1371
- Description: "Don't suppress exception."
1372
- StyleGuide: '#dont-hide-exceptions'
1373
- Enabled: true
1374
- AllowComments: false
1375
- VersionAdded: '0.9'
1376
- VersionChanged: '0.70'
1377
-
1378
1381
  Lint/HeredocMethodCallPosition:
1379
1382
  Description: >-
1380
1383
  Checks for the ordering of a method call where
@@ -1444,10 +1447,11 @@ Lint/MissingCopEnableDirective:
1444
1447
  # .inf for any size
1445
1448
  MaximumRangeSize: .inf
1446
1449
 
1447
- Lint/MultipleCompare:
1448
- Description: "Use `&&` operator to compare multiple value."
1450
+ Lint/MultipleComparison:
1451
+ Description: "Use `&&` operator to compare multiple values."
1449
1452
  Enabled: true
1450
1453
  VersionAdded: '0.47'
1454
+ VersionChanged: '0.77'
1451
1455
 
1452
1456
  Lint/NestedMethodDefinition:
1453
1457
  Description: 'Do not use nested method definitions.'
@@ -1535,6 +1539,13 @@ Lint/RedundantSplatExpansion:
1535
1539
  Enabled: true
1536
1540
  VersionChanged: '0.76'
1537
1541
 
1542
+ Lint/RedundantStringCoercion:
1543
+ Description: 'Checks for Object#to_s usage in string interpolation.'
1544
+ StyleGuide: '#no-to-s'
1545
+ Enabled: true
1546
+ VersionAdded: '0.19'
1547
+ VersionChanged: '0.77'
1548
+
1538
1549
  Lint/RedundantWithIndex:
1539
1550
  Description: 'Checks for redundant `with_index`.'
1540
1551
  Enabled: true
@@ -1580,8 +1591,8 @@ Lint/SafeNavigationChain:
1580
1591
  Description: 'Do not chain ordinary method call after safe navigation operator.'
1581
1592
  Enabled: true
1582
1593
  VersionAdded: '0.47'
1583
- VersionChanged: '0.56'
1584
- Whitelist:
1594
+ VersionChanged: '0.77'
1595
+ AllowedMethods:
1585
1596
  - present?
1586
1597
  - blank?
1587
1598
  - presence
@@ -1595,14 +1606,14 @@ Lint/SafeNavigationConsistency:
1595
1606
  for all method calls on that same object.
1596
1607
  Enabled: true
1597
1608
  VersionAdded: '0.55'
1598
- Whitelist:
1609
+ VersionChanged: '0.77'
1610
+ AllowedMethods:
1599
1611
  - present?
1600
1612
  - blank?
1601
1613
  - presence
1602
1614
  - try
1603
1615
  - try!
1604
1616
 
1605
-
1606
1617
  Lint/SafeNavigationWithEmpty:
1607
1618
  Description: 'Avoid `foo&.empty?` in conditionals.'
1608
1619
  Enabled: true
@@ -1640,12 +1651,13 @@ Lint/ShadowingOuterLocalVariable:
1640
1651
  Enabled: true
1641
1652
  VersionAdded: '0.9'
1642
1653
 
1643
- Lint/StringConversionInInterpolation:
1644
- Description: 'Checks for Object#to_s usage in string interpolation.'
1645
- StyleGuide: '#no-to-s'
1654
+ Lint/SuppressedException:
1655
+ Description: "Don't suppress exceptions."
1656
+ StyleGuide: '#dont-hide-exceptions'
1646
1657
  Enabled: true
1647
- VersionAdded: '0.19'
1648
- VersionChanged: '0.20'
1658
+ AllowComments: false
1659
+ VersionAdded: '0.9'
1660
+ VersionChanged: '0.77'
1649
1661
 
1650
1662
  Lint/Syntax:
1651
1663
  Description: 'Checks syntax error.'
@@ -1881,6 +1893,21 @@ Naming/BinaryOperatorParameterName:
1881
1893
  Enabled: true
1882
1894
  VersionAdded: '0.50'
1883
1895
 
1896
+ Naming/BlockParameterName:
1897
+ Description: >-
1898
+ Checks for block parameter names that contain capital letters,
1899
+ end in numbers, or do not meet a minimal length.
1900
+ Enabled: true
1901
+ VersionAdded: '0.53'
1902
+ VersionChanged: '0.77'
1903
+ # Parameter names may be equal to or greater than this value
1904
+ MinNameLength: 1
1905
+ AllowNamesEndingInNumbers: true
1906
+ # Allowed names that will not register an offense
1907
+ AllowedNames: []
1908
+ # Forbidden names that will register an offense
1909
+ ForbiddenNames: []
1910
+
1884
1911
  Naming/ClassAndModuleCamelCase:
1885
1912
  Description: 'Use CamelCase for classes and modules.'
1886
1913
  StyleGuide: '#camelcase-classes'
@@ -1972,7 +1999,7 @@ Naming/HeredocDelimiterNaming:
1972
1999
  StyleGuide: '#heredoc-delimiters'
1973
2000
  Enabled: true
1974
2001
  VersionAdded: '0.50'
1975
- Blacklist:
2002
+ ForbiddenDelimiters:
1976
2003
  - !ruby/regexp '/(^|\s)(EO[A-Z]{1}|END)(\s|$)/'
1977
2004
 
1978
2005
  Naming/MemoizedInstanceVariableName:
@@ -2004,25 +2031,50 @@ Naming/MethodName:
2004
2031
  #
2005
2032
  IgnoredPatterns: []
2006
2033
 
2034
+ Naming/MethodParameterName:
2035
+ Description: >-
2036
+ Checks for method parameter names that contain capital letters,
2037
+ end in numbers, or do not meet a minimal length.
2038
+ Enabled: true
2039
+ VersionAdded: '0.53'
2040
+ VersionChanged: '0.77'
2041
+ # Parameter names may be equal to or greater than this value
2042
+ MinNameLength: 3
2043
+ AllowNamesEndingInNumbers: true
2044
+ # Allowed names that will not register an offense
2045
+ AllowedNames:
2046
+ - io
2047
+ - id
2048
+ - to
2049
+ - by
2050
+ - 'on'
2051
+ - in
2052
+ - at
2053
+ - ip
2054
+ - db
2055
+ - os
2056
+ # Forbidden names that will register an offense
2057
+ ForbiddenNames: []
2058
+
2007
2059
  Naming/PredicateName:
2008
2060
  Description: 'Check the names of predicate methods.'
2009
2061
  StyleGuide: '#bool-methods-qmark'
2010
2062
  Enabled: true
2011
2063
  VersionAdded: '0.50'
2012
- VersionChanged: '0.51'
2064
+ VersionChanged: '0.77'
2013
2065
  # Predicate name prefixes.
2014
2066
  NamePrefix:
2015
2067
  - is_
2016
2068
  - has_
2017
2069
  - have_
2018
2070
  # Predicate name prefixes that should be removed.
2019
- NamePrefixBlacklist:
2071
+ ForbiddenPrefixes:
2020
2072
  - is_
2021
2073
  - has_
2022
2074
  - have_
2023
- # Predicate names which, despite having a blacklisted prefix, or no `?`,
2075
+ # Predicate names which, despite having a forbidden prefix, or no `?`,
2024
2076
  # should still be accepted
2025
- NameWhitelist:
2077
+ AllowedMethods:
2026
2078
  - is_a?
2027
2079
  # Method definition macros for dynamically generated methods.
2028
2080
  MethodDefinitionMacros:
@@ -2040,46 +2092,6 @@ Naming/RescuedExceptionsVariableName:
2040
2092
  VersionChanged: '0.68'
2041
2093
  PreferredName: e
2042
2094
 
2043
- Naming/UncommunicativeBlockParamName:
2044
- Description: >-
2045
- Checks for block parameter names that contain capital letters,
2046
- end in numbers, or do not meet a minimal length.
2047
- Enabled: true
2048
- VersionAdded: '0.53'
2049
- # Parameter names may be equal to or greater than this value
2050
- MinNameLength: 1
2051
- AllowNamesEndingInNumbers: true
2052
- # Whitelisted names that will not register an offense
2053
- AllowedNames: []
2054
- # Blacklisted names that will register an offense
2055
- ForbiddenNames: []
2056
-
2057
- Naming/UncommunicativeMethodParamName:
2058
- Description: >-
2059
- Checks for method parameter names that contain capital letters,
2060
- end in numbers, or do not meet a minimal length.
2061
- Enabled: true
2062
- VersionAdded: '0.53'
2063
- VersionChanged: '0.59'
2064
- # Parameter names may be equal to or greater than this value
2065
- MinNameLength: 3
2066
- AllowNamesEndingInNumbers: true
2067
- # Whitelisted names that will not register an offense
2068
- AllowedNames:
2069
- - io
2070
- - id
2071
- - to
2072
- - by
2073
- - 'on'
2074
- - in
2075
- - at
2076
- - ip
2077
- - db
2078
- - os
2079
- # Blacklisted names that will register an offense
2080
- ForbiddenNames: []
2081
-
2082
-
2083
2095
  Naming/VariableName:
2084
2096
  Description: 'Use the configured style when naming variables.'
2085
2097
  StyleGuide: '#snake-case-symbols-methods-vars'
@@ -2874,8 +2886,9 @@ Style/IpAddresses:
2874
2886
  Description: "Don't include literal IP addresses in code."
2875
2887
  Enabled: false
2876
2888
  VersionAdded: '0.58'
2877
- # Allow strings to be whitelisted
2878
- Whitelist:
2889
+ VersionChanged: '0.77'
2890
+ # Allow addresses to be permitted
2891
+ AllowedAddresses:
2879
2892
  - "::"
2880
2893
  # :: is a valid IPv6 address, but could potentially be legitimately in code
2881
2894
 
@@ -3148,8 +3161,8 @@ Style/NestedParenthesizedCalls:
3148
3161
  argument list of another parenthesized method call.
3149
3162
  Enabled: true
3150
3163
  VersionAdded: '0.36'
3151
- VersionChanged: '0.50'
3152
- Whitelist:
3164
+ VersionChanged: '0.77'
3165
+ AllowedMethods:
3153
3166
  - be
3154
3167
  - be_a
3155
3168
  - be_an
@@ -3526,11 +3539,11 @@ Style/SafeNavigation:
3526
3539
  safe navigation (`&.`).
3527
3540
  Enabled: true
3528
3541
  VersionAdded: '0.43'
3529
- VersionChanged: '0.56'
3542
+ VersionChanged: '0.77'
3530
3543
  # Safe navigation may cause a statement to start returning `nil` in addition
3531
3544
  # to whatever it used to return.
3532
3545
  ConvertCodeThatCanStartToReturnNil: false
3533
- Whitelist:
3546
+ AllowedMethods:
3534
3547
  - present?
3535
3548
  - blank?
3536
3549
  - presence
@@ -3808,7 +3821,7 @@ Style/TrivialAccessors:
3808
3821
  StyleGuide: '#attr_family'
3809
3822
  Enabled: true
3810
3823
  VersionAdded: '0.9'
3811
- VersionChanged: '0.38'
3824
+ VersionChanged: '0.77'
3812
3825
  # When set to `false` the cop will suggest the use of accessor methods
3813
3826
  # in situations like:
3814
3827
  #
@@ -3829,7 +3842,7 @@ Style/TrivialAccessors:
3829
3842
  # Commonly used in DSLs
3830
3843
  AllowDSLWriters: false
3831
3844
  IgnoreClassMethods: false
3832
- Whitelist:
3845
+ AllowedMethod:
3833
3846
  - to_ary
3834
3847
  - to_a
3835
3848
  - to_c