chefstyle 1.1.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/chefstyle +1 -2
- data/chefstyle.gemspec +1 -4
- data/config/chefstyle.yml +31 -7
- data/config/disable_all.yml +71 -5
- data/config/upstream.yml +306 -37
- data/lib/chefstyle.rb +11 -2
- data/lib/chefstyle/version.rb +3 -2
- data/lib/rubocop/chef.rb +11 -0
- data/lib/rubocop/cop/chef/ruby/gemspec_require_rubygems.rb +46 -0
- data/lib/rubocop/cop/chef/ruby/require_net_https.rb +54 -0
- data/lib/rubocop/cop/chef/ruby/ruby_27_keyword_argument_warnings.rb +57 -0
- data/lib/rubocop/cop/chef/ruby/unless_defined_require.rb +121 -0
- metadata +9 -46
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 53fa6bb2f80dbe12ea389014623ddc52076c9432383e533f21e5c571e069c14d
|
4
|
+
data.tar.gz: 064cdbbf2ba18a12b09e5db1d4a508bab1c27e36a91007e0c5e03aeaed14b36f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7cc1e3008f9624c9868f5d13d4a0010b932c4ce4a41d3b4368405c62b808acf34b712914b580e0334dbdfdb19510da7840866a0a126656ef84eb2a5b829c1f0f
|
7
|
+
data.tar.gz: 27707feacf6dcd7e0890d95a07fcab77d44d7bb474f56a5e6f4f1c363161683c48881946b920c660b5fe277bf18a8980cdc67379b458d242406803dd4d0c3be1
|
data/bin/chefstyle
CHANGED
data/chefstyle.gemspec
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
lib = File.expand_path("../lib", __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
4
|
require "chefstyle/version"
|
@@ -18,8 +18,5 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.executables = %w{chefstyle}
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_development_dependency "bundler"
|
22
|
-
spec.add_development_dependency "rake", ">= 12.0"
|
23
|
-
spec.add_development_dependency "rspec"
|
24
21
|
spec.add_dependency("rubocop", Chefstyle::RUBOCOP_VERSION)
|
25
22
|
end
|
data/config/chefstyle.yml
CHANGED
@@ -482,11 +482,15 @@ Style/WhileUntilModifier:
|
|
482
482
|
Style/WordArray:
|
483
483
|
Enabled: true
|
484
484
|
|
485
|
+
# we are ruby > 2.0 only so we can remove encoding comments for utf-8
|
486
|
+
Style/Encoding:
|
487
|
+
Enabled: true
|
488
|
+
|
485
489
|
#
|
486
490
|
# Disabled Style
|
487
491
|
#
|
488
492
|
|
489
|
-
#
|
493
|
+
# reduces memory usage, but isn't a simple autocorrect so we need to do this one project at a time
|
490
494
|
Style/FrozenStringLiteralComment:
|
491
495
|
Enabled: false
|
492
496
|
|
@@ -529,10 +533,6 @@ Style/FormatString:
|
|
529
533
|
Style/IfUnlessModifier:
|
530
534
|
Enabled: false
|
531
535
|
|
532
|
-
# we are ruby > 2.0 only so can disable the Encoding cop
|
533
|
-
Style/Encoding:
|
534
|
-
Enabled: false
|
535
|
-
|
536
536
|
# Dan is -1 on this one: https://github.com/chef/chef/pull/4526#issuecomment-179950045
|
537
537
|
Layout/IndentFirstHashElement:
|
538
538
|
Enabled: false
|
@@ -554,7 +554,7 @@ Style/RescueModifier:
|
|
554
554
|
Style/AsciiComments:
|
555
555
|
Enabled: false
|
556
556
|
|
557
|
-
# Parens around ternaries often make them more readable and reduces cognitive load over operator
|
557
|
+
# Parens around ternaries often make them more readable and reduces cognitive load over operator precedence
|
558
558
|
Style/TernaryParentheses:
|
559
559
|
Enabled: false
|
560
560
|
|
@@ -631,4 +631,28 @@ Style/CommentedKeyword:
|
|
631
631
|
|
632
632
|
# make sure we catch this Ruby 3.0 breaking change now
|
633
633
|
Lint/DeprecatedOpenSSLConstant:
|
634
|
-
Enabled: true
|
634
|
+
Enabled: true
|
635
|
+
|
636
|
+
ChefRuby/Ruby27KeywordArgumentWarnings:
|
637
|
+
Description: Pass options to shell_out helpers without the brackets to avoid Ruby 2.7 deprecation warnings.
|
638
|
+
Enabled: true
|
639
|
+
VersionAdded: '1.3.0'
|
640
|
+
|
641
|
+
ChefRuby/UnlessDefinedRequire:
|
642
|
+
Description: Workaround RubyGems' slow requires by only running require if the constant isn't already defined
|
643
|
+
Enabled: true
|
644
|
+
VersionAdded: '1.3.0'
|
645
|
+
Include:
|
646
|
+
- 'lib/**/*'
|
647
|
+
|
648
|
+
ChefRuby/GemspecRequireRubygems:
|
649
|
+
Description: Rubygems does not need to be required in a Gemspec
|
650
|
+
Enabled: true
|
651
|
+
VersionAdded: '1.3.0'
|
652
|
+
Include:
|
653
|
+
- '**/*.gemspec'
|
654
|
+
|
655
|
+
ChefRuby/RequireNetHttps:
|
656
|
+
Description: net/https is deprecated and just includes net/http and openssl. We should include those directly instead
|
657
|
+
Enabled: true
|
658
|
+
VersionAdded: '1.3.0'
|
data/config/disable_all.yml
CHANGED
@@ -53,6 +53,8 @@ Layout/EmptyLineAfterGuardClause:
|
|
53
53
|
Enabled: false
|
54
54
|
Layout/EmptyLineAfterMagicComment:
|
55
55
|
Enabled: false
|
56
|
+
Layout/EmptyLineAfterMultilineCondition:
|
57
|
+
Enabled: false
|
56
58
|
Layout/EmptyLineBetweenDefs:
|
57
59
|
Enabled: false
|
58
60
|
Layout/EmptyLinesAroundAccessModifier:
|
@@ -207,10 +209,14 @@ Lint/AssignmentInCondition:
|
|
207
209
|
Enabled: false
|
208
210
|
Lint/BigDecimalNew:
|
209
211
|
Enabled: false
|
212
|
+
Lint/BinaryOperatorWithIdenticalOperands:
|
213
|
+
Enabled: false
|
210
214
|
Lint/BooleanSymbol:
|
211
215
|
Enabled: false
|
212
216
|
Lint/CircularArgumentReference:
|
213
217
|
Enabled: false
|
218
|
+
Lint/ConstantResolution:
|
219
|
+
Enabled: false
|
214
220
|
Lint/Debugger:
|
215
221
|
Enabled: false
|
216
222
|
Lint/DeprecatedClassMethods:
|
@@ -221,18 +227,28 @@ Lint/DisjunctiveAssignmentInConstructor:
|
|
221
227
|
Enabled: false
|
222
228
|
Lint/DuplicateCaseCondition:
|
223
229
|
Enabled: false
|
230
|
+
Lint/DuplicateElsifCondition:
|
231
|
+
Enabled: false
|
224
232
|
Lint/DuplicateHashKey:
|
225
233
|
Enabled: false
|
226
234
|
Lint/DuplicateMethods:
|
227
235
|
Enabled: false
|
236
|
+
Lint/DuplicateRequire:
|
237
|
+
Enabled: false
|
238
|
+
Lint/DuplicateRescueException:
|
239
|
+
Enabled: false
|
228
240
|
Lint/EachWithObjectArgument:
|
229
241
|
Enabled: false
|
230
242
|
Lint/ElseLayout:
|
231
243
|
Enabled: false
|
244
|
+
Lint/EmptyConditionalBody:
|
245
|
+
Enabled: false
|
232
246
|
Lint/EmptyEnsure:
|
233
247
|
Enabled: false
|
234
248
|
Lint/EmptyExpression:
|
235
249
|
Enabled: false
|
250
|
+
Lint/EmptyFile:
|
251
|
+
Enabled: false
|
236
252
|
Lint/EmptyInterpolation:
|
237
253
|
Enabled: false
|
238
254
|
Lint/EmptyWhen:
|
@@ -243,6 +259,8 @@ Lint/ErbNewArguments:
|
|
243
259
|
Enabled: false
|
244
260
|
Lint/FlipFlop:
|
245
261
|
Enabled: false
|
262
|
+
Lint/FloatComparison:
|
263
|
+
Enabled: false
|
246
264
|
Lint/FloatOutOfRange:
|
247
265
|
Enabled: false
|
248
266
|
Lint/FormatParameterMismatch:
|
@@ -265,6 +283,8 @@ Lint/Loop:
|
|
265
283
|
Enabled: false
|
266
284
|
Lint/MissingCopEnableDirective:
|
267
285
|
Enabled: false
|
286
|
+
Lint/MissingSuper:
|
287
|
+
Enabled: false
|
268
288
|
Lint/MixedRegexpCaptureTypes:
|
269
289
|
Enabled: false
|
270
290
|
Lint/MultipleComparison:
|
@@ -283,6 +303,8 @@ Lint/NumberConversion:
|
|
283
303
|
Enabled: false
|
284
304
|
Lint/OrderedMagicComments:
|
285
305
|
Enabled: false
|
306
|
+
Lint/OutOfRangeRegexpRef:
|
307
|
+
Enabled: false
|
286
308
|
Lint/ParenthesesAsGroupedExpression:
|
287
309
|
Enabled: false
|
288
310
|
Lint/PercentStringArray:
|
@@ -325,6 +347,8 @@ Lint/SafeNavigationWithEmpty:
|
|
325
347
|
Enabled: false
|
326
348
|
Lint/ScriptPermission:
|
327
349
|
Enabled: false
|
350
|
+
Lint/SelfAssignment:
|
351
|
+
Enabled: false
|
328
352
|
Lint/SendWithMixinArgument:
|
329
353
|
Enabled: false
|
330
354
|
Lint/ShadowedArgument:
|
@@ -341,12 +365,18 @@ Lint/Syntax:
|
|
341
365
|
Enabled: false
|
342
366
|
Lint/ToJSON:
|
343
367
|
Enabled: false
|
368
|
+
Lint/TopLevelReturnWithArgument:
|
369
|
+
Enabled: false
|
370
|
+
Lint/TrailingCommaInAttributeDeclaration:
|
371
|
+
Enabled: false
|
344
372
|
Lint/UnderscorePrefixedVariableName:
|
345
373
|
Enabled: false
|
346
374
|
Lint/UnifiedInteger:
|
347
375
|
Enabled: false
|
348
376
|
Lint/UnreachableCode:
|
349
377
|
Enabled: false
|
378
|
+
Lint/UnreachableLoop:
|
379
|
+
Enabled: false
|
350
380
|
Lint/UnusedBlockArgument:
|
351
381
|
Enabled: false
|
352
382
|
Lint/UnusedMethodArgument:
|
@@ -359,10 +389,10 @@ Lint/UselessAccessModifier:
|
|
359
389
|
Enabled: false
|
360
390
|
Lint/UselessAssignment:
|
361
391
|
Enabled: false
|
362
|
-
Lint/UselessComparison:
|
363
|
-
Enabled: false
|
364
392
|
Lint/UselessElseWithoutRescue:
|
365
393
|
Enabled: false
|
394
|
+
Lint/UselessMethodDefinition:
|
395
|
+
Enabled: false
|
366
396
|
Lint/UselessSetterCall:
|
367
397
|
Enabled: false
|
368
398
|
Lint/Void:
|
@@ -419,10 +449,14 @@ Naming/VariableNumber:
|
|
419
449
|
Enabled: false
|
420
450
|
Style/AccessModifierDeclarations:
|
421
451
|
Enabled: false
|
452
|
+
Style/AccessorGrouping:
|
453
|
+
Enabled: false
|
422
454
|
Style/Alias:
|
423
455
|
Enabled: false
|
424
456
|
Style/AndOr:
|
425
457
|
Enabled: false
|
458
|
+
Style/ArrayCoercion:
|
459
|
+
Enabled: false
|
426
460
|
Style/ArrayJoin:
|
427
461
|
Enabled: false
|
428
462
|
Style/AsciiComments:
|
@@ -435,12 +469,16 @@ Style/BarePercentLiterals:
|
|
435
469
|
Enabled: false
|
436
470
|
Style/BeginBlock:
|
437
471
|
Enabled: false
|
472
|
+
Style/BisectedAttrAccessor:
|
473
|
+
Enabled: false
|
438
474
|
Style/BlockComments:
|
439
475
|
Enabled: false
|
440
476
|
Style/BlockDelimiters:
|
441
477
|
Enabled: false
|
442
478
|
Style/CaseEquality:
|
443
479
|
Enabled: false
|
480
|
+
Style/CaseLikeIf:
|
481
|
+
Enabled: false
|
444
482
|
Style/CharacterLiteral:
|
445
483
|
Enabled: false
|
446
484
|
Style/ClassAndModuleChildren:
|
@@ -449,6 +487,8 @@ Style/ClassCheck:
|
|
449
487
|
Enabled: false
|
450
488
|
Style/ClassMethods:
|
451
489
|
Enabled: false
|
490
|
+
Style/ClassMethodsDefinitions:
|
491
|
+
Enabled: false
|
452
492
|
Style/ClassVars:
|
453
493
|
Enabled: false
|
454
494
|
Style/CollectionMethods:
|
@@ -457,6 +497,8 @@ Style/ColonMethodCall:
|
|
457
497
|
Enabled: false
|
458
498
|
Style/ColonMethodDefinition:
|
459
499
|
Enabled: false
|
500
|
+
Style/CombinableLoops:
|
501
|
+
Enabled: false
|
460
502
|
Style/CommandLiteral:
|
461
503
|
Enabled: false
|
462
504
|
Style/CommentAnnotation:
|
@@ -511,6 +553,8 @@ Style/EvenOdd:
|
|
511
553
|
Enabled: false
|
512
554
|
Style/ExpandPathArguments:
|
513
555
|
Enabled: false
|
556
|
+
Style/ExplicitBlockArgument:
|
557
|
+
Enabled: false
|
514
558
|
Style/ExponentialNotation:
|
515
559
|
Enabled: false
|
516
560
|
Style/FloatDivision:
|
@@ -523,12 +567,18 @@ Style/FormatStringToken:
|
|
523
567
|
Enabled: false
|
524
568
|
Style/FrozenStringLiteralComment:
|
525
569
|
Enabled: false
|
570
|
+
Style/GlobalStdStream:
|
571
|
+
Enabled: false
|
526
572
|
Style/GlobalVars:
|
527
573
|
Enabled: false
|
528
574
|
Style/GuardClause:
|
529
575
|
Enabled: false
|
576
|
+
Style/HashAsLastArrayItem:
|
577
|
+
Enabled: false
|
530
578
|
Style/HashEachMethods:
|
531
579
|
Enabled: false
|
580
|
+
Style/HashLikeCase:
|
581
|
+
Enabled: false
|
532
582
|
Style/HashSyntax:
|
533
583
|
Enabled: false
|
534
584
|
Style/HashTransformKeys:
|
@@ -555,6 +605,8 @@ Style/InlineComment:
|
|
555
605
|
Enabled: false
|
556
606
|
Style/IpAddresses:
|
557
607
|
Enabled: false
|
608
|
+
Style/KeywordParametersOrder:
|
609
|
+
Enabled: false
|
558
610
|
Style/Lambda:
|
559
611
|
Enabled: false
|
560
612
|
Style/LambdaCall:
|
@@ -565,12 +617,20 @@ Style/MethodCallWithoutArgsParentheses:
|
|
565
617
|
Enabled: false
|
566
618
|
Style/MethodCallWithArgsParentheses:
|
567
619
|
Enabled: false
|
620
|
+
Style/RedundantAssignment:
|
621
|
+
Enabled: false
|
622
|
+
Style/RedundantFetchBlock:
|
623
|
+
Enabled: false
|
624
|
+
Style/RedundantFileExtensionInRequire:
|
625
|
+
Enabled: false
|
626
|
+
Style/RedundantSelfAssignment:
|
627
|
+
Enabled: false
|
628
|
+
Style/SoleNestedConditional:
|
629
|
+
Enabled: false
|
568
630
|
Style/MethodCalledOnDoEndBlock:
|
569
631
|
Enabled: false
|
570
632
|
Style/MethodDefParentheses:
|
571
633
|
Enabled: false
|
572
|
-
Style/MethodMissingSuper:
|
573
|
-
Enabled: false
|
574
634
|
Style/MinMax:
|
575
635
|
Enabled: false
|
576
636
|
Style/MissingElse:
|
@@ -635,6 +695,8 @@ Style/OptionHash:
|
|
635
695
|
Enabled: false
|
636
696
|
Style/OptionalArguments:
|
637
697
|
Enabled: false
|
698
|
+
Style/OptionalBooleanParameter:
|
699
|
+
Enabled: false
|
638
700
|
Style/ParallelAssignment:
|
639
701
|
Enabled: false
|
640
702
|
Style/ParenthesesAroundCondition:
|
@@ -703,6 +765,8 @@ Style/Send:
|
|
703
765
|
Enabled: false
|
704
766
|
Style/SignalException:
|
705
767
|
Enabled: false
|
768
|
+
Style/SingleArgumentDig:
|
769
|
+
Enabled: false
|
706
770
|
Style/SingleLineBlockParams:
|
707
771
|
Enabled: false
|
708
772
|
Style/SingleLineMethods:
|
@@ -715,6 +779,8 @@ Style/StabbyLambdaParentheses:
|
|
715
779
|
Enabled: false
|
716
780
|
Style/StderrPuts:
|
717
781
|
Enabled: false
|
782
|
+
Style/StringConcatenation:
|
783
|
+
Enabled: false
|
718
784
|
Style/StringHashKeys:
|
719
785
|
Enabled: false
|
720
786
|
Style/StringLiterals:
|
@@ -782,4 +848,4 @@ Security/MarshalLoad:
|
|
782
848
|
Security/Open:
|
783
849
|
Enabled: false
|
784
850
|
Security/YAMLLoad:
|
785
|
-
Enabled: false
|
851
|
+
Enabled: false
|
data/config/upstream.yml
CHANGED
@@ -180,6 +180,9 @@ Bundler/OrderedGems:
|
|
180
180
|
VersionAdded: '0.46'
|
181
181
|
VersionChanged: '0.47'
|
182
182
|
TreatCommentsAsGroupSeparators: true
|
183
|
+
# By default, "-" and "_" are ignored for order purposes.
|
184
|
+
# This can be overridden by setting this parameter to true.
|
185
|
+
ConsiderPunctuation: false
|
183
186
|
Include:
|
184
187
|
- '**/*.gemfile'
|
185
188
|
- '**/Gemfile'
|
@@ -200,13 +203,17 @@ Gemspec/OrderedDependencies:
|
|
200
203
|
Enabled: true
|
201
204
|
VersionAdded: '0.51'
|
202
205
|
TreatCommentsAsGroupSeparators: true
|
206
|
+
# By default, "-" and "_" are ignored for order purposes.
|
207
|
+
# This can be overridden by setting this parameter to true.
|
208
|
+
ConsiderPunctuation: false
|
203
209
|
Include:
|
204
210
|
- '**/*.gemspec'
|
205
211
|
|
206
212
|
Gemspec/RequiredRubyVersion:
|
207
|
-
Description: 'Checks that `required_ruby_version` of gemspec and `TargetRubyVersion` of .rubocop.yml
|
213
|
+
Description: 'Checks that `required_ruby_version` of gemspec is specified and equal to `TargetRubyVersion` of .rubocop.yml.'
|
208
214
|
Enabled: true
|
209
215
|
VersionAdded: '0.52'
|
216
|
+
VersionChanged: '0.89'
|
210
217
|
Include:
|
211
218
|
- '**/*.gemspec'
|
212
219
|
|
@@ -392,7 +399,6 @@ Layout/DefEndAlignment:
|
|
392
399
|
SupportedStylesAlignWith:
|
393
400
|
- start_of_line
|
394
401
|
- def
|
395
|
-
AutoCorrect: false
|
396
402
|
Severity: warning
|
397
403
|
|
398
404
|
Layout/DotPosition:
|
@@ -429,6 +435,14 @@ Layout/EmptyLineAfterMagicComment:
|
|
429
435
|
Enabled: true
|
430
436
|
VersionAdded: '0.49'
|
431
437
|
|
438
|
+
Layout/EmptyLineAfterMultilineCondition:
|
439
|
+
Description: 'Enforces empty line after multiline condition.'
|
440
|
+
# This is disabled, because this style is not very common in practice.
|
441
|
+
Enabled: false
|
442
|
+
VersionAdded: '0.90'
|
443
|
+
Reference:
|
444
|
+
- https://github.com/airbnb/ruby#multiline-if-newline
|
445
|
+
|
432
446
|
Layout/EmptyLineBetweenDefs:
|
433
447
|
Description: 'Use empty lines between defs.'
|
434
448
|
StyleGuide: '#empty-lines-between-methods'
|
@@ -548,7 +562,6 @@ Layout/EndAlignment:
|
|
548
562
|
- keyword
|
549
563
|
- variable
|
550
564
|
- start_of_line
|
551
|
-
AutoCorrect: false
|
552
565
|
Severity: warning
|
553
566
|
|
554
567
|
Layout/EndOfLine:
|
@@ -1228,7 +1241,7 @@ Layout/SpaceInsideBlockBraces:
|
|
1228
1241
|
|
1229
1242
|
Layout/SpaceInsideHashLiteralBraces:
|
1230
1243
|
Description: "Use spaces inside hash literal braces - or don't."
|
1231
|
-
StyleGuide: '#spaces-
|
1244
|
+
StyleGuide: '#spaces-braces'
|
1232
1245
|
Enabled: true
|
1233
1246
|
VersionAdded: '0.49'
|
1234
1247
|
EnforcedStyle: space
|
@@ -1349,6 +1362,12 @@ Lint/BigDecimalNew:
|
|
1349
1362
|
Enabled: true
|
1350
1363
|
VersionAdded: '0.53'
|
1351
1364
|
|
1365
|
+
Lint/BinaryOperatorWithIdenticalOperands:
|
1366
|
+
Description: 'This cop checks for places where binary operator has identical operands.'
|
1367
|
+
Enabled: pending
|
1368
|
+
Safe: false
|
1369
|
+
VersionAdded: '0.89'
|
1370
|
+
|
1352
1371
|
Lint/BooleanSymbol:
|
1353
1372
|
Description: 'Check for `:true` and `:false` symbols.'
|
1354
1373
|
Enabled: true
|
@@ -1361,6 +1380,15 @@ Lint/CircularArgumentReference:
|
|
1361
1380
|
Enabled: true
|
1362
1381
|
VersionAdded: '0.33'
|
1363
1382
|
|
1383
|
+
Lint/ConstantResolution:
|
1384
|
+
Description: 'Check that constants are fully qualified with `::`.'
|
1385
|
+
Enabled: false
|
1386
|
+
VersionAdded: '0.86'
|
1387
|
+
# Restrict this cop to only looking at certain names
|
1388
|
+
Only: []
|
1389
|
+
# Restrict this cop from only looking at certain names
|
1390
|
+
Ignore: []
|
1391
|
+
|
1364
1392
|
Lint/Debugger:
|
1365
1393
|
Description: 'Check for debugger calls.'
|
1366
1394
|
Enabled: true
|
@@ -1382,12 +1410,18 @@ Lint/DisjunctiveAssignmentInConstructor:
|
|
1382
1410
|
Enabled: true
|
1383
1411
|
Safe: false
|
1384
1412
|
VersionAdded: '0.62'
|
1413
|
+
VersionChanged: '0.88'
|
1385
1414
|
|
1386
1415
|
Lint/DuplicateCaseCondition:
|
1387
1416
|
Description: 'Do not repeat values in case conditionals.'
|
1388
1417
|
Enabled: true
|
1389
1418
|
VersionAdded: '0.45'
|
1390
1419
|
|
1420
|
+
Lint/DuplicateElsifCondition:
|
1421
|
+
Description: 'Do not repeat conditions used in if `elsif`.'
|
1422
|
+
Enabled: 'pending'
|
1423
|
+
VersionAdded: '0.88'
|
1424
|
+
|
1391
1425
|
Lint/DuplicateHashKey:
|
1392
1426
|
Description: 'Check for duplicate keys in hash literals.'
|
1393
1427
|
Enabled: true
|
@@ -1399,6 +1433,16 @@ Lint/DuplicateMethods:
|
|
1399
1433
|
Enabled: true
|
1400
1434
|
VersionAdded: '0.29'
|
1401
1435
|
|
1436
|
+
Lint/DuplicateRequire:
|
1437
|
+
Description: 'Check for duplicate `require`s and `require_relative`s.'
|
1438
|
+
Enabled: pending
|
1439
|
+
VersionAdded: '0.90'
|
1440
|
+
|
1441
|
+
Lint/DuplicateRescueException:
|
1442
|
+
Description: 'Checks that there are no repeated exceptions used in `rescue` expressions.'
|
1443
|
+
Enabled: pending
|
1444
|
+
VersionAdded: '0.89'
|
1445
|
+
|
1402
1446
|
Lint/EachWithObjectArgument:
|
1403
1447
|
Description: 'Check for immutable argument given to each_with_object.'
|
1404
1448
|
Enabled: true
|
@@ -1409,18 +1453,29 @@ Lint/ElseLayout:
|
|
1409
1453
|
Enabled: true
|
1410
1454
|
VersionAdded: '0.17'
|
1411
1455
|
|
1456
|
+
Lint/EmptyConditionalBody:
|
1457
|
+
Description: 'This cop checks for the presence of `if`, `elsif` and `unless` branches without a body.'
|
1458
|
+
Enabled: 'pending'
|
1459
|
+
AllowComments: true
|
1460
|
+
VersionAdded: '0.89'
|
1461
|
+
|
1412
1462
|
Lint/EmptyEnsure:
|
1413
1463
|
Description: 'Checks for empty ensure block.'
|
1414
1464
|
Enabled: true
|
1415
1465
|
VersionAdded: '0.10'
|
1416
1466
|
VersionChanged: '0.48'
|
1417
|
-
AutoCorrect: false
|
1418
1467
|
|
1419
1468
|
Lint/EmptyExpression:
|
1420
1469
|
Description: 'Checks for empty expressions.'
|
1421
1470
|
Enabled: true
|
1422
1471
|
VersionAdded: '0.45'
|
1423
1472
|
|
1473
|
+
Lint/EmptyFile:
|
1474
|
+
Description: 'Enforces that Ruby source files are not empty.'
|
1475
|
+
Enabled: pending
|
1476
|
+
AllowComments: true
|
1477
|
+
VersionAdded: '0.90'
|
1478
|
+
|
1424
1479
|
Lint/EmptyInterpolation:
|
1425
1480
|
Description: 'Checks for empty string interpolation.'
|
1426
1481
|
Enabled: true
|
@@ -1452,6 +1507,12 @@ Lint/FlipFlop:
|
|
1452
1507
|
Enabled: true
|
1453
1508
|
VersionAdded: '0.16'
|
1454
1509
|
|
1510
|
+
Lint/FloatComparison:
|
1511
|
+
Description: 'Checks for the presence of precise comparison of floating point numbers.'
|
1512
|
+
StyleGuide: '#float-comparison'
|
1513
|
+
Enabled: pending
|
1514
|
+
VersionAdded: '0.89'
|
1515
|
+
|
1455
1516
|
Lint/FloatOutOfRange:
|
1456
1517
|
Description: >-
|
1457
1518
|
Catches floating-point literals too large or small for Ruby to
|
@@ -1499,7 +1560,9 @@ Lint/InheritException:
|
|
1499
1560
|
Lint/InterpolationCheck:
|
1500
1561
|
Description: 'Raise warning for interpolation in single q strs.'
|
1501
1562
|
Enabled: true
|
1563
|
+
Safe: false
|
1502
1564
|
VersionAdded: '0.50'
|
1565
|
+
VersionChanged: '0.87'
|
1503
1566
|
|
1504
1567
|
Lint/LiteralAsCondition:
|
1505
1568
|
Description: 'Checks of literals used in conditions.'
|
@@ -1519,6 +1582,7 @@ Lint/Loop:
|
|
1519
1582
|
StyleGuide: '#loop-with-break'
|
1520
1583
|
Enabled: true
|
1521
1584
|
VersionAdded: '0.9'
|
1585
|
+
VersionChanged: '0.89'
|
1522
1586
|
|
1523
1587
|
Lint/MissingCopEnableDirective:
|
1524
1588
|
Description: 'Checks for a `# rubocop:enable` after `# rubocop:disable`.'
|
@@ -1533,6 +1597,13 @@ Lint/MissingCopEnableDirective:
|
|
1533
1597
|
# .inf for any size
|
1534
1598
|
MaximumRangeSize: .inf
|
1535
1599
|
|
1600
|
+
Lint/MissingSuper:
|
1601
|
+
Description: >-
|
1602
|
+
This cop checks for the presence of constructors and lifecycle callbacks
|
1603
|
+
without calls to `super`'.
|
1604
|
+
Enabled: pending
|
1605
|
+
VersionAdded: '0.89'
|
1606
|
+
|
1536
1607
|
Lint/MixedRegexpCaptureTypes:
|
1537
1608
|
Description: 'Do not mix named captures and numbered captures in a Regexp literal.'
|
1538
1609
|
Enabled: pending
|
@@ -1585,6 +1656,12 @@ Lint/OrderedMagicComments:
|
|
1585
1656
|
Enabled: true
|
1586
1657
|
VersionAdded: '0.53'
|
1587
1658
|
|
1659
|
+
Lint/OutOfRangeRegexpRef:
|
1660
|
+
Description: 'Checks for out of range reference for Regexp because it always returns nil.'
|
1661
|
+
Enabled: pending
|
1662
|
+
Safe: false
|
1663
|
+
VersionAdded: '0.89'
|
1664
|
+
|
1588
1665
|
Lint/ParenthesesAsGroupedExpression:
|
1589
1666
|
Description: >-
|
1590
1667
|
Checks for method calls with a space before the opening
|
@@ -1611,7 +1688,9 @@ Lint/RaiseException:
|
|
1611
1688
|
Description: Checks for `raise` or `fail` statements which are raising `Exception` class.
|
1612
1689
|
StyleGuide: '#raise-exception'
|
1613
1690
|
Enabled: pending
|
1691
|
+
Safe: false
|
1614
1692
|
VersionAdded: '0.81'
|
1693
|
+
VersionChanged: '0.86'
|
1615
1694
|
AllowedImplicitNamespaces:
|
1616
1695
|
- 'Gem'
|
1617
1696
|
|
@@ -1668,6 +1747,7 @@ Lint/RegexpAsCondition:
|
|
1668
1747
|
The regexp literal matches `$_` implicitly.
|
1669
1748
|
Enabled: true
|
1670
1749
|
VersionAdded: '0.51'
|
1750
|
+
VersionChanged: '0.86'
|
1671
1751
|
|
1672
1752
|
Lint/RequireParentheses:
|
1673
1753
|
Description: >-
|
@@ -1724,6 +1804,7 @@ Lint/SafeNavigationWithEmpty:
|
|
1724
1804
|
Description: 'Avoid `foo&.empty?` in conditionals.'
|
1725
1805
|
Enabled: true
|
1726
1806
|
VersionAdded: '0.62'
|
1807
|
+
VersionChanged: '0.87'
|
1727
1808
|
|
1728
1809
|
Lint/ScriptPermission:
|
1729
1810
|
Description: 'Grant script file execute permission.'
|
@@ -1731,6 +1812,11 @@ Lint/ScriptPermission:
|
|
1731
1812
|
VersionAdded: '0.49'
|
1732
1813
|
VersionChanged: '0.50'
|
1733
1814
|
|
1815
|
+
Lint/SelfAssignment:
|
1816
|
+
Description: 'Checks for self-assignments.'
|
1817
|
+
Enabled: pending
|
1818
|
+
VersionAdded: '0.89'
|
1819
|
+
|
1734
1820
|
Lint/SendWithMixinArgument:
|
1735
1821
|
Description: 'Checks for `send` method when using mixin.'
|
1736
1822
|
Enabled: true
|
@@ -1781,6 +1867,16 @@ Lint/ToJSON:
|
|
1781
1867
|
Enabled: true
|
1782
1868
|
VersionAdded: '0.66'
|
1783
1869
|
|
1870
|
+
Lint/TopLevelReturnWithArgument:
|
1871
|
+
Description: 'This cop detects top level return statements with argument.'
|
1872
|
+
Enabled: 'pending'
|
1873
|
+
VersionAdded: '0.89'
|
1874
|
+
|
1875
|
+
Lint/TrailingCommaInAttributeDeclaration:
|
1876
|
+
Description: 'This cop checks for trailing commas in attribute declarations.'
|
1877
|
+
Enabled: pending
|
1878
|
+
VersionAdded: '0.90'
|
1879
|
+
|
1784
1880
|
Lint/UnderscorePrefixedVariableName:
|
1785
1881
|
Description: 'Do not use prefix `_` for a variable that is used.'
|
1786
1882
|
Enabled: true
|
@@ -1797,6 +1893,11 @@ Lint/UnreachableCode:
|
|
1797
1893
|
Enabled: true
|
1798
1894
|
VersionAdded: '0.9'
|
1799
1895
|
|
1896
|
+
Lint/UnreachableLoop:
|
1897
|
+
Description: 'This cop checks for loops that will have at most one iteration.'
|
1898
|
+
Enabled: pending
|
1899
|
+
VersionAdded: '0.89'
|
1900
|
+
|
1800
1901
|
Lint/UnusedBlockArgument:
|
1801
1902
|
Description: 'Checks for unused block arguments.'
|
1802
1903
|
StyleGuide: '#underscore-unused-vars'
|
@@ -1846,16 +1947,18 @@ Lint/UselessAssignment:
|
|
1846
1947
|
Enabled: true
|
1847
1948
|
VersionAdded: '0.11'
|
1848
1949
|
|
1849
|
-
Lint/UselessComparison:
|
1850
|
-
Description: 'Checks for comparison of something with itself.'
|
1851
|
-
Enabled: true
|
1852
|
-
VersionAdded: '0.11'
|
1853
|
-
|
1854
1950
|
Lint/UselessElseWithoutRescue:
|
1855
1951
|
Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
|
1856
1952
|
Enabled: true
|
1857
1953
|
VersionAdded: '0.17'
|
1858
1954
|
|
1955
|
+
Lint/UselessMethodDefinition:
|
1956
|
+
Description: 'Checks for useless method definitions.'
|
1957
|
+
Enabled: pending
|
1958
|
+
VersionAdded: '0.90'
|
1959
|
+
Safe: false
|
1960
|
+
AllowComments: true
|
1961
|
+
|
1859
1962
|
Lint/UselessSetterCall:
|
1860
1963
|
Description: 'Checks for useless setter call to a local variable.'
|
1861
1964
|
Enabled: true
|
@@ -1884,15 +1987,16 @@ Metrics/AbcSize:
|
|
1884
1987
|
# The ABC size is a calculated magnitude, so this number can be an Integer or
|
1885
1988
|
# a Float.
|
1886
1989
|
IgnoredMethods: []
|
1887
|
-
Max:
|
1990
|
+
Max: 17
|
1888
1991
|
|
1889
1992
|
Metrics/BlockLength:
|
1890
1993
|
Description: 'Avoid long blocks with many lines.'
|
1891
1994
|
Enabled: true
|
1892
1995
|
VersionAdded: '0.44'
|
1893
|
-
VersionChanged: '0.
|
1996
|
+
VersionChanged: '0.87'
|
1894
1997
|
CountComments: false # count full line comments?
|
1895
1998
|
Max: 25
|
1999
|
+
CountAsOne: []
|
1896
2000
|
ExcludedMethods:
|
1897
2001
|
# By default, exclude the `#refine` method, as it tends to have larger
|
1898
2002
|
# associated blocks.
|
@@ -1913,8 +2017,10 @@ Metrics/ClassLength:
|
|
1913
2017
|
Description: 'Avoid classes longer than 100 lines of code.'
|
1914
2018
|
Enabled: true
|
1915
2019
|
VersionAdded: '0.25'
|
2020
|
+
VersionChanged: '0.87'
|
1916
2021
|
CountComments: false # count full line comments?
|
1917
2022
|
Max: 100
|
2023
|
+
CountAsOne: []
|
1918
2024
|
|
1919
2025
|
# Avoid complex methods.
|
1920
2026
|
Metrics/CyclomaticComplexity:
|
@@ -1925,24 +2031,27 @@ Metrics/CyclomaticComplexity:
|
|
1925
2031
|
VersionAdded: '0.25'
|
1926
2032
|
VersionChanged: '0.81'
|
1927
2033
|
IgnoredMethods: []
|
1928
|
-
Max:
|
2034
|
+
Max: 7
|
1929
2035
|
|
1930
2036
|
Metrics/MethodLength:
|
1931
2037
|
Description: 'Avoid methods longer than 10 lines of code.'
|
1932
2038
|
StyleGuide: '#short-methods'
|
1933
2039
|
Enabled: true
|
1934
2040
|
VersionAdded: '0.25'
|
1935
|
-
VersionChanged: '0.
|
2041
|
+
VersionChanged: '0.87'
|
1936
2042
|
CountComments: false # count full line comments?
|
1937
2043
|
Max: 10
|
2044
|
+
CountAsOne: []
|
1938
2045
|
ExcludedMethods: []
|
1939
2046
|
|
1940
2047
|
Metrics/ModuleLength:
|
1941
2048
|
Description: 'Avoid modules longer than 100 lines of code.'
|
1942
2049
|
Enabled: true
|
1943
2050
|
VersionAdded: '0.31'
|
2051
|
+
VersionChanged: '0.87'
|
1944
2052
|
CountComments: false # count full line comments?
|
1945
2053
|
Max: 100
|
2054
|
+
CountAsOne: []
|
1946
2055
|
|
1947
2056
|
Metrics/ParameterLists:
|
1948
2057
|
Description: 'Avoid parameter lists longer than three or four parameters.'
|
@@ -1960,7 +2069,7 @@ Metrics/PerceivedComplexity:
|
|
1960
2069
|
VersionAdded: '0.25'
|
1961
2070
|
VersionChanged: '0.81'
|
1962
2071
|
IgnoredMethods: []
|
1963
|
-
Max:
|
2072
|
+
Max: 8
|
1964
2073
|
|
1965
2074
|
################## Migration #############################
|
1966
2075
|
|
@@ -1980,10 +2089,12 @@ Naming/AccessorMethodName:
|
|
1980
2089
|
VersionAdded: '0.50'
|
1981
2090
|
|
1982
2091
|
Naming/AsciiIdentifiers:
|
1983
|
-
Description: 'Use only ascii symbols in identifiers.'
|
2092
|
+
Description: 'Use only ascii symbols in identifiers and constants.'
|
1984
2093
|
StyleGuide: '#english-identifiers'
|
1985
2094
|
Enabled: true
|
1986
2095
|
VersionAdded: '0.50'
|
2096
|
+
VersionChanged: '0.87'
|
2097
|
+
AsciiConstants: true
|
1987
2098
|
|
1988
2099
|
Naming/BinaryOperatorParameterName:
|
1989
2100
|
Description: 'When defining binary operators, name the argument other.'
|
@@ -2150,17 +2261,18 @@ Naming/MethodParameterName:
|
|
2150
2261
|
AllowNamesEndingInNumbers: true
|
2151
2262
|
# Allowed names that will not register an offense
|
2152
2263
|
AllowedNames:
|
2153
|
-
-
|
2154
|
-
- id
|
2155
|
-
- to
|
2264
|
+
- at
|
2156
2265
|
- by
|
2157
|
-
-
|
2266
|
+
- db
|
2267
|
+
- id
|
2158
2268
|
- in
|
2159
|
-
-
|
2269
|
+
- io
|
2160
2270
|
- ip
|
2161
|
-
-
|
2271
|
+
- of
|
2272
|
+
- 'on'
|
2162
2273
|
- os
|
2163
2274
|
- pp
|
2275
|
+
- to
|
2164
2276
|
# Forbidden names that will register an offense
|
2165
2277
|
ForbiddenNames: []
|
2166
2278
|
|
@@ -2276,6 +2388,17 @@ Style/AccessModifierDeclarations:
|
|
2276
2388
|
- group
|
2277
2389
|
AllowModifiersOnSymbols: true
|
2278
2390
|
|
2391
|
+
Style/AccessorGrouping:
|
2392
|
+
Description: 'Checks for grouping of accessors in `class` and `module` bodies.'
|
2393
|
+
Enabled: 'pending'
|
2394
|
+
VersionAdded: '0.87'
|
2395
|
+
EnforcedStyle: grouped
|
2396
|
+
SupportedStyles:
|
2397
|
+
# separated: each accessor goes in a separate statement.
|
2398
|
+
# grouped: accessors are grouped into a single statement.
|
2399
|
+
- separated
|
2400
|
+
- grouped
|
2401
|
+
|
2279
2402
|
Style/Alias:
|
2280
2403
|
Description: 'Use alias instead of alias_method.'
|
2281
2404
|
StyleGuide: '#alias-method-lexically'
|
@@ -2300,6 +2423,15 @@ Style/AndOr:
|
|
2300
2423
|
- always
|
2301
2424
|
- conditionals
|
2302
2425
|
|
2426
|
+
Style/ArrayCoercion:
|
2427
|
+
Description: >-
|
2428
|
+
Use Array() instead of explicit Array check or [*var], when dealing
|
2429
|
+
with a variable you want to treat as an Array, but you're not certain it's an array.
|
2430
|
+
StyleGuide: '#array-coercion'
|
2431
|
+
Safe: false
|
2432
|
+
Enabled: 'pending'
|
2433
|
+
VersionAdded: '0.88'
|
2434
|
+
|
2303
2435
|
Style/ArrayJoin:
|
2304
2436
|
Description: 'Use Array#join instead of Array#*.'
|
2305
2437
|
StyleGuide: '#array-join'
|
@@ -2343,6 +2475,13 @@ Style/BeginBlock:
|
|
2343
2475
|
Enabled: true
|
2344
2476
|
VersionAdded: '0.9'
|
2345
2477
|
|
2478
|
+
Style/BisectedAttrAccessor:
|
2479
|
+
Description: >-
|
2480
|
+
Checks for places where `attr_reader` and `attr_writer`
|
2481
|
+
for the same method can be combined into single `attr_accessor`.
|
2482
|
+
Enabled: 'pending'
|
2483
|
+
VersionAdded: '0.87'
|
2484
|
+
|
2346
2485
|
Style/BlockComments:
|
2347
2486
|
Description: 'Do not use block comments.'
|
2348
2487
|
StyleGuide: '#no-block-comments'
|
@@ -2465,6 +2604,7 @@ Style/CaseEquality:
|
|
2465
2604
|
StyleGuide: '#no-case-equality'
|
2466
2605
|
Enabled: true
|
2467
2606
|
VersionAdded: '0.9'
|
2607
|
+
VersionChanged: '0.89'
|
2468
2608
|
# If AllowOnConstant is enabled, the cop will ignore violations when the receiver of
|
2469
2609
|
# the case equality operator is a constant.
|
2470
2610
|
#
|
@@ -2475,6 +2615,13 @@ Style/CaseEquality:
|
|
2475
2615
|
# String === "string"
|
2476
2616
|
AllowOnConstant: false
|
2477
2617
|
|
2618
|
+
Style/CaseLikeIf:
|
2619
|
+
Description: 'This cop identifies places where `if-elsif` constructions can be replaced with `case-when`.'
|
2620
|
+
StyleGuide: '#case-vs-if-else'
|
2621
|
+
Enabled: 'pending'
|
2622
|
+
Safe: false
|
2623
|
+
VersionAdded: '0.88'
|
2624
|
+
|
2478
2625
|
Style/CharacterLiteral:
|
2479
2626
|
Description: 'Checks for uses of character literals.'
|
2480
2627
|
StyleGuide: '#no-character-literals'
|
@@ -2490,7 +2637,6 @@ Style/ClassAndModuleChildren:
|
|
2490
2637
|
# have the knowledge to perform either operation safely and thus requires
|
2491
2638
|
# manual oversight.
|
2492
2639
|
SafeAutoCorrect: false
|
2493
|
-
AutoCorrect: false
|
2494
2640
|
Enabled: true
|
2495
2641
|
VersionAdded: '0.19'
|
2496
2642
|
#
|
@@ -2529,6 +2675,16 @@ Style/ClassMethods:
|
|
2529
2675
|
VersionAdded: '0.9'
|
2530
2676
|
VersionChanged: '0.20'
|
2531
2677
|
|
2678
|
+
Style/ClassMethodsDefinitions:
|
2679
|
+
Description: 'Enforces using `def self.method_name` or `class << self` to define class methods.'
|
2680
|
+
StyleGuide: '#def-self-class-methods'
|
2681
|
+
Enabled: false
|
2682
|
+
VersionAdded: '0.89'
|
2683
|
+
EnforcedStyle: def_self
|
2684
|
+
SupportedStyles:
|
2685
|
+
- def_self
|
2686
|
+
- self_class
|
2687
|
+
|
2532
2688
|
Style/ClassVars:
|
2533
2689
|
Description: 'Avoid the use of class variables.'
|
2534
2690
|
StyleGuide: '#no-class-vars'
|
@@ -2569,6 +2725,14 @@ Style/ColonMethodDefinition:
|
|
2569
2725
|
Enabled: true
|
2570
2726
|
VersionAdded: '0.52'
|
2571
2727
|
|
2728
|
+
Style/CombinableLoops:
|
2729
|
+
Description: >-
|
2730
|
+
Checks for places where multiple consecutive loops over the same data
|
2731
|
+
can be combined into a single loop.
|
2732
|
+
Enabled: pending
|
2733
|
+
Safe: false
|
2734
|
+
VersionAdded: '0.90'
|
2735
|
+
|
2572
2736
|
Style/CommandLiteral:
|
2573
2737
|
Description: 'Use `` or %x around command literals.'
|
2574
2738
|
StyleGuide: '#percent-x'
|
@@ -2717,6 +2881,7 @@ Style/DoubleNegation:
|
|
2717
2881
|
VersionAdded: '0.19'
|
2718
2882
|
VersionChanged: '0.84'
|
2719
2883
|
EnforcedStyle: allowed_in_returns
|
2884
|
+
SafeAutoCorrect: false
|
2720
2885
|
SupportedStyles:
|
2721
2886
|
- allowed_in_returns
|
2722
2887
|
- forbidden
|
@@ -2811,6 +2976,16 @@ Style/ExpandPathArguments:
|
|
2811
2976
|
Enabled: true
|
2812
2977
|
VersionAdded: '0.53'
|
2813
2978
|
|
2979
|
+
Style/ExplicitBlockArgument:
|
2980
|
+
Description: >-
|
2981
|
+
Consider using explicit block argument to avoid writing block literal
|
2982
|
+
that just passes its arguments to another block.
|
2983
|
+
StyleGuide: '#block-argument'
|
2984
|
+
Enabled: pending
|
2985
|
+
# May change the yielding arity.
|
2986
|
+
Safe: false
|
2987
|
+
VersionAdded: '0.89'
|
2988
|
+
|
2814
2989
|
Style/ExponentialNotation:
|
2815
2990
|
Description: 'When using exponential notation, favor a mantissa between 1 (inclusive) and 10 (exclusive).'
|
2816
2991
|
StyleGuide: '#exponential-notation'
|
@@ -2892,7 +3067,13 @@ Style/FrozenStringLiteralComment:
|
|
2892
3067
|
# `never` will enforce that the frozen string literal comment does not
|
2893
3068
|
# exist in a file.
|
2894
3069
|
- never
|
2895
|
-
|
3070
|
+
SafeAutoCorrect: false
|
3071
|
+
|
3072
|
+
Style/GlobalStdStream:
|
3073
|
+
Description: 'Enforces the use of `$stdout/$stderr/$stdin` instead of `STDOUT/STDERR/STDIN`.'
|
3074
|
+
StyleGuide: '#global-stdout'
|
3075
|
+
Enabled: pending
|
3076
|
+
VersionAdded: '0.89'
|
2896
3077
|
|
2897
3078
|
Style/GlobalVars:
|
2898
3079
|
Description: 'Do not introduce global variables.'
|
@@ -2913,6 +3094,18 @@ Style/GuardClause:
|
|
2913
3094
|
# needs to have to trigger this cop
|
2914
3095
|
MinBodyLength: 1
|
2915
3096
|
|
3097
|
+
Style/HashAsLastArrayItem:
|
3098
|
+
Description: >-
|
3099
|
+
Checks for presence or absence of braces around hash literal as a last
|
3100
|
+
array item depending on configuration.
|
3101
|
+
StyleGuide: '#hash-literal-as-last-array-item'
|
3102
|
+
Enabled: 'pending'
|
3103
|
+
VersionAdded: '0.88'
|
3104
|
+
EnforcedStyle: braces
|
3105
|
+
SupportedStyles:
|
3106
|
+
- braces
|
3107
|
+
- no_braces
|
3108
|
+
|
2916
3109
|
Style/HashEachMethods:
|
2917
3110
|
Description: 'Use Hash#each_key and Hash#each_value.'
|
2918
3111
|
StyleGuide: '#hash-each'
|
@@ -2920,6 +3113,16 @@ Style/HashEachMethods:
|
|
2920
3113
|
VersionAdded: '0.80'
|
2921
3114
|
Safe: false
|
2922
3115
|
|
3116
|
+
Style/HashLikeCase:
|
3117
|
+
Description: >-
|
3118
|
+
Checks for places where `case-when` represents a simple 1:1
|
3119
|
+
mapping and can be replaced with a hash lookup.
|
3120
|
+
Enabled: 'pending'
|
3121
|
+
VersionAdded: '0.88'
|
3122
|
+
# `MinBranchesCount` defines the number of branches `case` needs to have
|
3123
|
+
# to trigger this cop
|
3124
|
+
MinBranchesCount: 3
|
3125
|
+
|
2923
3126
|
Style/HashSyntax:
|
2924
3127
|
Description: >-
|
2925
3128
|
Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
|
@@ -2944,15 +3147,17 @@ Style/HashSyntax:
|
|
2944
3147
|
PreferHashRocketsForNonAlnumEndingSymbols: false
|
2945
3148
|
|
2946
3149
|
Style/HashTransformKeys:
|
2947
|
-
Description: 'Prefer `transform_keys` over `each_with_object`
|
3150
|
+
Description: 'Prefer `transform_keys` over `each_with_object`, `map`, or `to_h`.'
|
2948
3151
|
Enabled: 'pending'
|
2949
3152
|
VersionAdded: '0.80'
|
3153
|
+
VersionChanged: '0.90'
|
2950
3154
|
Safe: false
|
2951
3155
|
|
2952
3156
|
Style/HashTransformValues:
|
2953
|
-
Description: 'Prefer `transform_values` over `each_with_object`
|
3157
|
+
Description: 'Prefer `transform_values` over `each_with_object`, `map`, or `to_h`.'
|
2954
3158
|
Enabled: 'pending'
|
2955
3159
|
VersionAdded: '0.80'
|
3160
|
+
VersionChanged: '0.90'
|
2956
3161
|
Safe: false
|
2957
3162
|
|
2958
3163
|
Style/IdenticalConditionalBranches:
|
@@ -2983,6 +3188,7 @@ Style/IfUnlessModifierOfIfUnless:
|
|
2983
3188
|
Avoid modifier if/unless usage on conditionals.
|
2984
3189
|
Enabled: true
|
2985
3190
|
VersionAdded: '0.39'
|
3191
|
+
VersionChanged: '0.87'
|
2986
3192
|
|
2987
3193
|
Style/IfWithSemicolon:
|
2988
3194
|
Description: 'Do not use if x; .... Use the ternary operator instead.'
|
@@ -3048,6 +3254,12 @@ Style/IpAddresses:
|
|
3048
3254
|
- "::"
|
3049
3255
|
# :: is a valid IPv6 address, but could potentially be legitimately in code
|
3050
3256
|
|
3257
|
+
Style/KeywordParametersOrder:
|
3258
|
+
Description: 'Enforces that optional keyword parameters are placed at the end of the parameters list.'
|
3259
|
+
StyleGuide: '#keyword-parameters-order'
|
3260
|
+
Enabled: pending
|
3261
|
+
VersionAdded: '0.90'
|
3262
|
+
|
3051
3263
|
Style/Lambda:
|
3052
3264
|
Description: 'Use the new lambda literal syntax for single-line blocks.'
|
3053
3265
|
StyleGuide: '#lambda-multi-line'
|
@@ -3126,12 +3338,6 @@ Style/MethodDefParentheses:
|
|
3126
3338
|
- require_no_parentheses
|
3127
3339
|
- require_no_parentheses_except_multiline
|
3128
3340
|
|
3129
|
-
Style/MethodMissingSuper:
|
3130
|
-
Description: Checks for `method_missing` to call `super`.
|
3131
|
-
StyleGuide: '#no-method-missing'
|
3132
|
-
Enabled: true
|
3133
|
-
VersionAdded: '0.56'
|
3134
|
-
|
3135
3341
|
Style/MinMax:
|
3136
3342
|
Description: >-
|
3137
3343
|
Use `Enumerable#minmax` instead of `Enumerable#min`
|
@@ -3239,6 +3445,7 @@ Style/MultilineTernaryOperator:
|
|
3239
3445
|
StyleGuide: '#no-multiline-ternary'
|
3240
3446
|
Enabled: true
|
3241
3447
|
VersionAdded: '0.9'
|
3448
|
+
VersionChanged: '0.86'
|
3242
3449
|
|
3243
3450
|
Style/MultilineWhenThen:
|
3244
3451
|
Description: 'Do not use then for multi-line when statement.'
|
@@ -3343,6 +3550,7 @@ Style/NestedTernaryOperator:
|
|
3343
3550
|
StyleGuide: '#no-nested-ternary'
|
3344
3551
|
Enabled: true
|
3345
3552
|
VersionAdded: '0.9'
|
3553
|
+
VersionChanged: '0.86'
|
3346
3554
|
|
3347
3555
|
Style/Next:
|
3348
3556
|
Description: 'Use `next` to skip iteration instead of a condition at the end.'
|
@@ -3425,7 +3633,6 @@ Style/NumericPredicate:
|
|
3425
3633
|
# object. Switching these methods has to be done with knowledge of the types
|
3426
3634
|
# of the variables which rubocop doesn't have.
|
3427
3635
|
SafeAutoCorrect: false
|
3428
|
-
AutoCorrect: false
|
3429
3636
|
Enabled: true
|
3430
3637
|
VersionAdded: '0.42'
|
3431
3638
|
VersionChanged: '0.59'
|
@@ -3441,12 +3648,13 @@ Style/NumericPredicate:
|
|
3441
3648
|
|
3442
3649
|
Style/OneLineConditional:
|
3443
3650
|
Description: >-
|
3444
|
-
Favor the ternary operator(?:) over
|
3445
|
-
if/then/else/end constructs.
|
3651
|
+
Favor the ternary operator (?:) or multi-line constructs over
|
3652
|
+
single-line if/then/else/end constructs.
|
3446
3653
|
StyleGuide: '#ternary-operator'
|
3447
3654
|
Enabled: true
|
3655
|
+
AlwaysCorrectToMultiline: false
|
3448
3656
|
VersionAdded: '0.9'
|
3449
|
-
VersionChanged: '0.
|
3657
|
+
VersionChanged: '0.90'
|
3450
3658
|
|
3451
3659
|
Style/OptionHash:
|
3452
3660
|
Description: "Don't use option hashes when you can use keyword arguments."
|
@@ -3471,6 +3679,13 @@ Style/OptionalArguments:
|
|
3471
3679
|
VersionAdded: '0.33'
|
3472
3680
|
VersionChanged: '0.83'
|
3473
3681
|
|
3682
|
+
Style/OptionalBooleanParameter:
|
3683
|
+
Description: 'Use keyword arguments when defining method with boolean argument.'
|
3684
|
+
StyleGuide: '#boolean-keyword-arguments'
|
3685
|
+
Enabled: pending
|
3686
|
+
Safe: false
|
3687
|
+
VersionAdded: '0.89'
|
3688
|
+
|
3474
3689
|
Style/OrAssignment:
|
3475
3690
|
Description: 'Recommend usage of double pipe equals (||=) where applicable.'
|
3476
3691
|
StyleGuide: '#double-pipe-for-uninit'
|
@@ -3567,6 +3782,11 @@ Style/RandomWithOffset:
|
|
3567
3782
|
Enabled: true
|
3568
3783
|
VersionAdded: '0.52'
|
3569
3784
|
|
3785
|
+
Style/RedundantAssignment:
|
3786
|
+
Description: 'Checks for redundant assignment before returning.'
|
3787
|
+
Enabled: 'pending'
|
3788
|
+
VersionAdded: '0.87'
|
3789
|
+
|
3570
3790
|
Style/RedundantBegin:
|
3571
3791
|
Description: "Don't use begin blocks when they are not needed."
|
3572
3792
|
StyleGuide: '#begin-implicit'
|
@@ -3596,6 +3816,27 @@ Style/RedundantException:
|
|
3596
3816
|
VersionAdded: '0.14'
|
3597
3817
|
VersionChanged: '0.29'
|
3598
3818
|
|
3819
|
+
Style/RedundantFetchBlock:
|
3820
|
+
Description: >-
|
3821
|
+
Use `fetch(key, value)` instead of `fetch(key) { value }`
|
3822
|
+
when value has Numeric, Rational, Complex, Symbol or String type, `false`, `true`, `nil` or is a constant.
|
3823
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#hashfetch-with-argument-vs-hashfetch--block-code'
|
3824
|
+
Enabled: 'pending'
|
3825
|
+
Safe: false
|
3826
|
+
# If enabled, this cop will autocorrect usages of
|
3827
|
+
# `fetch` being called with block returning a constant.
|
3828
|
+
# This can be dangerous since constants will not be defined at that moment.
|
3829
|
+
SafeForConstants: false
|
3830
|
+
VersionAdded: '0.86'
|
3831
|
+
|
3832
|
+
Style/RedundantFileExtensionInRequire:
|
3833
|
+
Description: >-
|
3834
|
+
Checks for the presence of superfluous `.rb` extension in
|
3835
|
+
the filename provided to `require` and `require_relative`.
|
3836
|
+
StyleGuide: '#no-explicit-rb-to-require'
|
3837
|
+
Enabled: 'pending'
|
3838
|
+
VersionAdded: '0.88'
|
3839
|
+
|
3599
3840
|
Style/RedundantFreeze:
|
3600
3841
|
Description: "Checks usages of Object#freeze on immutable objects."
|
3601
3842
|
Enabled: true
|
@@ -3644,6 +3885,12 @@ Style/RedundantSelf:
|
|
3644
3885
|
VersionAdded: '0.10'
|
3645
3886
|
VersionChanged: '0.13'
|
3646
3887
|
|
3888
|
+
Style/RedundantSelfAssignment:
|
3889
|
+
Description: 'Checks for places where redundant assignments are made for in place modification methods.'
|
3890
|
+
Enabled: pending
|
3891
|
+
Safe: false
|
3892
|
+
VersionAdded: '0.90'
|
3893
|
+
|
3647
3894
|
Style/RedundantSort:
|
3648
3895
|
Description: >-
|
3649
3896
|
Use `min` instead of `sort.first`,
|
@@ -3763,6 +4010,12 @@ Style/SignalException:
|
|
3763
4010
|
- only_fail
|
3764
4011
|
- semantic
|
3765
4012
|
|
4013
|
+
Style/SingleArgumentDig:
|
4014
|
+
Description: 'Avoid using single argument dig method.'
|
4015
|
+
Enabled: pending
|
4016
|
+
VersionAdded: '0.89'
|
4017
|
+
Safe: false
|
4018
|
+
|
3766
4019
|
Style/SingleLineBlockParams:
|
3767
4020
|
Description: 'Enforces the names of some block params.'
|
3768
4021
|
Enabled: false
|
@@ -3790,6 +4043,14 @@ Style/SlicingWithRange:
|
|
3790
4043
|
VersionAdded: '0.83'
|
3791
4044
|
Safe: false
|
3792
4045
|
|
4046
|
+
Style/SoleNestedConditional:
|
4047
|
+
Description: >-
|
4048
|
+
Finds sole nested conditional nodes
|
4049
|
+
which can be merged into outer conditional node.
|
4050
|
+
Enabled: pending
|
4051
|
+
VersionAdded: '0.89'
|
4052
|
+
AllowModifier: false
|
4053
|
+
|
3793
4054
|
Style/SpecialGlobalVars:
|
3794
4055
|
Description: 'Avoid Perl-style global variables.'
|
3795
4056
|
StyleGuide: '#no-cryptic-perlisms'
|
@@ -3818,6 +4079,13 @@ Style/StderrPuts:
|
|
3818
4079
|
Enabled: true
|
3819
4080
|
VersionAdded: '0.51'
|
3820
4081
|
|
4082
|
+
Style/StringConcatenation:
|
4083
|
+
Description: 'Checks for places where string concatenation can be replaced with string interpolation.'
|
4084
|
+
StyleGuide: '#string-interpolation'
|
4085
|
+
Enabled: pending
|
4086
|
+
Safe: false
|
4087
|
+
VersionAdded: '0.89'
|
4088
|
+
|
3821
4089
|
Style/StringHashKeys:
|
3822
4090
|
Description: 'Prefer symbols instead of strings as hash keys.'
|
3823
4091
|
StyleGuide: '#symbols-as-keys'
|
@@ -3875,6 +4143,7 @@ Style/StructInheritance:
|
|
3875
4143
|
StyleGuide: '#no-extend-struct-new'
|
3876
4144
|
Enabled: true
|
3877
4145
|
VersionAdded: '0.29'
|
4146
|
+
VersionChanged: '0.86'
|
3878
4147
|
|
3879
4148
|
Style/SymbolArray:
|
3880
4149
|
Description: 'Use %i or %I for arrays of symbols.'
|
@@ -3896,7 +4165,7 @@ Style/SymbolLiteral:
|
|
3896
4165
|
Style/SymbolProc:
|
3897
4166
|
Description: 'Use symbols as procs instead of blocks when possible.'
|
3898
4167
|
Enabled: true
|
3899
|
-
|
4168
|
+
Safe: false
|
3900
4169
|
VersionAdded: '0.26'
|
3901
4170
|
VersionChanged: '0.64'
|
3902
4171
|
# A list of method names to be ignored by the check.
|