chefstyle 0.14.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3462e762ab10f5186e415bbebb25bbe4aaca5bbfc39ef0d3ba239d38836f3758
4
- data.tar.gz: d851d9964760d17375f68688591f8dedff6c360226cbb202a6009a7483780488
3
+ metadata.gz: cb8e8694ac330f16fbed4c272f4ea96ecc82e5ea0f4e5cb86d67afccd89dd4e9
4
+ data.tar.gz: 1226349965ce1702235ee02901ced43ea2f96f9026fd41d40fcd16b34d01ed89
5
5
  SHA512:
6
- metadata.gz: c61336183334d3c7d08b9b696c4fb87515fb1f523aff17ce6f3593ed94b87c7776802ffdeced3b46e573a16bce1d88ac1bcc9478ee5d9fea3ceb4d3d1148ea1f
7
- data.tar.gz: 62f4f811f91b682df0231ac211d6d37feafd4ecb1152abeb1de37de68f604f30b3c35bd241bc53801e40e6daf4d5030c532ef5375c593da3866c2c13d124ab53
6
+ metadata.gz: 3805bdeb602027ca973b45838837039c4f8f41742495755df414bc1b9541b6e81e2e9dcb6ce8ff8857dd1c1080b7e6d131da0624b8ca883082b599e3244d5bd6
7
+ data.tar.gz: e2c280aa7ad8d1779ada9549ccf89e5e6bd700b5c7a1a164404d47ea23609db213ef4ec61bdfdfe88dfe7ccec653698d3cdaa3d7e65c4befd60ea5f63aae68af
@@ -9,12 +9,12 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Chef Software, Inc."]
10
10
  spec.email = ["oss@chef.io"]
11
11
 
12
- spec.summary = %q{Rubocop configuration for Chef's ruby projects}
12
+ spec.summary = %q{RuboCop configuration for Chef's ruby projects}
13
13
  spec.homepage = "https://github.com/chef/chefstyle"
14
14
  spec.license = "Apache-2.0"
15
- spec.required_ruby_version = ">= 2.3"
15
+ spec.required_ruby_version = ">= 2.4"
16
16
 
17
- spec.files = %w{LICENSE chefstyle.gemspec Gemfile} + Dir.glob("{bin,config,lib}/**/*", File::FNM_DOTMATCH).reject { |f| File.directory?(f) }
17
+ spec.files = %w{LICENSE chefstyle.gemspec} + Dir.glob("{bin,config,lib}/**/*", File::FNM_DOTMATCH).reject { |f| File.directory?(f) }
18
18
  spec.executables = %w{chefstyle}
19
19
  spec.require_paths = ["lib"]
20
20
 
@@ -1,5 +1,5 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.3
2
+ TargetRubyVersion: 2.4
3
3
 
4
4
  #
5
5
  # Bundler
@@ -31,6 +31,7 @@ Lint/Debugger:
31
31
  Enabled: true
32
32
  Layout/DefEndAlignment:
33
33
  Enabled: true
34
+ AutoCorrect: true
34
35
  Lint/DeprecatedClassMethods:
35
36
  Enabled: true
36
37
  Lint/DuplicateCaseCondition:
@@ -53,6 +54,7 @@ Lint/EmptyWhen:
53
54
  Enabled: true
54
55
  Layout/EndAlignment:
55
56
  Enabled: true
57
+ AutoCorrect: true
56
58
  Lint/EndInMethod:
57
59
  Enabled: true
58
60
  Lint/EnsureReturn:
@@ -107,6 +109,8 @@ Lint/UnneededSplatExpansion:
107
109
  Enabled: true
108
110
  Lint/UnreachableCode:
109
111
  Enabled: true
112
+ Lint/UriEscapeUnescape:
113
+ Enabled: true
110
114
  Lint/UselessAccessModifier:
111
115
  Enabled: true
112
116
  Lint/UselessAssignment:
@@ -119,6 +123,8 @@ Lint/UselessSetterCall:
119
123
  Enabled: true
120
124
  Lint/Void:
121
125
  Enabled: true
126
+ Layout/CommentIndentation:
127
+ Enabled: true
122
128
 
123
129
  #
124
130
  # Disabled Lint
@@ -164,7 +170,7 @@ Metrics/ClassLength:
164
170
  Enabled: false
165
171
  Metrics/CyclomaticComplexity:
166
172
  Enabled: false
167
- Metrics/LineLength:
173
+ Layout/LineLength:
168
174
  Enabled: false
169
175
  Metrics/MethodLength:
170
176
  Enabled: false
@@ -440,7 +446,7 @@ Style/SymbolArray:
440
446
  Enabled: true
441
447
  Style/SymbolProc:
442
448
  Enabled: true
443
- Layout/Tab:
449
+ Layout/IndentationStyle:
444
450
  Enabled: true
445
451
  Layout/TrailingBlankLines:
446
452
  Enabled: true
@@ -622,3 +628,7 @@ Style/Alias:
622
628
  # anyone else's time either.
623
629
  Style/CommentedKeyword:
624
630
  Enabled: false
631
+
632
+ # make sure we catch this Ruby 3.0 breaking change now
633
+ Lint/DeprecatedOpenSSLConstant:
634
+ Enabled: true
@@ -19,13 +19,11 @@ Gemspec/RubyVersionGlobalsUsage:
19
19
  Enabled: false
20
20
  Layout/AccessModifierIndentation:
21
21
  Enabled: false
22
- Layout/AlignArguments:
22
+ Layout/ArgumentAlignment:
23
23
  Enabled: false
24
- Layout/AlignArray:
24
+ Layout/ArrayAlignment:
25
25
  Enabled: false
26
- Layout/AlignHash:
27
- Enabled: false
28
- Layout/AlignParameters:
26
+ Layout/AssignmentIndentation:
29
27
  Enabled: false
30
28
  Layout/BlockAlignment:
31
29
  Enabled: false
@@ -61,6 +59,8 @@ Layout/EmptyLinesAroundAccessModifier:
61
59
  Enabled: false
62
60
  Layout/EmptyLinesAroundArguments:
63
61
  Enabled: false
62
+ Layout/EmptyLinesAroundAttributeAccessor:
63
+ Enabled: false
64
64
  Layout/EmptyLinesAroundBeginBody:
65
65
  Enabled: false
66
66
  Layout/EmptyLinesAroundBlockBody:
@@ -81,38 +81,42 @@ Layout/EndOfLine:
81
81
  Enabled: false
82
82
  Layout/ExtraSpacing:
83
83
  Enabled: false
84
+ Layout/FirstArgumentIndentation:
85
+ Enabled: false
86
+ Layout/FirstArrayElementIndentation:
87
+ Enabled: false
84
88
  Layout/FirstArrayElementLineBreak:
85
89
  Enabled: false
90
+ Layout/FirstHashElementIndentation:
91
+ Enabled: false
86
92
  Layout/FirstHashElementLineBreak:
87
93
  Enabled: false
88
94
  Layout/FirstMethodArgumentLineBreak:
89
95
  Enabled: false
90
96
  Layout/FirstMethodParameterLineBreak:
91
97
  Enabled: false
92
- Layout/HeredocArgumentClosingParenthesis:
93
- Enabled: false
94
- Layout/IndentAssignment:
95
- Enabled: false
96
- Layout/IndentationConsistency:
98
+ Layout/FirstParameterIndentation:
97
99
  Enabled: false
98
- Layout/IndentationWidth:
100
+ Layout/HashAlignment:
99
101
  Enabled: false
100
- Layout/IndentFirstArgument:
102
+ Layout/HeredocArgumentClosingParenthesis:
101
103
  Enabled: false
102
- Layout/IndentFirstArrayElement:
104
+ Layout/HeredocIndentation:
103
105
  Enabled: false
104
- Layout/IndentFirstHashElement:
106
+ Layout/IndentationConsistency:
105
107
  Enabled: false
106
- Layout/IndentFirstParameter:
108
+ Layout/IndentationStyle:
107
109
  Enabled: false
108
- Layout/IndentHeredoc:
110
+ Layout/IndentationWidth:
109
111
  Enabled: false
110
112
  Layout/InitialIndentation:
111
113
  Enabled: false
112
- Layout/LeadingBlankLines:
113
- Enabled: false
114
114
  Layout/LeadingCommentSpace:
115
115
  Enabled: false
116
+ Layout/LeadingEmptyLines:
117
+ Enabled: false
118
+ Layout/LineLength:
119
+ Enabled: false
116
120
  Layout/MultilineArrayBraceLayout:
117
121
  Enabled: false
118
122
  Layout/MultilineArrayLineBreaks:
@@ -135,6 +139,8 @@ Layout/MultilineMethodDefinitionBraceLayout:
135
139
  Enabled: false
136
140
  Layout/MultilineOperationIndentation:
137
141
  Enabled: false
142
+ Layout/ParameterAlignment:
143
+ Enabled: false
138
144
  Layout/RescueEnsureAlignment:
139
145
  Enabled: false
140
146
  Layout/SpaceAfterColon:
@@ -153,6 +159,8 @@ Layout/SpaceAroundEqualsInParameterDefault:
153
159
  Enabled: false
154
160
  Layout/SpaceAroundKeyword:
155
161
  Enabled: false
162
+ Layout/SpaceAroundMethodCallOperator:
163
+ Enabled: false
156
164
  Layout/SpaceAroundOperators:
157
165
  Enabled: false
158
166
  Layout/SpaceBeforeBlockBraces:
@@ -185,9 +193,7 @@ Layout/SpaceInsideReferenceBrackets:
185
193
  Enabled: false
186
194
  Layout/SpaceInsideStringInterpolation:
187
195
  Enabled: false
188
- Layout/Tab:
189
- Enabled: false
190
- Layout/TrailingBlankLines:
196
+ Layout/TrailingEmptyLines:
191
197
  Enabled: false
192
198
  Layout/TrailingWhitespace:
193
199
  Enabled: false
@@ -209,13 +215,15 @@ Lint/Debugger:
209
215
  Enabled: false
210
216
  Lint/DeprecatedClassMethods:
211
217
  Enabled: false
218
+ Lint/DeprecatedOpenSSLConstant:
219
+ Enabled: false
212
220
  Lint/DisjunctiveAssignmentInConstructor:
213
221
  Enabled: false
214
222
  Lint/DuplicateCaseCondition:
215
223
  Enabled: false
216
- Lint/DuplicateMethods:
224
+ Lint/DuplicateHashKey:
217
225
  Enabled: false
218
- Lint/DuplicatedKey:
226
+ Lint/DuplicateMethods:
219
227
  Enabled: false
220
228
  Lint/EachWithObjectArgument:
221
229
  Enabled: false
@@ -229,8 +237,6 @@ Lint/EmptyInterpolation:
229
237
  Enabled: false
230
238
  Lint/EmptyWhen:
231
239
  Enabled: false
232
- Lint/EndInMethod:
233
- Enabled: false
234
240
  Lint/EnsureReturn:
235
241
  Enabled: false
236
242
  Lint/ErbNewArguments:
@@ -241,8 +247,6 @@ Lint/FloatOutOfRange:
241
247
  Enabled: false
242
248
  Lint/FormatParameterMismatch:
243
249
  Enabled: false
244
- Lint/HandleExceptions:
245
- Enabled: false
246
250
  Lint/HeredocMethodCallPosition:
247
251
  Enabled: false
248
252
  Lint/ImplicitStringConcatenation:
@@ -261,7 +265,9 @@ Lint/Loop:
261
265
  Enabled: false
262
266
  Lint/MissingCopEnableDirective:
263
267
  Enabled: false
264
- Lint/MultipleCompare:
268
+ Lint/MixedRegexpCaptureTypes:
269
+ Enabled: false
270
+ Lint/MultipleComparison:
265
271
  Enabled: false
266
272
  Lint/NestedMethodDefinition:
267
273
  Enabled: false
@@ -269,6 +275,8 @@ Lint/NestedPercentLiteral:
269
275
  Enabled: false
270
276
  Lint/NextWithoutAccumulator:
271
277
  Enabled: false
278
+ Lint/NonDeterministicRequireOrder:
279
+ Enabled: false
272
280
  Lint/NonLocalExitFromIterator:
273
281
  Enabled: false
274
282
  Lint/NumberConversion:
@@ -281,8 +289,20 @@ Lint/PercentStringArray:
281
289
  Enabled: false
282
290
  Lint/PercentSymbolArray:
283
291
  Enabled: false
292
+ Lint/RaiseException:
293
+ Enabled: false
284
294
  Lint/RandOne:
285
295
  Enabled: false
296
+ Lint/RedundantCopDisableDirective:
297
+ Enabled: false
298
+ Lint/RedundantCopEnableDirective:
299
+ Enabled: false
300
+ Lint/RedundantRequireStatement:
301
+ Enabled: false
302
+ Lint/RedundantSplatExpansion:
303
+ Enabled: false
304
+ Lint/RedundantStringCoercion:
305
+ Enabled: false
286
306
  Lint/RedundantWithIndex:
287
307
  Enabled: false
288
308
  Lint/RedundantWithObject:
@@ -313,7 +333,9 @@ Lint/ShadowedException:
313
333
  Enabled: false
314
334
  Lint/ShadowingOuterLocalVariable:
315
335
  Enabled: false
316
- Lint/StringConversionInInterpolation:
336
+ Lint/StructNewOverride:
337
+ Enabled: false
338
+ Lint/SuppressedException:
317
339
  Enabled: false
318
340
  Lint/Syntax:
319
341
  Enabled: false
@@ -323,14 +345,6 @@ Lint/UnderscorePrefixedVariableName:
323
345
  Enabled: false
324
346
  Lint/UnifiedInteger:
325
347
  Enabled: false
326
- Lint/UnneededCopDisableDirective:
327
- Enabled: false
328
- Lint/UnneededCopEnableDirective:
329
- Enabled: false
330
- Lint/UnneededRequireStatement:
331
- Enabled: false
332
- Lint/UnneededSplatExpansion:
333
- Enabled: false
334
348
  Lint/UnreachableCode:
335
349
  Enabled: false
336
350
  Lint/UnusedBlockArgument:
@@ -363,8 +377,6 @@ Metrics/BlockNesting:
363
377
  Enabled: false
364
378
  Metrics/ClassLength:
365
379
  Enabled: false
366
- Metrics/LineLength:
367
- Enabled: false
368
380
  Metrics/MethodLength:
369
381
  Enabled: false
370
382
  Metrics/ModuleLength:
@@ -377,6 +389,8 @@ Naming/AccessorMethodName:
377
389
  Enabled: false
378
390
  Naming/AsciiIdentifiers:
379
391
  Enabled: false
392
+ Naming/BlockParameterName:
393
+ Enabled: false
380
394
  Naming/ClassAndModuleCamelCase:
381
395
  Enabled: false
382
396
  Naming/ConstantName:
@@ -391,16 +405,14 @@ Naming/MemoizedInstanceVariableName:
391
405
  Enabled: false
392
406
  Naming/MethodName:
393
407
  Enabled: false
408
+ Naming/MethodParameterName:
409
+ Enabled: false
394
410
  Naming/BinaryOperatorParameterName:
395
411
  Enabled: false
396
412
  Naming/PredicateName:
397
413
  Enabled: false
398
414
  Naming/RescuedExceptionsVariableName:
399
415
  Enabled: false
400
- Naming/UncommunicativeBlockParamName:
401
- Enabled: false
402
- Naming/UncommunicativeMethodParamName:
403
- Enabled: false
404
416
  Naming/VariableName:
405
417
  Enabled: false
406
418
  Naming/VariableNumber:
@@ -427,8 +439,6 @@ Style/BlockComments:
427
439
  Enabled: false
428
440
  Style/BlockDelimiters:
429
441
  Enabled: false
430
- Style/BracesAroundHashParameters:
431
- Enabled: false
432
442
  Style/CaseEquality:
433
443
  Enabled: false
434
444
  Style/CharacterLiteral:
@@ -465,6 +475,8 @@ Style/DefWithParentheses:
465
475
  Enabled: false
466
476
  Style/Dir:
467
477
  Enabled: false
478
+ Style/DisableCopsWithinSourceCodeDirective:
479
+ Enabled: false
468
480
  Style/DocumentationMethod:
469
481
  Enabled: false
470
482
  Style/Documentation:
@@ -499,6 +511,8 @@ Style/EvenOdd:
499
511
  Enabled: false
500
512
  Style/ExpandPathArguments:
501
513
  Enabled: false
514
+ Style/ExponentialNotation:
515
+ Enabled: false
502
516
  Style/FloatDivision:
503
517
  Enabled: false
504
518
  Style/For:
@@ -513,8 +527,14 @@ Style/GlobalVars:
513
527
  Enabled: false
514
528
  Style/GuardClause:
515
529
  Enabled: false
530
+ Style/HashEachMethods:
531
+ Enabled: false
516
532
  Style/HashSyntax:
517
533
  Enabled: false
534
+ Style/HashTransformKeys:
535
+ Enabled: false
536
+ Style/HashTransformValues:
537
+ Enabled: false
518
538
  Style/IdenticalConditionalBranches:
519
539
  Enabled: false
520
540
  Style/IfInsideElse:
@@ -635,18 +655,32 @@ Style/RandomWithOffset:
635
655
  Enabled: false
636
656
  Style/RedundantBegin:
637
657
  Enabled: false
658
+ Style/RedundantCapitalW:
659
+ Enabled: false
660
+ Style/RedundantCondition:
661
+ Enabled: false
638
662
  Style/RedundantConditional:
639
663
  Enabled: false
640
664
  Style/RedundantException:
641
665
  Enabled: false
642
666
  Style/RedundantFreeze:
643
667
  Enabled: false
668
+ Style/RedundantInterpolation:
669
+ Enabled: false
644
670
  Style/RedundantParentheses:
645
671
  Enabled: false
672
+ Style/RedundantPercentQ:
673
+ Enabled: false
674
+ Style/RedundantRegexpCharacterClass:
675
+ Enabled: false
676
+ Style/RedundantRegexpEscape:
677
+ Enabled: false
646
678
  Style/RedundantReturn:
647
679
  Enabled: false
648
680
  Style/RedundantSelf:
649
681
  Enabled: false
682
+ Style/RedundantSort:
683
+ Enabled: false
650
684
  Style/RedundantSortBy:
651
685
  Enabled: false
652
686
  Style/RegexpLiteral:
@@ -673,6 +707,8 @@ Style/SingleLineBlockParams:
673
707
  Enabled: false
674
708
  Style/SingleLineMethods:
675
709
  Enabled: false
710
+ Style/SlicingWithRange:
711
+ Enabled: false
676
712
  Style/SpecialGlobalVars:
677
713
  Enabled: false
678
714
  Style/StabbyLambdaParentheses:
@@ -709,6 +745,8 @@ Style/TrailingCommaInArguments:
709
745
  Enabled: false
710
746
  Style/TrailingCommaInArrayLiteral:
711
747
  Enabled: false
748
+ Style/TrailingCommaInBlockArgs:
749
+ Enabled: false
712
750
  Style/TrailingCommaInHashLiteral:
713
751
  Enabled: false
714
752
  Style/TrailingMethodEndStatement:
@@ -719,16 +757,6 @@ Style/TrivialAccessors:
719
757
  Enabled: false
720
758
  Style/UnlessElse:
721
759
  Enabled: false
722
- Style/UnneededCapitalW:
723
- Enabled: false
724
- Style/UnneededCondition:
725
- Enabled: false
726
- Style/UnneededInterpolation:
727
- Enabled: false
728
- Style/UnneededPercentQ:
729
- Enabled: false
730
- Style/UnneededSort:
731
- Enabled: false
732
760
  Style/UnpackFirst:
733
761
  Enabled: false
734
762
  Style/VariableInterpolation:
@@ -35,6 +35,7 @@ AllCops:
35
35
  - '**/*.watchr'
36
36
  - '**/.irbrc'
37
37
  - '**/.pryrc'
38
+ - '**/.simplecov'
38
39
  - '**/buildfile'
39
40
  - '**/Appraisals'
40
41
  - '**/Berksfile'
@@ -53,12 +54,15 @@ AllCops:
53
54
  - '**/Podfile'
54
55
  - '**/Puppetfile'
55
56
  - '**/Rakefile'
57
+ - '**/rakefile'
56
58
  - '**/Snapfile'
59
+ - '**/Steepfile'
57
60
  - '**/Thorfile'
58
61
  - '**/Vagabondfile'
59
62
  - '**/Vagrantfile'
60
63
  Exclude:
61
64
  - 'node_modules/**/*'
65
+ - 'tmp/**/*'
62
66
  - 'vendor/**/*'
63
67
  - '.git/**/*'
64
68
  # Default formatter will be used if no `-f/--format` option is given.
@@ -95,6 +99,14 @@ AllCops:
95
99
  # to true in the same configuration.
96
100
  EnabledByDefault: false
97
101
  DisabledByDefault: false
102
+ # New cops introduced between major versions are set to a special pending status
103
+ # and are not enabled by default with warning message.
104
+ # Change this behavior by overriding either `NewCops: enable` or `NewCops: disable`.
105
+ # When `NewCops` is `enable`, pending cops are enabled in bulk. Can be overridden by
106
+ # the `--enable-pending-cops` command-line option.
107
+ # When `NewCops` is `disable`, pending cops are disabled in bulk. Can be overridden by
108
+ # the `--disable-pending-cops` command-line option.
109
+ NewCops: pending
98
110
  # Enables the result cache if `true`. Can be overridden by the `--cache` command
99
111
  # line option.
100
112
  UseCache: true
@@ -123,7 +135,7 @@ AllCops:
123
135
  # followed by the Gemfile.lock or gems.locked file. (Although the Ruby version
124
136
  # is specified in the Gemfile or gems.rb file, RuboCop reads the final value
125
137
  # from the lock file.) If the Ruby version is still unresolved, RuboCop will
126
- # use the oldest officially supported Ruby version (currently Ruby 2.3).
138
+ # use the oldest officially supported Ruby version (currently Ruby 2.4).
127
139
  TargetRubyVersion: ~
128
140
 
129
141
  #################### Bundler ###############################
@@ -141,11 +153,13 @@ Bundler/GemComment:
141
153
  Description: 'Add a comment describing each gem.'
142
154
  Enabled: false
143
155
  VersionAdded: '0.59'
156
+ VersionChanged: '0.85'
144
157
  Include:
145
158
  - '**/*.gemfile'
146
159
  - '**/Gemfile'
147
160
  - '**/gems.rb'
148
- Whitelist: []
161
+ IgnoredGems: []
162
+ OnlyFor: []
149
163
 
150
164
  Bundler/InsecureProtocolSource:
151
165
  Description: >-
@@ -195,9 +209,10 @@ Gemspec/RequiredRubyVersion:
195
209
  VersionAdded: '0.52'
196
210
  Include:
197
211
  - '**/*.gemspec'
198
- -
212
+
199
213
  Gemspec/RubyVersionGlobalsUsage:
200
214
  Description: Checks usage of RUBY_VERSION in gemspec.
215
+ StyleGuide: '#no-ruby-version-in-the-gemspec'
201
216
  Enabled: true
202
217
  VersionAdded: '0.72'
203
218
  Include:
@@ -218,13 +233,14 @@ Layout/AccessModifierIndentation:
218
233
  # But it can be overridden by setting this parameter
219
234
  IndentationWidth: ~
220
235
 
221
- Layout/AlignArguments:
236
+ Layout/ArgumentAlignment:
222
237
  Description: >-
223
238
  Align the arguments of a method call if they span more
224
239
  than one line.
225
240
  StyleGuide: '#no-double-indent'
226
241
  Enabled: true
227
242
  VersionAdded: '0.68'
243
+ VersionChanged: '0.77'
228
244
  # Alignment of arguments in multi-line method calls.
229
245
  #
230
246
  # The `with_first_argument` style aligns the following lines along the same
@@ -246,120 +262,46 @@ Layout/AlignArguments:
246
262
  # But it can be overridden by setting this parameter
247
263
  IndentationWidth: ~
248
264
 
249
- Layout/AlignArray:
265
+ Layout/ArrayAlignment:
250
266
  Description: >-
251
267
  Align the elements of an array literal if they span more than
252
268
  one line.
253
- StyleGuide: '#align-multiline-arrays'
254
- Enabled: true
255
- VersionAdded: '0.49'
256
-
257
- Layout/AlignHash:
258
- Description: >-
259
- Align the elements of a hash literal if they span more than
260
- one line.
261
- Enabled: true
262
- AllowMultipleStyles: true
263
- 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
269
  StyleGuide: '#no-double-indent'
339
270
  Enabled: true
340
271
  VersionAdded: '0.49'
341
- VersionChanged: '0.68'
342
- # Alignment of parameters in multi-line method calls.
272
+ VersionChanged: '0.77'
273
+ # Alignment of elements of a multi-line array.
343
274
  #
344
275
  # The `with_first_parameter` style aligns the following lines along the same
345
- # column as the first parameter.
276
+ # column as the first element.
346
277
  #
347
- # def method_foo(a,
348
- # b)
278
+ # array = [1, 2, 3,
279
+ # 4, 5, 6]
349
280
  #
350
281
  # 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.
282
+ # level of indentation relative to the start of the line with start of array.
352
283
  #
353
- # def method_foo(a,
354
- # b)
355
- EnforcedStyle: with_first_parameter
284
+ # array = [1, 2, 3,
285
+ # 4, 5, 6]
286
+ EnforcedStyle: with_first_element
356
287
  SupportedStyles:
357
- - with_first_parameter
288
+ - with_first_element
358
289
  - with_fixed_indentation
359
290
  # By default, the indentation width from Layout/IndentationWidth is used
360
291
  # But it can be overridden by setting this parameter
361
292
  IndentationWidth: ~
362
293
 
294
+ Layout/AssignmentIndentation:
295
+ Description: >-
296
+ Checks the indentation of the first line of the
297
+ right-hand-side of a multi-line assignment.
298
+ Enabled: true
299
+ VersionAdded: '0.49'
300
+ VersionChanged: '0.77'
301
+ # By default, the indentation width from `Layout/IndentationWidth` is used
302
+ # But it can be overridden by setting this parameter
303
+ IndentationWidth: ~
304
+
363
305
  Layout/BlockAlignment:
364
306
  Description: 'Align block ends correctly.'
365
307
  Enabled: true
@@ -436,6 +378,7 @@ Layout/ConditionPosition:
436
378
  StyleGuide: '#same-line-condition'
437
379
  Enabled: true
438
380
  VersionAdded: '0.53'
381
+ VersionChanged: '0.83'
439
382
 
440
383
  Layout/DefEndAlignment:
441
384
  Description: 'Align ends corresponding to defs correctly.'
@@ -521,6 +464,19 @@ Layout/EmptyLinesAroundArguments:
521
464
  Enabled: true
522
465
  VersionAdded: '0.52'
523
466
 
467
+ Layout/EmptyLinesAroundAttributeAccessor:
468
+ Description: "Keep blank lines around attribute accessors."
469
+ StyleGuide: '#empty-lines-around-attribute-accessor'
470
+ Enabled: pending
471
+ VersionAdded: '0.83'
472
+ VersionChanged: '0.84'
473
+ AllowAliasSyntax: true
474
+ AllowedMethods:
475
+ - alias_method
476
+ - public
477
+ - protected
478
+ - private
479
+
524
480
  Layout/EmptyLinesAroundBeginBody:
525
481
  Description: "Keeps track of empty lines around begin-end bodies."
526
482
  StyleGuide: '#empty-lines-around-bodies'
@@ -624,56 +580,11 @@ Layout/ExtraSpacing:
624
580
  # When true, forces the alignment of `=` in assignments on consecutive lines.
625
581
  ForceEqualSignAlignment: false
626
582
 
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:
583
+ Layout/FirstArgumentIndentation:
674
584
  Description: 'Checks the indentation of the first argument in a method call.'
675
585
  Enabled: true
676
586
  VersionAdded: '0.68'
587
+ VersionChanged: '0.77'
677
588
  EnforcedStyle: special_for_inner_method_call_in_parentheses
678
589
  SupportedStyles:
679
590
  # The first parameter should always be indented one step more than the
@@ -694,12 +605,13 @@ Layout/IndentFirstArgument:
694
605
  # But it can be overridden by setting this parameter
695
606
  IndentationWidth: ~
696
607
 
697
- Layout/IndentFirstArrayElement:
608
+ Layout/FirstArrayElementIndentation:
698
609
  Description: >-
699
610
  Checks the indentation of the first element in an array
700
611
  literal.
701
612
  Enabled: true
702
613
  VersionAdded: '0.68'
614
+ VersionChanged: '0.77'
703
615
  # The value `special_inside_parentheses` means that array literals with
704
616
  # brackets that have their opening bracket on the same line as a surrounding
705
617
  # opening round parenthesis, shall have their first element indented relative
@@ -720,10 +632,18 @@ Layout/IndentFirstArrayElement:
720
632
  # But it can be overridden by setting this parameter
721
633
  IndentationWidth: ~
722
634
 
723
- Layout/IndentFirstHashElement:
635
+ Layout/FirstArrayElementLineBreak:
636
+ Description: >-
637
+ Checks for a line break before the first element in a
638
+ multi-line array.
639
+ Enabled: false
640
+ VersionAdded: '0.49'
641
+
642
+ Layout/FirstHashElementIndentation:
724
643
  Description: 'Checks the indentation of the first key in a hash literal.'
725
644
  Enabled: true
726
645
  VersionAdded: '0.68'
646
+ VersionChanged: '0.77'
727
647
  # The value `special_inside_parentheses` means that hash literals with braces
728
648
  # that have their opening brace on the same line as a surrounding opening
729
649
  # round parenthesis, shall have their first key indented relative to the
@@ -744,13 +664,34 @@ Layout/IndentFirstHashElement:
744
664
  # But it can be overridden by setting this parameter
745
665
  IndentationWidth: ~
746
666
 
747
- Layout/IndentFirstParameter:
667
+ Layout/FirstHashElementLineBreak:
668
+ Description: >-
669
+ Checks for a line break before the first element in a
670
+ multi-line hash.
671
+ Enabled: false
672
+ VersionAdded: '0.49'
673
+
674
+ Layout/FirstMethodArgumentLineBreak:
675
+ Description: >-
676
+ Checks for a line break before the first argument in a
677
+ multi-line method call.
678
+ Enabled: false
679
+ VersionAdded: '0.49'
680
+
681
+ Layout/FirstMethodParameterLineBreak:
682
+ Description: >-
683
+ Checks for a line break before the first parameter in a
684
+ multi-line method parameter definition.
685
+ Enabled: false
686
+ VersionAdded: '0.49'
687
+
688
+ Layout/FirstParameterIndentation:
748
689
  Description: >-
749
690
  Checks the indentation of the first parameter in a
750
691
  method definition.
751
692
  Enabled: true
752
693
  VersionAdded: '0.49'
753
- VersionChanged: '0.68'
694
+ VersionChanged: '0.77'
754
695
  EnforcedStyle: consistent
755
696
  SupportedStyles:
756
697
  - consistent
@@ -759,18 +700,98 @@ Layout/IndentFirstParameter:
759
700
  # But it can be overridden by setting this parameter
760
701
  IndentationWidth: ~
761
702
 
762
- Layout/IndentHeredoc:
703
+ Layout/HashAlignment:
704
+ Description: >-
705
+ Align the elements of a hash literal if they span more than
706
+ one line.
707
+ Enabled: true
708
+ AllowMultipleStyles: true
709
+ VersionAdded: '0.49'
710
+ VersionChanged: '0.77'
711
+ # Alignment of entries using hash rocket as separator. Valid values are:
712
+ #
713
+ # key - left alignment of keys
714
+ # 'a' => 2
715
+ # 'bb' => 3
716
+ # separator - alignment of hash rockets, keys are right aligned
717
+ # 'a' => 2
718
+ # 'bb' => 3
719
+ # table - left alignment of keys, hash rockets, and values
720
+ # 'a' => 2
721
+ # 'bb' => 3
722
+ EnforcedHashRocketStyle: key
723
+ SupportedHashRocketStyles:
724
+ - key
725
+ - separator
726
+ - table
727
+ # Alignment of entries using colon as separator. Valid values are:
728
+ #
729
+ # key - left alignment of keys
730
+ # a: 0
731
+ # bb: 1
732
+ # separator - alignment of colons, keys are right aligned
733
+ # a: 0
734
+ # bb: 1
735
+ # table - left alignment of keys and values
736
+ # a: 0
737
+ # bb: 1
738
+ EnforcedColonStyle: key
739
+ SupportedColonStyles:
740
+ - key
741
+ - separator
742
+ - table
743
+ # Select whether hashes that are the last argument in a method call should be
744
+ # inspected? Valid values are:
745
+ #
746
+ # always_inspect - Inspect both implicit and explicit hashes.
747
+ # Registers an offense for:
748
+ # function(a: 1,
749
+ # b: 2)
750
+ # Registers an offense for:
751
+ # function({a: 1,
752
+ # b: 2})
753
+ # always_ignore - Ignore both implicit and explicit hashes.
754
+ # Accepts:
755
+ # function(a: 1,
756
+ # b: 2)
757
+ # Accepts:
758
+ # function({a: 1,
759
+ # b: 2})
760
+ # ignore_implicit - Ignore only implicit hashes.
761
+ # Accepts:
762
+ # function(a: 1,
763
+ # b: 2)
764
+ # Registers an offense for:
765
+ # function({a: 1,
766
+ # b: 2})
767
+ # ignore_explicit - Ignore only explicit hashes.
768
+ # Accepts:
769
+ # function({a: 1,
770
+ # b: 2})
771
+ # Registers an offense for:
772
+ # function(a: 1,
773
+ # b: 2)
774
+ EnforcedLastArgumentHashStyle: always_inspect
775
+ SupportedLastArgumentHashStyles:
776
+ - always_inspect
777
+ - always_ignore
778
+ - ignore_implicit
779
+ - ignore_explicit
780
+
781
+ Layout/HeredocArgumentClosingParenthesis:
782
+ Description: >-
783
+ Checks for the placement of the closing parenthesis in a
784
+ method call that passes a HEREDOC string as an argument.
785
+ Enabled: false
786
+ StyleGuide: '#heredoc-argument-closing-parentheses'
787
+ VersionAdded: '0.68'
788
+
789
+ Layout/HeredocIndentation:
763
790
  Description: 'This cop checks the indentation of the here document bodies.'
764
791
  StyleGuide: '#squiggly-heredocs'
765
792
  Enabled: true
766
793
  VersionAdded: '0.49'
767
- VersionChanged: '0.69'
768
- EnforcedStyle: squiggly
769
- SupportedStyles:
770
- - squiggly
771
- - active_support
772
- - powerpack
773
- - unindent
794
+ VersionChanged: '0.85'
774
795
 
775
796
  Layout/IndentationConsistency:
776
797
  Description: 'Keep indentation straight.'
@@ -791,6 +812,22 @@ Layout/IndentationConsistency:
791
812
  # A reference to `EnforcedStyle: indented_internal_methods`.
792
813
  - https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions
793
814
 
815
+ Layout/IndentationStyle:
816
+ Description: 'Consistent indentation either with tabs only or spaces only.'
817
+ StyleGuide: '#spaces-indentation'
818
+ Enabled: true
819
+ VersionAdded: '0.49'
820
+ VersionChanged: '0.82'
821
+ # By default, the indentation width from Layout/IndentationWidth is used
822
+ # But it can be overridden by setting this parameter
823
+ # It is used during auto-correction to determine how many spaces should
824
+ # replace each tab.
825
+ IndentationWidth: ~
826
+ EnforcedStyle: spaces
827
+ SupportedStyles:
828
+ - spaces
829
+ - tabs
830
+
794
831
  Layout/IndentationWidth:
795
832
  Description: 'Use 2 spaces for indentation.'
796
833
  StyleGuide: '#spaces-indentation'
@@ -806,11 +843,6 @@ Layout/InitialIndentation:
806
843
  Enabled: true
807
844
  VersionAdded: '0.49'
808
845
 
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
846
  Layout/LeadingCommentSpace:
815
847
  Description: 'Comments should start with a space.'
816
848
  StyleGuide: '#hash-space'
@@ -818,6 +850,36 @@ Layout/LeadingCommentSpace:
818
850
  VersionAdded: '0.49'
819
851
  VersionChanged: '0.73'
820
852
  AllowDoxygenCommentStyle: false
853
+ AllowGemfileRubyComment: false
854
+
855
+ Layout/LeadingEmptyLines:
856
+ Description: Check for unnecessary blank lines at the beginning of a file.
857
+ Enabled: true
858
+ VersionAdded: '0.57'
859
+ VersionChanged: '0.77'
860
+
861
+ Layout/LineLength:
862
+ Description: 'Checks that line length does not exceed the configured limit.'
863
+ StyleGuide: '#max-line-length'
864
+ Enabled: true
865
+ VersionAdded: '0.25'
866
+ VersionChanged: '0.84'
867
+ AutoCorrect: false
868
+ Max: 120
869
+ # To make it possible to copy or click on URIs in the code, we allow lines
870
+ # containing a URI to be longer than Max.
871
+ AllowHeredoc: true
872
+ AllowURI: true
873
+ URISchemes:
874
+ - http
875
+ - https
876
+ # The IgnoreCopDirectives option causes the LineLength rule to ignore cop
877
+ # directives like '# rubocop: enable ...' when calculating a line's length.
878
+ IgnoreCopDirectives: true
879
+ # The IgnoredPatterns option is a list of !ruby/regexp and/or string
880
+ # elements. Strings will be converted to Regexp objects. A line that matches
881
+ # any regular expression listed in this option will be ignored by LineLength.
882
+ IgnoredPatterns: []
821
883
 
822
884
  Layout/MultilineArrayBraceLayout:
823
885
  Description: >-
@@ -954,9 +1016,38 @@ Layout/MultilineOperationIndentation:
954
1016
  VersionAdded: '0.49'
955
1017
  EnforcedStyle: aligned
956
1018
  SupportedStyles:
957
- - aligned
958
- - indented
959
- # By default, the indentation width from `Layout/IndentationWidth` is used
1019
+ - aligned
1020
+ - indented
1021
+ # By default, the indentation width from `Layout/IndentationWidth` is used
1022
+ # But it can be overridden by setting this parameter
1023
+ IndentationWidth: ~
1024
+
1025
+ Layout/ParameterAlignment:
1026
+ Description: >-
1027
+ Align the parameters of a method definition if they span more
1028
+ than one line.
1029
+ StyleGuide: '#no-double-indent'
1030
+ Enabled: true
1031
+ VersionAdded: '0.49'
1032
+ VersionChanged: '0.77'
1033
+ # Alignment of parameters in multi-line method calls.
1034
+ #
1035
+ # The `with_first_parameter` style aligns the following lines along the same
1036
+ # column as the first parameter.
1037
+ #
1038
+ # def method_foo(a,
1039
+ # b)
1040
+ #
1041
+ # The `with_fixed_indentation` style aligns the following lines with one
1042
+ # level of indentation relative to the start of the line with the method call.
1043
+ #
1044
+ # def method_foo(a,
1045
+ # b)
1046
+ EnforcedStyle: with_first_parameter
1047
+ SupportedStyles:
1048
+ - with_first_parameter
1049
+ - with_fixed_indentation
1050
+ # By default, the indentation width from Layout/IndentationWidth is used
960
1051
  # But it can be overridden by setting this parameter
961
1052
  IndentationWidth: ~
962
1053
 
@@ -1024,6 +1115,11 @@ Layout/SpaceAroundKeyword:
1024
1115
  Enabled: true
1025
1116
  VersionAdded: '0.49'
1026
1117
 
1118
+ Layout/SpaceAroundMethodCallOperator:
1119
+ Description: 'Checks method call operators to not have spaces around them.'
1120
+ Enabled: pending
1121
+ VersionAdded: '0.82'
1122
+
1027
1123
  Layout/SpaceAroundOperators:
1028
1124
  Description: 'Use a single space around operators.'
1029
1125
  StyleGuide: '#spaces-operators'
@@ -1033,6 +1129,10 @@ Layout/SpaceAroundOperators:
1033
1129
  # with an operator on the previous or next line, not counting empty lines
1034
1130
  # or comment lines.
1035
1131
  AllowForAlignment: true
1132
+ EnforcedStyleForExponentOperator: no_space
1133
+ SupportedStylesForExponentOperator:
1134
+ - space
1135
+ - no_space
1036
1136
 
1037
1137
  Layout/SpaceBeforeBlockBraces:
1038
1138
  Description: >-
@@ -1190,23 +1290,12 @@ Layout/SpaceInsideStringInterpolation:
1190
1290
  - space
1191
1291
  - no_space
1192
1292
 
1193
- Layout/Tab:
1194
- Description: 'No hard tabs.'
1195
- StyleGuide: '#spaces-indentation'
1196
- Enabled: true
1197
- VersionAdded: '0.49'
1198
- VersionChanged: '0.51'
1199
- # By default, the indentation width from Layout/IndentationWidth is used
1200
- # But it can be overridden by setting this parameter
1201
- # It is used during auto-correction to determine how many spaces should
1202
- # replace each tab.
1203
- IndentationWidth: ~
1204
-
1205
- Layout/TrailingBlankLines:
1293
+ Layout/TrailingEmptyLines:
1206
1294
  Description: 'Checks trailing blank lines and final newline.'
1207
1295
  StyleGuide: '#newline-eof'
1208
1296
  Enabled: true
1209
1297
  VersionAdded: '0.49'
1298
+ VersionChanged: '0.77'
1210
1299
  EnforcedStyle: final_newline
1211
1300
  SupportedStyles:
1212
1301
  - final_newline
@@ -1217,8 +1306,8 @@ Layout/TrailingWhitespace:
1217
1306
  StyleGuide: '#no-trailing-whitespace'
1218
1307
  Enabled: true
1219
1308
  VersionAdded: '0.49'
1220
- VersionChanged: '0.55'
1221
- AllowInHeredoc: false
1309
+ VersionChanged: '0.83'
1310
+ AllowInHeredoc: true
1222
1311
 
1223
1312
  #################### Lint ##################################
1224
1313
  ### Warnings
@@ -1238,6 +1327,7 @@ Lint/AmbiguousOperator:
1238
1327
  StyleGuide: '#method-invocation-parens'
1239
1328
  Enabled: true
1240
1329
  VersionAdded: '0.17'
1330
+ VersionChanged: '0.83'
1241
1331
 
1242
1332
  Lint/AmbiguousRegexpLiteral:
1243
1333
  Description: >-
@@ -1245,6 +1335,7 @@ Lint/AmbiguousRegexpLiteral:
1245
1335
  a method invocation without parentheses.
1246
1336
  Enabled: true
1247
1337
  VersionAdded: '0.17'
1338
+ VersionChanged: '0.83'
1248
1339
 
1249
1340
  Lint/AssignmentInCondition:
1250
1341
  Description: "Don't use assignment in conditions."
@@ -1261,7 +1352,9 @@ Lint/BigDecimalNew:
1261
1352
  Lint/BooleanSymbol:
1262
1353
  Description: 'Check for `:true` and `:false` symbols.'
1263
1354
  Enabled: true
1355
+ Safe: false
1264
1356
  VersionAdded: '0.50'
1357
+ VersionChanged: '0.83'
1265
1358
 
1266
1359
  Lint/CircularArgumentReference:
1267
1360
  Description: "Default values in optional keyword arguments and optional ordinal arguments should not refer back to the name of the argument."
@@ -1279,6 +1372,11 @@ Lint/DeprecatedClassMethods:
1279
1372
  Enabled: true
1280
1373
  VersionAdded: '0.19'
1281
1374
 
1375
+ Lint/DeprecatedOpenSSLConstant:
1376
+ Description: "Don't use algorithm constants for `OpenSSL::Cipher` and `OpenSSL::Digest`."
1377
+ Enabled: pending
1378
+ VersionAdded: '0.84'
1379
+
1282
1380
  Lint/DisjunctiveAssignmentInConstructor:
1283
1381
  Description: 'In constructor, plain assignment is preferred over disjunctive.'
1284
1382
  Enabled: true
@@ -1290,16 +1388,17 @@ Lint/DuplicateCaseCondition:
1290
1388
  Enabled: true
1291
1389
  VersionAdded: '0.45'
1292
1390
 
1391
+ Lint/DuplicateHashKey:
1392
+ Description: 'Check for duplicate keys in hash literals.'
1393
+ Enabled: true
1394
+ VersionAdded: '0.34'
1395
+ VersionChanged: '0.77'
1396
+
1293
1397
  Lint/DuplicateMethods:
1294
1398
  Description: 'Check for duplicate method definitions.'
1295
1399
  Enabled: true
1296
1400
  VersionAdded: '0.29'
1297
1401
 
1298
- Lint/DuplicatedKey:
1299
- Description: 'Check for duplicate keys in hash literals.'
1300
- Enabled: true
1301
- VersionAdded: '0.34'
1302
-
1303
1402
  Lint/EachWithObjectArgument:
1304
1403
  Description: 'Check for immutable argument given to each_with_object.'
1305
1404
  Enabled: true
@@ -1331,18 +1430,16 @@ Lint/EmptyInterpolation:
1331
1430
  Lint/EmptyWhen:
1332
1431
  Description: 'Checks for `when` branches with empty bodies.'
1333
1432
  Enabled: true
1433
+ AllowComments: true
1334
1434
  VersionAdded: '0.45'
1335
-
1336
- Lint/EndInMethod:
1337
- Description: 'END blocks should not be placed inside method definitions.'
1338
- Enabled: true
1339
- VersionAdded: '0.9'
1435
+ VersionChanged: '0.83'
1340
1436
 
1341
1437
  Lint/EnsureReturn:
1342
1438
  Description: 'Do not use return in an ensure block.'
1343
1439
  StyleGuide: '#no-return-ensure'
1344
1440
  Enabled: true
1345
1441
  VersionAdded: '0.9'
1442
+ VersionChanged: '0.83'
1346
1443
 
1347
1444
  Lint/ErbNewArguments:
1348
1445
  Description: 'Use `:trim_mode` and `:eoutvar` keyword arguments to `ERB.new`.'
@@ -1367,14 +1464,6 @@ Lint/FormatParameterMismatch:
1367
1464
  Enabled: true
1368
1465
  VersionAdded: '0.33'
1369
1466
 
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
1467
  Lint/HeredocMethodCallPosition:
1379
1468
  Description: >-
1380
1469
  Checks for the ordering of a method call where
@@ -1444,10 +1533,16 @@ Lint/MissingCopEnableDirective:
1444
1533
  # .inf for any size
1445
1534
  MaximumRangeSize: .inf
1446
1535
 
1447
- Lint/MultipleCompare:
1448
- Description: "Use `&&` operator to compare multiple value."
1536
+ Lint/MixedRegexpCaptureTypes:
1537
+ Description: 'Do not mix named captures and numbered captures in a Regexp literal.'
1538
+ Enabled: pending
1539
+ VersionAdded: '0.85'
1540
+
1541
+ Lint/MultipleComparison:
1542
+ Description: "Use `&&` operator to compare multiple values."
1449
1543
  Enabled: true
1450
1544
  VersionAdded: '0.47'
1545
+ VersionChanged: '0.77'
1451
1546
 
1452
1547
  Lint/NestedMethodDefinition:
1453
1548
  Description: 'Do not use nested method definitions.'
@@ -1467,6 +1562,12 @@ Lint/NextWithoutAccumulator:
1467
1562
  Enabled: true
1468
1563
  VersionAdded: '0.36'
1469
1564
 
1565
+ Lint/NonDeterministicRequireOrder:
1566
+ Description: 'Always sort arrays returned by Dir.glob when requiring files.'
1567
+ Enabled: true
1568
+ VersionAdded: '0.78'
1569
+ Safe: false
1570
+
1470
1571
  Lint/NonLocalExitFromIterator:
1471
1572
  Description: 'Do not use return in iterator to cause non-local exit.'
1472
1573
  Enabled: true
@@ -1491,6 +1592,7 @@ Lint/ParenthesesAsGroupedExpression:
1491
1592
  StyleGuide: '#parens-no-spaces'
1492
1593
  Enabled: true
1493
1594
  VersionAdded: '0.12'
1595
+ VersionChanged: '0.83'
1494
1596
 
1495
1597
  Lint/PercentStringArray:
1496
1598
  Description: >-
@@ -1505,6 +1607,14 @@ Lint/PercentSymbolArray:
1505
1607
  Enabled: true
1506
1608
  VersionAdded: '0.41'
1507
1609
 
1610
+ Lint/RaiseException:
1611
+ Description: Checks for `raise` or `fail` statements which are raising `Exception` class.
1612
+ StyleGuide: '#raise-exception'
1613
+ Enabled: pending
1614
+ VersionAdded: '0.81'
1615
+ AllowedImplicitNamespaces:
1616
+ - 'Gem'
1617
+
1508
1618
  Lint/RandOne:
1509
1619
  Description: >-
1510
1620
  Checks for `rand(1)` calls. Such calls always return `0`
@@ -1512,6 +1622,36 @@ Lint/RandOne:
1512
1622
  Enabled: true
1513
1623
  VersionAdded: '0.36'
1514
1624
 
1625
+ Lint/RedundantCopDisableDirective:
1626
+ Description: >-
1627
+ Checks for rubocop:disable comments that can be removed.
1628
+ Note: this cop is not disabled when disabling all cops.
1629
+ It must be explicitly disabled.
1630
+ Enabled: true
1631
+ VersionAdded: '0.76'
1632
+
1633
+ Lint/RedundantCopEnableDirective:
1634
+ Description: Checks for rubocop:enable comments that can be removed.
1635
+ Enabled: true
1636
+ VersionAdded: '0.76'
1637
+
1638
+ Lint/RedundantRequireStatement:
1639
+ Description: 'Checks for unnecessary `require` statement.'
1640
+ Enabled: true
1641
+ VersionAdded: '0.76'
1642
+
1643
+ Lint/RedundantSplatExpansion:
1644
+ Description: 'Checks for splat unnecessarily being called on literals.'
1645
+ Enabled: true
1646
+ VersionAdded: '0.76'
1647
+
1648
+ Lint/RedundantStringCoercion:
1649
+ Description: 'Checks for Object#to_s usage in string interpolation.'
1650
+ StyleGuide: '#no-to-s'
1651
+ Enabled: true
1652
+ VersionAdded: '0.19'
1653
+ VersionChanged: '0.77'
1654
+
1515
1655
  Lint/RedundantWithIndex:
1516
1656
  Description: 'Checks for redundant `with_index`.'
1517
1657
  Enabled: true
@@ -1557,8 +1697,8 @@ Lint/SafeNavigationChain:
1557
1697
  Description: 'Do not chain ordinary method call after safe navigation operator.'
1558
1698
  Enabled: true
1559
1699
  VersionAdded: '0.47'
1560
- VersionChanged: '0.56'
1561
- Whitelist:
1700
+ VersionChanged: '0.77'
1701
+ AllowedMethods:
1562
1702
  - present?
1563
1703
  - blank?
1564
1704
  - presence
@@ -1572,14 +1712,14 @@ Lint/SafeNavigationConsistency:
1572
1712
  for all method calls on that same object.
1573
1713
  Enabled: true
1574
1714
  VersionAdded: '0.55'
1575
- Whitelist:
1715
+ VersionChanged: '0.77'
1716
+ AllowedMethods:
1576
1717
  - present?
1577
1718
  - blank?
1578
1719
  - presence
1579
1720
  - try
1580
1721
  - try!
1581
1722
 
1582
-
1583
1723
  Lint/SafeNavigationWithEmpty:
1584
1724
  Description: 'Avoid `foo&.empty?` in conditionals.'
1585
1725
  Enabled: true
@@ -1617,12 +1757,18 @@ Lint/ShadowingOuterLocalVariable:
1617
1757
  Enabled: true
1618
1758
  VersionAdded: '0.9'
1619
1759
 
1620
- Lint/StringConversionInInterpolation:
1621
- Description: 'Checks for Object#to_s usage in string interpolation.'
1622
- StyleGuide: '#no-to-s'
1760
+ Lint/StructNewOverride:
1761
+ Description: 'Disallow overriding the `Struct` built-in methods via `Struct.new`.'
1762
+ Enabled: pending
1763
+ VersionAdded: '0.81'
1764
+
1765
+ Lint/SuppressedException:
1766
+ Description: "Don't suppress exceptions."
1767
+ StyleGuide: '#dont-hide-exceptions'
1623
1768
  Enabled: true
1624
- VersionAdded: '0.19'
1625
- VersionChanged: '0.20'
1769
+ AllowComments: true
1770
+ VersionAdded: '0.9'
1771
+ VersionChanged: '0.81'
1626
1772
 
1627
1773
  Lint/Syntax:
1628
1774
  Description: 'Checks syntax error.'
@@ -1633,6 +1779,7 @@ Lint/Syntax:
1633
1779
  Lint/ToJSON:
1634
1780
  Description: 'Ensure #to_json includes an optional argument.'
1635
1781
  Enabled: true
1782
+ VersionAdded: '0.66'
1636
1783
 
1637
1784
  Lint/UnderscorePrefixedVariableName:
1638
1785
  Description: 'Do not use prefix `_` for a variable that is used.'
@@ -1645,30 +1792,6 @@ Lint/UnifiedInteger:
1645
1792
  Enabled: true
1646
1793
  VersionAdded: '0.43'
1647
1794
 
1648
- Lint/UnneededCopDisableDirective:
1649
- Description: >-
1650
- Checks for rubocop:disable comments that can be removed.
1651
- Note: this cop is not disabled when disabling all cops.
1652
- It must be explicitly disabled.
1653
- Enabled: true
1654
- VersionAdded: '0.53'
1655
-
1656
- Lint/UnneededCopEnableDirective:
1657
- Description: Checks for rubocop:enable comments that can be removed.
1658
- Enabled: true
1659
- VersionAdded: '0.53'
1660
-
1661
- Lint/UnneededRequireStatement:
1662
- Description: 'Checks for unnecessary `require` statement.'
1663
- Enabled: true
1664
- VersionAdded: '0.51'
1665
-
1666
- Lint/UnneededSplatExpansion:
1667
- Description: 'Checks for splat unnecessarily being called on literals.'
1668
- Enabled: true
1669
- VersionAdded: '0.43'
1670
- VersionChanged: '0.74'
1671
-
1672
1795
  Lint/UnreachableCode:
1673
1796
  Description: 'Unreachable code.'
1674
1797
  Enabled: true
@@ -1688,9 +1811,10 @@ Lint/UnusedMethodArgument:
1688
1811
  StyleGuide: '#underscore-unused-vars'
1689
1812
  Enabled: true
1690
1813
  VersionAdded: '0.21'
1691
- VersionChanged: '0.35'
1814
+ VersionChanged: '0.81'
1692
1815
  AllowUnusedKeywordArguments: false
1693
1816
  IgnoreEmptyMethods: true
1817
+ IgnoreNotImplementedMethods: true
1694
1818
 
1695
1819
  Lint/UriEscapeUnescape:
1696
1820
  Description: >-
@@ -1712,7 +1836,7 @@ Lint/UselessAccessModifier:
1712
1836
  Description: 'Checks for useless access modifiers.'
1713
1837
  Enabled: true
1714
1838
  VersionAdded: '0.20'
1715
- VersionChanged: '0.47'
1839
+ VersionChanged: '0.83'
1716
1840
  ContextCreatingMethods: []
1717
1841
  MethodCreatingMethods: []
1718
1842
 
@@ -1736,6 +1860,8 @@ Lint/UselessSetterCall:
1736
1860
  Description: 'Checks for useless setter call to a local variable.'
1737
1861
  Enabled: true
1738
1862
  VersionAdded: '0.13'
1863
+ VersionChanged: '0.80'
1864
+ Safe: false
1739
1865
 
1740
1866
  Lint/Void:
1741
1867
  Description: 'Possible use of operator/literal/variable in void context.'
@@ -1754,9 +1880,10 @@ Metrics/AbcSize:
1754
1880
  - https://en.wikipedia.org/wiki/ABC_Software_Metric
1755
1881
  Enabled: true
1756
1882
  VersionAdded: '0.27'
1757
- VersionChanged: '0.66'
1883
+ VersionChanged: '0.81'
1758
1884
  # The ABC size is a calculated magnitude, so this number can be an Integer or
1759
1885
  # a Float.
1886
+ IgnoredMethods: []
1760
1887
  Max: 15
1761
1888
 
1762
1889
  Metrics/BlockLength:
@@ -1796,31 +1923,10 @@ Metrics/CyclomaticComplexity:
1796
1923
  of test cases needed to validate a method.
1797
1924
  Enabled: true
1798
1925
  VersionAdded: '0.25'
1926
+ VersionChanged: '0.81'
1927
+ IgnoredMethods: []
1799
1928
  Max: 6
1800
1929
 
1801
- Metrics/LineLength:
1802
- Description: 'Limit lines to 80 characters.'
1803
- StyleGuide: '#80-character-limits'
1804
- Enabled: true
1805
- VersionAdded: '0.25'
1806
- VersionChanged: '0.68'
1807
- AutoCorrect: false
1808
- Max: 80
1809
- # To make it possible to copy or click on URIs in the code, we allow lines
1810
- # containing a URI to be longer than Max.
1811
- AllowHeredoc: true
1812
- AllowURI: true
1813
- URISchemes:
1814
- - http
1815
- - https
1816
- # The IgnoreCopDirectives option causes the LineLength rule to ignore cop
1817
- # directives like '# rubocop: enable ...' when calculating a line's length.
1818
- IgnoreCopDirectives: true
1819
- # The IgnoredPatterns option is a list of !ruby/regexp and/or string
1820
- # elements. Strings will be converted to Regexp objects. A line that matches
1821
- # any regular expression listed in this option will be ignored by LineLength.
1822
- IgnoredPatterns: []
1823
-
1824
1930
  Metrics/MethodLength:
1825
1931
  Description: 'Avoid methods longer than 10 lines of code.'
1826
1932
  StyleGuide: '#short-methods'
@@ -1852,6 +1958,8 @@ Metrics/PerceivedComplexity:
1852
1958
  human reader.
1853
1959
  Enabled: true
1854
1960
  VersionAdded: '0.25'
1961
+ VersionChanged: '0.81'
1962
+ IgnoredMethods: []
1855
1963
  Max: 7
1856
1964
 
1857
1965
  ################## Migration #############################
@@ -1860,7 +1968,8 @@ Migration/DepartmentName:
1860
1968
  Description: >-
1861
1969
  Check that cop names in rubocop:disable (etc) comments are
1862
1970
  given with department name.
1863
- Enabled: false
1971
+ Enabled: true
1972
+ VersionAdded: '0.75'
1864
1973
 
1865
1974
  #################### Naming ##############################
1866
1975
 
@@ -1882,11 +1991,31 @@ Naming/BinaryOperatorParameterName:
1882
1991
  Enabled: true
1883
1992
  VersionAdded: '0.50'
1884
1993
 
1994
+ Naming/BlockParameterName:
1995
+ Description: >-
1996
+ Checks for block parameter names that contain capital letters,
1997
+ end in numbers, or do not meet a minimal length.
1998
+ Enabled: true
1999
+ VersionAdded: '0.53'
2000
+ VersionChanged: '0.77'
2001
+ # Parameter names may be equal to or greater than this value
2002
+ MinNameLength: 1
2003
+ AllowNamesEndingInNumbers: true
2004
+ # Allowed names that will not register an offense
2005
+ AllowedNames: []
2006
+ # Forbidden names that will register an offense
2007
+ ForbiddenNames: []
2008
+
1885
2009
  Naming/ClassAndModuleCamelCase:
1886
2010
  Description: 'Use CamelCase for classes and modules.'
1887
2011
  StyleGuide: '#camelcase-classes'
1888
2012
  Enabled: true
1889
2013
  VersionAdded: '0.50'
2014
+ VersionChanged: '0.85'
2015
+ # Allowed class/module names can be specified here.
2016
+ # These can be full or part of the name.
2017
+ AllowedNames:
2018
+ - module_parent
1890
2019
 
1891
2020
  Naming/ConstantName:
1892
2021
  Description: 'Constants should use SCREAMING_SNAKE_CASE.'
@@ -1907,6 +2036,10 @@ Naming/FileName:
1907
2036
  # It further expects it to be nested inside modules which match the names
1908
2037
  # of subdirectories in its path.
1909
2038
  ExpectMatchingDefinition: false
2039
+ # When `false`, changes the behavior of ExpectMatchingDefinition to match only
2040
+ # whether each source file's class or module name matches the file name --
2041
+ # not whether the nested module hierarchy matches the subdirectory path.
2042
+ CheckDefinitionPathHierarchy: true
1910
2043
  # If non-`nil`, expect all source file names to match the following regex.
1911
2044
  # Only the file name itself is matched, not the entire file path.
1912
2045
  # Use anchors as necessary if you want to match the entire name rather than
@@ -1973,7 +2106,7 @@ Naming/HeredocDelimiterNaming:
1973
2106
  StyleGuide: '#heredoc-delimiters'
1974
2107
  Enabled: true
1975
2108
  VersionAdded: '0.50'
1976
- Blacklist:
2109
+ ForbiddenDelimiters:
1977
2110
  - !ruby/regexp '/(^|\s)(EO[A-Z]{1}|END)(\s|$)/'
1978
2111
 
1979
2112
  Naming/MemoizedInstanceVariableName:
@@ -2005,25 +2138,51 @@ Naming/MethodName:
2005
2138
  #
2006
2139
  IgnoredPatterns: []
2007
2140
 
2141
+ Naming/MethodParameterName:
2142
+ Description: >-
2143
+ Checks for method parameter names that contain capital letters,
2144
+ end in numbers, or do not meet a minimal length.
2145
+ Enabled: true
2146
+ VersionAdded: '0.53'
2147
+ VersionChanged: '0.77'
2148
+ # Parameter names may be equal to or greater than this value
2149
+ MinNameLength: 3
2150
+ AllowNamesEndingInNumbers: true
2151
+ # Allowed names that will not register an offense
2152
+ AllowedNames:
2153
+ - io
2154
+ - id
2155
+ - to
2156
+ - by
2157
+ - 'on'
2158
+ - in
2159
+ - at
2160
+ - ip
2161
+ - db
2162
+ - os
2163
+ - pp
2164
+ # Forbidden names that will register an offense
2165
+ ForbiddenNames: []
2166
+
2008
2167
  Naming/PredicateName:
2009
2168
  Description: 'Check the names of predicate methods.'
2010
2169
  StyleGuide: '#bool-methods-qmark'
2011
2170
  Enabled: true
2012
2171
  VersionAdded: '0.50'
2013
- VersionChanged: '0.51'
2172
+ VersionChanged: '0.77'
2014
2173
  # Predicate name prefixes.
2015
2174
  NamePrefix:
2016
2175
  - is_
2017
2176
  - has_
2018
2177
  - have_
2019
2178
  # Predicate name prefixes that should be removed.
2020
- NamePrefixBlacklist:
2179
+ ForbiddenPrefixes:
2021
2180
  - is_
2022
2181
  - has_
2023
2182
  - have_
2024
- # Predicate names which, despite having a blacklisted prefix, or no `?`,
2183
+ # Predicate names which, despite having a forbidden prefix, or no `?`,
2025
2184
  # should still be accepted
2026
- NameWhitelist:
2185
+ AllowedMethods:
2027
2186
  - is_a?
2028
2187
  # Method definition macros for dynamically generated methods.
2029
2188
  MethodDefinitionMacros:
@@ -2041,45 +2200,6 @@ Naming/RescuedExceptionsVariableName:
2041
2200
  VersionChanged: '0.68'
2042
2201
  PreferredName: e
2043
2202
 
2044
- Naming/UncommunicativeBlockParamName:
2045
- Description: >-
2046
- Checks for block parameter names that contain capital letters,
2047
- end in numbers, or do not meet a minimal length.
2048
- Enabled: true
2049
- VersionAdded: '0.53'
2050
- # Parameter names may be equal to or greater than this value
2051
- MinNameLength: 1
2052
- AllowNamesEndingInNumbers: true
2053
- # Whitelisted names that will not register an offense
2054
- AllowedNames: []
2055
- # Blacklisted names that will register an offense
2056
- ForbiddenNames: []
2057
-
2058
- Naming/UncommunicativeMethodParamName:
2059
- Description: >-
2060
- Checks for method parameter names that contain capital letters,
2061
- end in numbers, or do not meet a minimal length.
2062
- Enabled: true
2063
- VersionAdded: '0.53'
2064
- VersionChanged: '0.59'
2065
- # Parameter names may be equal to or greater than this value
2066
- MinNameLength: 3
2067
- AllowNamesEndingInNumbers: true
2068
- # Whitelisted names that will not register an offense
2069
- AllowedNames:
2070
- - io
2071
- - id
2072
- - to
2073
- - by
2074
- - 'on'
2075
- - in
2076
- - at
2077
- - ip
2078
- - db
2079
- # Blacklisted names that will register an offense
2080
- ForbiddenNames: []
2081
-
2082
-
2083
2203
  Naming/VariableName:
2084
2204
  Description: 'Use the configured style when naming variables.'
2085
2205
  StyleGuide: '#snake-case-symbols-methods-vars'
@@ -2111,7 +2231,7 @@ Security/JSONLoad:
2111
2231
  Description: >-
2112
2232
  Prefer usage of `JSON.parse` over `JSON.load` due to potential
2113
2233
  security issues. See reference for more information.
2114
- Reference: 'https://ruby-doc.org/stdlib-2.3.0/libdoc/json/rdoc/JSON.html#method-i-load'
2234
+ Reference: 'https://ruby-doc.org/stdlib-2.7.0/libdoc/json/rdoc/JSON.html#method-i-load'
2115
2235
  Enabled: true
2116
2236
  VersionAdded: '0.43'
2117
2237
  VersionChanged: '0.44'
@@ -2124,7 +2244,7 @@ Security/MarshalLoad:
2124
2244
  Description: >-
2125
2245
  Avoid using of `Marshal.load` or `Marshal.restore` due to potential
2126
2246
  security issues. See reference for more information.
2127
- Reference: 'https://ruby-doc.org/core-2.3.3/Marshal.html#module-Marshal-label-Security+considerations'
2247
+ Reference: 'https://ruby-doc.org/core-2.7.0/Marshal.html#module-Marshal-label-Security+considerations'
2128
2248
  Enabled: true
2129
2249
  VersionAdded: '0.47'
2130
2250
 
@@ -2138,7 +2258,7 @@ Security/YAMLLoad:
2138
2258
  Description: >-
2139
2259
  Prefer usage of `YAML.safe_load` over `YAML.load` due to potential
2140
2260
  security issues. See reference for more information.
2141
- Reference: 'https://ruby-doc.org/stdlib-2.3.3/libdoc/yaml/rdoc/YAML.html#module-YAML-label-Security'
2261
+ Reference: 'https://ruby-doc.org/stdlib-2.7.0/libdoc/yaml/rdoc/YAML.html#module-YAML-label-Security'
2142
2262
  Enabled: true
2143
2263
  VersionAdded: '0.47'
2144
2264
  SafeAutoCorrect: false
@@ -2149,10 +2269,12 @@ Style/AccessModifierDeclarations:
2149
2269
  Description: 'Checks style of how access modifiers are used.'
2150
2270
  Enabled: true
2151
2271
  VersionAdded: '0.57'
2272
+ VersionChanged: '0.81'
2152
2273
  EnforcedStyle: group
2153
2274
  SupportedStyles:
2154
2275
  - inline
2155
2276
  - group
2277
+ AllowModifiersOnSymbols: true
2156
2278
 
2157
2279
  Style/Alias:
2158
2280
  Description: 'Use alias instead of alias_method.'
@@ -2173,7 +2295,7 @@ Style/AndOr:
2173
2295
  VersionChanged: '0.25'
2174
2296
  # Whether `and` and `or` are banned only in conditionals (conditionals)
2175
2297
  # or completely (always).
2176
- EnforcedStyle: always
2298
+ EnforcedStyle: conditionals
2177
2299
  SupportedStyles:
2178
2300
  - always
2179
2301
  - conditionals
@@ -2331,30 +2453,27 @@ Style/BlockDelimiters:
2331
2453
  # # also good
2332
2454
  # collection.each do |element| puts element end
2333
2455
  AllowBracesOnProceduralOneLiners: false
2334
-
2335
- Style/BracesAroundHashParameters:
2336
- Description: 'Enforce braces style around hash parameters.'
2337
- Enabled: true
2338
- VersionAdded: '0.14.1'
2339
- VersionChanged: '0.28'
2340
- EnforcedStyle: no_braces
2341
- SupportedStyles:
2342
- # The `braces` style enforces braces around all method parameters that are
2343
- # hashes.
2344
- - braces
2345
- # The `no_braces` style checks that the last parameter doesn't have braces
2346
- # around it.
2347
- - no_braces
2348
- # The `context_dependent` style checks that the last parameter doesn't have
2349
- # braces around it, but requires braces if the second to last parameter is
2350
- # also a hash literal.
2351
- - context_dependent
2456
+ # The BracesRequiredMethods overrides all other configurations except
2457
+ # IgnoredMethods. It can be used to enforce that all blocks for specific
2458
+ # methods use braces. For example, you can use this to enforce Sorbet
2459
+ # signatures use braces even when the rest of your codebase enforces
2460
+ # the `line_count_based` style.
2461
+ BracesRequiredMethods: []
2352
2462
 
2353
2463
  Style/CaseEquality:
2354
2464
  Description: 'Avoid explicit use of the case equality operator(===).'
2355
2465
  StyleGuide: '#no-case-equality'
2356
2466
  Enabled: true
2357
2467
  VersionAdded: '0.9'
2468
+ # If AllowOnConstant is enabled, the cop will ignore violations when the receiver of
2469
+ # the case equality operator is a constant.
2470
+ #
2471
+ # # bad
2472
+ # /string/ === "string"
2473
+ #
2474
+ # # good
2475
+ # String === "string"
2476
+ AllowOnConstant: false
2358
2477
 
2359
2478
  Style/CharacterLiteral:
2360
2479
  Description: 'Checks for uses of character literals.'
@@ -2395,6 +2514,7 @@ Style/ClassAndModuleChildren:
2395
2514
 
2396
2515
  Style/ClassCheck:
2397
2516
  Description: 'Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.'
2517
+ StyleGuide: '#is-a-vs-kind-of'
2398
2518
  Enabled: true
2399
2519
  VersionAdded: '0.24'
2400
2520
  EnforcedStyle: is_a?
@@ -2418,7 +2538,7 @@ Style/ClassVars:
2418
2538
  # Align with the style guide.
2419
2539
  Style/CollectionMethods:
2420
2540
  Description: 'Preferred collection methods.'
2421
- StyleGuide: '#map-find-select-reduce-size'
2541
+ StyleGuide: '#map-find-select-reduce-include-size'
2422
2542
  Enabled: false
2423
2543
  VersionAdded: '0.9'
2424
2544
  VersionChanged: '0.27'
@@ -2435,6 +2555,7 @@ Style/CollectionMethods:
2435
2555
  inject: 'reduce'
2436
2556
  detect: 'find'
2437
2557
  find_all: 'select'
2558
+ member?: 'include?'
2438
2559
 
2439
2560
  Style/ColonMethodCall:
2440
2561
  Description: 'Do not use :: for method call.'
@@ -2561,6 +2682,12 @@ Style/Dir:
2561
2682
  Enabled: true
2562
2683
  VersionAdded: '0.50'
2563
2684
 
2685
+ Style/DisableCopsWithinSourceCodeDirective:
2686
+ Description: >-
2687
+ Forbids disabling/enabling cops within source code.
2688
+ Enabled: false
2689
+ VersionAdded: '0.82'
2690
+
2564
2691
  Style/Documentation:
2565
2692
  Description: 'Document classes and non-namespace modules.'
2566
2693
  Enabled: true
@@ -2588,6 +2715,11 @@ Style/DoubleNegation:
2588
2715
  StyleGuide: '#no-bang-bang'
2589
2716
  Enabled: true
2590
2717
  VersionAdded: '0.19'
2718
+ VersionChanged: '0.84'
2719
+ EnforcedStyle: allowed_in_returns
2720
+ SupportedStyles:
2721
+ - allowed_in_returns
2722
+ - forbidden
2591
2723
 
2592
2724
  Style/EachForSimpleLoop:
2593
2725
  Description: >-
@@ -2660,6 +2792,7 @@ Style/EndBlock:
2660
2792
  StyleGuide: '#no-END-blocks'
2661
2793
  Enabled: true
2662
2794
  VersionAdded: '0.9'
2795
+ VersionChanged: '0.81'
2663
2796
 
2664
2797
  Style/EvalWithLocation:
2665
2798
  Description: 'Pass `__FILE__` and `__LINE__` to `eval` method, as they are used by backtraces.'
@@ -2678,6 +2811,17 @@ Style/ExpandPathArguments:
2678
2811
  Enabled: true
2679
2812
  VersionAdded: '0.53'
2680
2813
 
2814
+ Style/ExponentialNotation:
2815
+ Description: 'When using exponential notation, favor a mantissa between 1 (inclusive) and 10 (exclusive).'
2816
+ StyleGuide: '#exponential-notation'
2817
+ Enabled: pending
2818
+ VersionAdded: '0.82'
2819
+ EnforcedStyle: scientific
2820
+ SupportedStyles:
2821
+ - scientific
2822
+ - engineering
2823
+ - integral
2824
+
2681
2825
  Style/FloatDivision:
2682
2826
  Description: 'For performing float division, coerce one side only.'
2683
2827
  StyleGuide: '#float-division'
@@ -2734,17 +2878,21 @@ Style/FrozenStringLiteralComment:
2734
2878
  to help transition to frozen string literals by default.
2735
2879
  Enabled: true
2736
2880
  VersionAdded: '0.36'
2737
- VersionChanged: '0.69'
2881
+ VersionChanged: '0.79'
2738
2882
  EnforcedStyle: always
2739
2883
  SupportedStyles:
2740
2884
  # `always` will always add the frozen string literal comment to a file
2741
2885
  # regardless of the Ruby version or if `freeze` or `<<` are called on a
2742
- # string literal. If you run code against multiple versions of Ruby, it is
2743
- # possible that this will create errors in Ruby 2.3.0+.
2886
+ # string literal. It is possible that this will create errors.
2744
2887
  - always
2888
+ # `always_true` will add the frozen string literal comment to a file,
2889
+ # similarly to the `always` style, but will also change any disabled
2890
+ # comments (e.g. `# frozen_string_literal: false`) to be enabled.
2891
+ - always_true
2745
2892
  # `never` will enforce that the frozen string literal comment does not
2746
2893
  # exist in a file.
2747
2894
  - never
2895
+ Safe: false
2748
2896
 
2749
2897
  Style/GlobalVars:
2750
2898
  Description: 'Do not introduce global variables.'
@@ -2765,6 +2913,13 @@ Style/GuardClause:
2765
2913
  # needs to have to trigger this cop
2766
2914
  MinBodyLength: 1
2767
2915
 
2916
+ Style/HashEachMethods:
2917
+ Description: 'Use Hash#each_key and Hash#each_value.'
2918
+ StyleGuide: '#hash-each'
2919
+ Enabled: pending
2920
+ VersionAdded: '0.80'
2921
+ Safe: false
2922
+
2768
2923
  Style/HashSyntax:
2769
2924
  Description: >-
2770
2925
  Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
@@ -2788,6 +2943,18 @@ Style/HashSyntax:
2788
2943
  # Do not suggest { a?: 1 } over { :a? => 1 } in ruby19 style
2789
2944
  PreferHashRocketsForNonAlnumEndingSymbols: false
2790
2945
 
2946
+ Style/HashTransformKeys:
2947
+ Description: 'Prefer `transform_keys` over `each_with_object` and `map`.'
2948
+ Enabled: 'pending'
2949
+ VersionAdded: '0.80'
2950
+ Safe: false
2951
+
2952
+ Style/HashTransformValues:
2953
+ Description: 'Prefer `transform_values` over `each_with_object` and `map`.'
2954
+ Enabled: 'pending'
2955
+ VersionAdded: '0.80'
2956
+ Safe: false
2957
+
2791
2958
  Style/IdenticalConditionalBranches:
2792
2959
  Description: >-
2793
2960
  Checks that conditional statements do not have an identical
@@ -2822,6 +2989,7 @@ Style/IfWithSemicolon:
2822
2989
  StyleGuide: '#no-semicolon-ifs'
2823
2990
  Enabled: true
2824
2991
  VersionAdded: '0.9'
2992
+ VersionChanged: '0.83'
2825
2993
 
2826
2994
  Style/ImplicitRuntimeError:
2827
2995
  Description: >-
@@ -2874,8 +3042,9 @@ Style/IpAddresses:
2874
3042
  Description: "Don't include literal IP addresses in code."
2875
3043
  Enabled: false
2876
3044
  VersionAdded: '0.58'
2877
- # Allow strings to be whitelisted
2878
- Whitelist:
3045
+ VersionChanged: '0.77'
3046
+ # Allow addresses to be permitted
3047
+ AllowedAddresses:
2879
3048
  - "::"
2880
3049
  # :: is a valid IPv6 address, but could potentially be legitimately in code
2881
3050
 
@@ -2895,7 +3064,7 @@ Style/LambdaCall:
2895
3064
  Description: 'Use lambda.call(...) instead of lambda.(...).'
2896
3065
  StyleGuide: '#proc-call'
2897
3066
  Enabled: true
2898
- VersionAdded: '0.13.1'
3067
+ VersionAdded: '0.13'
2899
3068
  VersionChanged: '0.14'
2900
3069
  EnforcedStyle: call
2901
3070
  SupportedStyles:
@@ -3025,6 +3194,7 @@ Style/ModuleFunction:
3025
3194
  SupportedStyles:
3026
3195
  - module_function
3027
3196
  - extend_self
3197
+ - forbidden
3028
3198
  Autocorrect: false
3029
3199
  SafeAutoCorrect: false
3030
3200
 
@@ -3148,8 +3318,8 @@ Style/NestedParenthesizedCalls:
3148
3318
  argument list of another parenthesized method call.
3149
3319
  Enabled: true
3150
3320
  VersionAdded: '0.36'
3151
- VersionChanged: '0.50'
3152
- Whitelist:
3321
+ VersionChanged: '0.77'
3322
+ AllowedMethods:
3153
3323
  - be
3154
3324
  - be_a
3155
3325
  - be_an
@@ -3297,7 +3467,9 @@ Style/OptionalArguments:
3297
3467
  of the argument list.
3298
3468
  StyleGuide: '#optional-arguments'
3299
3469
  Enabled: true
3470
+ Safe: false
3300
3471
  VersionAdded: '0.33'
3472
+ VersionChanged: '0.83'
3301
3473
 
3302
3474
  Style/OrAssignment:
3303
3475
  Description: 'Recommend usage of double pipe equals (||=) where applicable.'
@@ -3402,6 +3574,16 @@ Style/RedundantBegin:
3402
3574
  VersionAdded: '0.10'
3403
3575
  VersionChanged: '0.21'
3404
3576
 
3577
+ Style/RedundantCapitalW:
3578
+ Description: 'Checks for %W when interpolation is not needed.'
3579
+ Enabled: true
3580
+ VersionAdded: '0.76'
3581
+
3582
+ Style/RedundantCondition:
3583
+ Description: 'Checks for unnecessary conditional expressions.'
3584
+ Enabled: true
3585
+ VersionAdded: '0.76'
3586
+
3405
3587
  Style/RedundantConditional:
3406
3588
  Description: "Don't return true/false from a conditional."
3407
3589
  Enabled: true
@@ -3420,11 +3602,32 @@ Style/RedundantFreeze:
3420
3602
  VersionAdded: '0.34'
3421
3603
  VersionChanged: '0.66'
3422
3604
 
3605
+ Style/RedundantInterpolation:
3606
+ Description: 'Checks for strings that are just an interpolated expression.'
3607
+ Enabled: true
3608
+ VersionAdded: '0.76'
3609
+
3423
3610
  Style/RedundantParentheses:
3424
3611
  Description: "Checks for parentheses that seem not to serve any purpose."
3425
3612
  Enabled: true
3426
3613
  VersionAdded: '0.36'
3427
3614
 
3615
+ Style/RedundantPercentQ:
3616
+ Description: 'Checks for %q/%Q when single quotes or double quotes would do.'
3617
+ StyleGuide: '#percent-q'
3618
+ Enabled: true
3619
+ VersionAdded: '0.76'
3620
+
3621
+ Style/RedundantRegexpCharacterClass:
3622
+ Description: 'Checks for unnecessary single-element Regexp character classes.'
3623
+ Enabled: pending
3624
+ VersionAdded: '0.85'
3625
+
3626
+ Style/RedundantRegexpEscape:
3627
+ Description: 'Checks for redundant escapes in Regexps.'
3628
+ Enabled: pending
3629
+ VersionAdded: '0.85'
3630
+
3428
3631
  Style/RedundantReturn:
3429
3632
  Description: "Don't use return where it's not required."
3430
3633
  StyleGuide: '#no-explicit-return'
@@ -3441,6 +3644,13 @@ Style/RedundantSelf:
3441
3644
  VersionAdded: '0.10'
3442
3645
  VersionChanged: '0.13'
3443
3646
 
3647
+ Style/RedundantSort:
3648
+ Description: >-
3649
+ Use `min` instead of `sort.first`,
3650
+ `max_by` instead of `sort_by...last`, etc.
3651
+ Enabled: true
3652
+ VersionAdded: '0.76'
3653
+
3444
3654
  Style/RedundantSortBy:
3445
3655
  Description: 'Use `sort` instead of `sort_by { |x| x }`.'
3446
3656
  Enabled: true
@@ -3498,11 +3708,11 @@ Style/SafeNavigation:
3498
3708
  safe navigation (`&.`).
3499
3709
  Enabled: true
3500
3710
  VersionAdded: '0.43'
3501
- VersionChanged: '0.56'
3711
+ VersionChanged: '0.77'
3502
3712
  # Safe navigation may cause a statement to start returning `nil` in addition
3503
3713
  # to whatever it used to return.
3504
3714
  ConvertCodeThatCanStartToReturnNil: false
3505
- Whitelist:
3715
+ AllowedMethods:
3506
3716
  - present?
3507
3717
  - blank?
3508
3718
  - presence
@@ -3574,6 +3784,12 @@ Style/SingleLineMethods:
3574
3784
  VersionChanged: '0.19'
3575
3785
  AllowIfMethodIsEmpty: true
3576
3786
 
3787
+ Style/SlicingWithRange:
3788
+ Description: 'Checks array slicing is done with endless ranges when suitable.'
3789
+ Enabled: pending
3790
+ VersionAdded: '0.83'
3791
+ Safe: false
3792
+
3577
3793
  Style/SpecialGlobalVars:
3578
3794
  Description: 'Avoid Perl-style global variables.'
3579
3795
  StyleGuide: '#no-cryptic-perlisms'
@@ -3736,22 +3952,29 @@ Style/TrailingCommaInArrayLiteral:
3736
3952
  StyleGuide: '#no-trailing-array-commas'
3737
3953
  Enabled: true
3738
3954
  VersionAdded: '0.53'
3955
+ # If `comma`, the cop requires a comma after the last item in an array,
3739
3956
  # but only when each item is on its own line.
3740
3957
  # If `consistent_comma`, the cop requires a comma after the last item of all
3741
- # non-empty array literals.
3958
+ # non-empty, multiline array literals.
3742
3959
  EnforcedStyleForMultiline: no_comma
3743
3960
  SupportedStylesForMultiline:
3744
3961
  - comma
3745
3962
  - consistent_comma
3746
3963
  - no_comma
3747
3964
 
3965
+ Style/TrailingCommaInBlockArgs:
3966
+ Description: 'Checks for useless trailing commas in block arguments.'
3967
+ Enabled: false
3968
+ Safe: false
3969
+ VersionAdded: '0.81'
3970
+
3748
3971
  Style/TrailingCommaInHashLiteral:
3749
3972
  Description: 'Checks for trailing comma in hash literals.'
3750
3973
  Enabled: true
3751
3974
  # If `comma`, the cop requires a comma after the last item in a hash,
3752
3975
  # but only when each item is on its own line.
3753
3976
  # If `consistent_comma`, the cop requires a comma after the last item of all
3754
- # non-empty hash literals.
3977
+ # non-empty, multiline hash literals.
3755
3978
  EnforcedStyleForMultiline: no_comma
3756
3979
  SupportedStylesForMultiline:
3757
3980
  - comma
@@ -3780,7 +4003,7 @@ Style/TrivialAccessors:
3780
4003
  StyleGuide: '#attr_family'
3781
4004
  Enabled: true
3782
4005
  VersionAdded: '0.9'
3783
- VersionChanged: '0.38'
4006
+ VersionChanged: '0.77'
3784
4007
  # When set to `false` the cop will suggest the use of accessor methods
3785
4008
  # in situations like:
3786
4009
  #
@@ -3801,7 +4024,7 @@ Style/TrivialAccessors:
3801
4024
  # Commonly used in DSLs
3802
4025
  AllowDSLWriters: false
3803
4026
  IgnoreClassMethods: false
3804
- Whitelist:
4027
+ AllowedMethods:
3805
4028
  - to_ary
3806
4029
  - to_a
3807
4030
  - to_c
@@ -3828,35 +4051,6 @@ Style/UnlessElse:
3828
4051
  Enabled: true
3829
4052
  VersionAdded: '0.9'
3830
4053
 
3831
- Style/UnneededCapitalW:
3832
- Description: 'Checks for %W when interpolation is not needed.'
3833
- Enabled: true
3834
- VersionAdded: '0.21'
3835
- VersionChanged: '0.24'
3836
-
3837
- Style/UnneededCondition:
3838
- Description: 'Checks for unnecessary conditional expressions.'
3839
- Enabled: true
3840
- VersionAdded: '0.57'
3841
-
3842
- Style/UnneededInterpolation:
3843
- Description: 'Checks for strings that are just an interpolated expression.'
3844
- Enabled: true
3845
- VersionAdded: '0.36'
3846
-
3847
- Style/UnneededPercentQ:
3848
- Description: 'Checks for %q/%Q when single quotes or double quotes would do.'
3849
- StyleGuide: '#percent-q'
3850
- Enabled: true
3851
- VersionAdded: '0.24'
3852
-
3853
- Style/UnneededSort:
3854
- Description: >-
3855
- Use `min` instead of `sort.first`,
3856
- `max_by` instead of `sort_by...last`, etc.
3857
- Enabled: true
3858
- VersionAdded: '0.55'
3859
-
3860
4054
  Style/UnpackFirst:
3861
4055
  Description: >-
3862
4056
  Checks for accessing the first element of `String#unpack`