-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy path.rubocop_lint.yml
More file actions
1079 lines (942 loc) · 27.5 KB
/
Copy path.rubocop_lint.yml
File metadata and controls
1079 lines (942 loc) · 27.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Department 'Lint' (138): 수정
Lint/AmbiguousAssignment:
Description: Checks for mistyped shorthand assignments.
Enabled: true
VersionAdded: '1.7'
# Supports --autocorrect
Lint/AmbiguousBlockAssociation:
Description: Checks for ambiguous block association with method when param passed
without parentheses.
Enabled: true
VersionAdded: '0.48'
VersionChanged: '1.13'
AllowedMethods: []
AllowedPatterns: []
# Supports --autocorrect
Lint/AmbiguousOperator:
Description: Checks for ambiguous operators in the first argument of a method invocation
without parentheses.
StyleGuide: "#method-invocation-parens"
Enabled: true
VersionAdded: '0.17'
VersionChanged: '0.83'
# Supports --autocorrect
Lint/AmbiguousOperatorPrecedence:
Description: Checks for expressions containing multiple binary operations with ambiguous
precedence.
Enabled: true
VersionAdded: '1.21'
# Supports --autocorrect
Lint/AmbiguousRange:
Description: Checks for ranges with ambiguous boundaries.
Enabled: true
VersionAdded: '1.19'
SafeAutoCorrect: false
RequireParenthesesForMethodChains: false
# Supports --autocorrect
Lint/AmbiguousRegexpLiteral:
Description: Checks for ambiguous regexp literals in the first argument of a method
invocation without parentheses.
Enabled: true
VersionAdded: '0.17'
VersionChanged: '0.83'
# Supports --autocorrect
Lint/AssignmentInCondition:
Description: Don't use assignment in conditions.
StyleGuide: "#safe-assignment-in-condition"
Enabled: true
SafeAutoCorrect: false
VersionAdded: '0.9'
VersionChanged: '1.45'
AllowSafeAssignment: true
# Supports --autocorrect
Lint/BigDecimalNew:
Description: "`BigDecimal.new()` is deprecated. Use `BigDecimal()` instead."
Enabled: true
VersionAdded: '0.53'
Lint/BinaryOperatorWithIdenticalOperands:
Description: Checks for places where binary operator has identical operands.
Enabled: true
Safe: false
VersionAdded: '0.89'
VersionChanged: '1.7'
# Supports --autocorrect
Lint/BooleanSymbol:
Description: Check for `:true` and `:false` symbols.
Enabled: true
SafeAutoCorrect: false
VersionAdded: '0.50'
VersionChanged: '1.22'
Lint/CircularArgumentReference:
Description: Default values in optional keyword arguments and optional ordinal arguments
should not refer back to the name of the argument.
Enabled: true
VersionAdded: '0.33'
Lint/ConstantDefinitionInBlock:
Description: Do not define constants within a block.
StyleGuide: "#no-constant-definition-in-block"
Enabled: true
VersionAdded: '0.91'
VersionChanged: '1.3'
AllowedMethods:
- enums
# Supports --autocorrect
Lint/ConstantOverwrittenInRescue:
Description: Checks for overwriting an exception with an exception result by use `rescue
=>`.
Enabled: true
VersionAdded: '1.31'
Lint/ConstantResolution:
Description: Check that constants are fully qualified with `::`.
Enabled: false
VersionAdded: '0.86'
Only: []
Ignore: []
Lint/Debugger:
Description: Check for debugger calls.
Enabled: true
VersionAdded: '0.14'
VersionChanged: '1.63'
DebuggerMethods:
Kernel:
- binding.irb
- Kernel.binding.irb
Byebug:
- byebug
- remote_byebug
- Kernel.byebug
- Kernel.remote_byebug
Capybara:
- page.save_and_open_page
- page.save_and_open_screenshot
- page.save_page
- page.save_screenshot
- save_and_open_page
- save_and_open_screenshot
- save_page
- save_screenshot
debug.rb:
- binding.b
- binding.break
- Kernel.binding.b
- Kernel.binding.break
Pry:
- binding.pry
- binding.remote_pry
- binding.pry_remote
- Kernel.binding.pry
- Kernel.binding.remote_pry
- Kernel.binding.pry_remote
- Pry.rescue
- pry
Rails:
- debugger
- Kernel.debugger
RubyJard:
- jard
WebConsole:
- binding.console
DebuggerRequires:
debug.rb:
- debug/open
- debug/start
# Supports --autocorrect
Lint/DeprecatedClassMethods:
Description: Check for deprecated class method calls.
Enabled: true
VersionAdded: '0.19'
# Supports --autocorrect
Lint/DeprecatedConstants:
Description: Checks for deprecated constants.
Enabled: true
VersionAdded: '1.8'
VersionChanged: '1.40'
DeprecatedConstants:
NIL:
Alternative: nil
DeprecatedVersion: '2.4'
'TRUE':
Alternative: 'true'
DeprecatedVersion: '2.4'
'FALSE':
Alternative: 'false'
DeprecatedVersion: '2.4'
Net::HTTPServerException:
Alternative: Net::HTTPClientException
DeprecatedVersion: '2.6'
Random::DEFAULT:
Alternative: Random.new
DeprecatedVersion: '3.0'
Struct::Group:
Alternative: Etc::Group
DeprecatedVersion: '3.0'
Struct::Passwd:
Alternative: Etc::Passwd
DeprecatedVersion: '3.0'
# Supports --autocorrect
Lint/DeprecatedOpenSSLConstant:
Description: Don't use algorithm constants for `OpenSSL::Cipher` and `OpenSSL::Digest`.
Enabled: true
VersionAdded: '0.84'
# Supports --autocorrect
Lint/DisjunctiveAssignmentInConstructor:
Description: In constructor, plain assignment is preferred over disjunctive.
Enabled: true
Safe: false
VersionAdded: '0.62'
VersionChanged: '0.88'
Lint/DuplicateBranch:
Description: Checks that there are no repeated bodies within `if/unless`, `case-when`
and `rescue` constructs.
Enabled: true
VersionAdded: '1.3'
VersionChanged: '1.7'
IgnoreLiteralBranches: false
IgnoreConstantBranches: false
Lint/DuplicateCaseCondition:
Description: Do not repeat values in case conditionals.
Enabled: true
VersionAdded: '0.45'
Lint/DuplicateElsifCondition:
Description: Do not repeat conditions used in if `elsif`.
Enabled: true
VersionAdded: '0.88'
Lint/DuplicateHashKey:
Description: Check for duplicate keys in hash literals.
Enabled: true
VersionAdded: '0.34'
VersionChanged: '0.77'
# Supports --autocorrect
Lint/DuplicateMagicComment:
Description: Check for duplicated magic comments.
Enabled: true
VersionAdded: '1.37'
Lint/DuplicateMatchPattern:
Description: Do not repeat patterns in `in` keywords.
Enabled: true
VersionAdded: '1.50'
Lint/DuplicateMethods:
Description: Check for duplicate method definitions.
Enabled: true
VersionAdded: '0.29'
# Supports --autocorrect
Lint/DuplicateRegexpCharacterClassElement:
Description: Checks for duplicate elements in Regexp character classes.
Enabled: true
VersionAdded: '1.1'
# Supports --autocorrect
Lint/DuplicateRequire:
Description: Check for duplicate `require`s and `require_relative`s.
Enabled: true
SafeAutoCorrect: false
VersionAdded: '0.90'
VersionChanged: '1.28'
Lint/DuplicateRescueException:
Description: Checks that there are no repeated exceptions used in `rescue` expressions.
Enabled: true
VersionAdded: '0.89'
Lint/EachWithObjectArgument:
Description: Check for immutable argument given to each_with_object.
Enabled: true
VersionAdded: '0.31'
# Supports --autocorrect
Lint/ElseLayout:
Description: Check for odd code arrangement in an else block.
Enabled: true
VersionAdded: '0.17'
VersionChanged: '1.2'
Lint/EmptyBlock:
Description: Checks for blocks without a body.
Enabled: true
VersionAdded: '1.1'
VersionChanged: '1.15'
AllowComments: true
AllowEmptyLambdas: true
Lint/EmptyClass:
Description: Checks for classes and metaclasses without a body.
Enabled: true
VersionAdded: '1.3'
AllowComments: false
# Supports --autocorrect
Lint/EmptyConditionalBody:
Description: Checks for the presence of `if`, `elsif` and `unless` branches without
a body.
Enabled: true
AutoCorrect: contextual
AllowComments: true
VersionAdded: '0.89'
VersionChanged: '1.61'
# Supports --autocorrect
Lint/EmptyEnsure:
Description: Checks for empty ensure block.
Enabled: true
AutoCorrect: contextual
VersionAdded: '0.10'
VersionChanged: '1.61'
Lint/EmptyExpression:
Description: Checks for empty expressions.
Enabled: true
VersionAdded: '0.45'
Lint/EmptyFile:
Description: Enforces that Ruby source files are not empty.
Enabled: true
AllowComments: true
VersionAdded: '0.90'
Lint/EmptyInPattern:
Description: Checks for the presence of `in` pattern branches without a body.
Enabled: true
AllowComments: true
VersionAdded: '1.16'
# Supports --autocorrect
Lint/EmptyInterpolation:
Description: Checks for empty string interpolation.
Enabled: true
AutoCorrect: contextual
VersionAdded: '0.20'
VersionChanged: '1.61'
Lint/EmptyWhen:
Description: Checks for `when` branches with empty bodies.
Enabled: true
AllowComments: true
VersionAdded: '0.45'
VersionChanged: '0.83'
# Supports --autocorrect
Lint/EnsureReturn:
Description: Do not use return in an ensure block.
StyleGuide: "#no-return-ensure"
Enabled: true
VersionAdded: '0.9'
VersionChanged: '0.83'
# Supports --autocorrect
Lint/ErbNewArguments:
Description: Use `:trim_mode` and `:eoutvar` keyword arguments to `ERB.new`.
Enabled: true
VersionAdded: '0.56'
Lint/FlipFlop:
Description: Checks for flip-flops.
StyleGuide: "#no-flip-flops"
Enabled: true
VersionAdded: '0.16'
Lint/FloatComparison:
Description: Checks for the presence of precise comparison of floating point numbers.
StyleGuide: "#float-comparison"
Enabled: true
VersionAdded: '0.89'
Lint/FloatOutOfRange:
Description: Catches floating-point literals too large or small for Ruby to represent.
Enabled: true
VersionAdded: '0.36'
Lint/FormatParameterMismatch:
Description: The number of parameters to format/sprint must match the fields.
Enabled: true
VersionAdded: '0.33'
Lint/HashCompareByIdentity:
Description: Prefer using `Hash#compare_by_identity` than using `object_id` for keys.
StyleGuide: "#identity-comparison"
Enabled: true
Safe: false
VersionAdded: '0.93'
# Supports --autocorrect
Lint/HeredocMethodCallPosition:
Description: Checks for the ordering of a method call where the receiver of the call
is a HEREDOC.
Enabled: true
StyleGuide: "#heredoc-method-calls"
VersionAdded: '0.68'
# Supports --autocorrect
Lint/IdentityComparison:
Description: Prefer `equal?` over `==` when comparing `object_id`.
Enabled: true
StyleGuide: "#identity-comparison"
VersionAdded: '0.91'
# Supports --autocorrect
Lint/ImplicitStringConcatenation:
Description: Checks for adjacent string literals on the same line, which could better
be represented as a single string literal.
Enabled: true
VersionAdded: '0.36'
# Supports --autocorrect
Lint/IncompatibleIoSelectWithFiberScheduler:
Description: Checks for `IO.select` that is incompatible with Fiber Scheduler.
Enabled: true
SafeAutoCorrect: false
VersionAdded: '1.21'
VersionChanged: '1.24'
Lint/IneffectiveAccessModifier:
Description: Checks for attempts to use `private` or `protected` to set the visibility
of a class method, which does not work.
Enabled: true
VersionAdded: '0.36'
# Supports --autocorrect
Lint/InheritException:
Description: Avoid inheriting from the `Exception` class.
Enabled: true
SafeAutoCorrect: false
VersionAdded: '0.41'
VersionChanged: '1.26'
EnforcedStyle: standard_error
SupportedStyles:
- standard_error
- runtime_error
# Supports --autocorrect
Lint/InterpolationCheck:
Description: Checks for interpolation in a single quoted string.
Enabled: true
SafeAutoCorrect: false
VersionAdded: '0.50'
VersionChanged: '1.40'
Lint/ItWithoutArgumentsInBlock:
Description: Checks uses of `it` calls without arguments in block.
Reference: https://bugs.ruby-lang.org/issues/18980
Enabled: true
VersionAdded: '1.59'
# Supports --autocorrect
Lint/LambdaWithoutLiteralBlock:
Description: Checks uses of lambda without a literal block.
Enabled: true
VersionAdded: '1.8'
Lint/LiteralAsCondition:
Description: Checks of literals used in conditions.
Enabled: true
VersionAdded: '0.51'
Lint/LiteralAssignmentInCondition:
Description: Checks for literal assignments in the conditions.
Enabled: true
VersionAdded: '1.58'
# Supports --autocorrect
Lint/LiteralInInterpolation:
Description: Checks for literals used in interpolation.
Enabled: true
VersionAdded: '0.19'
VersionChanged: '0.32'
# Supports --autocorrect
Lint/Loop:
Description: Use Kernel#loop with break rather than begin/end/until or begin/end/while
for post-loop tests.
StyleGuide: "#loop-with-break"
Enabled: true
VersionAdded: '0.9'
VersionChanged: '1.3'
Safe: false
Lint/MissingCopEnableDirective:
Description: Checks for a `# rubocop:enable` after `# rubocop:disable`.
Enabled: true
VersionAdded: '0.52'
MaximumRangeSize: .inf
Lint/MissingSuper:
Description: Checks for the presence of constructors and lifecycle callbacks without
calls to `super`.
Enabled: true
AllowedParentClasses: []
VersionAdded: '0.89'
VersionChanged: '1.4'
# Supports --autocorrect
Lint/MixedCaseRange:
Description: Checks for mixed-case character ranges since they include likely unintended
characters.
Enabled: true
SafeAutoCorrect: false
VersionAdded: '1.53'
Lint/MixedRegexpCaptureTypes:
Description: Do not mix named captures and numbered captures in a Regexp literal.
Enabled: true
VersionAdded: '0.85'
# Supports --autocorrect
Lint/MultipleComparison:
Description: Use `&&` operator to compare multiple values.
Enabled: true
VersionAdded: '0.47'
VersionChanged: '1.1'
Lint/NestedMethodDefinition:
Description: Do not use nested method definitions.
StyleGuide: "#no-nested-methods"
Enabled: true
AllowedMethods: []
AllowedPatterns: []
VersionAdded: '0.32'
Lint/NestedPercentLiteral:
Description: Checks for nested percent literals.
Enabled: true
VersionAdded: '0.52'
Lint/NextWithoutAccumulator:
Description: Do not omit the accumulator when calling `next` in a `reduce`/`inject`
block.
Enabled: true
VersionAdded: '0.36'
Lint/NoReturnInBeginEndBlocks:
Description: Do not `return` inside `begin..end` blocks in assignment contexts.
Enabled: true
VersionAdded: '1.2'
# Supports --autocorrect
Lint/NonAtomicFileOperation:
Description: Checks for non-atomic file operations.
StyleGuide: "#atomic-file-operations"
Enabled: true
VersionAdded: '1.31'
SafeAutoCorrect: false
# Supports --autocorrect
Lint/NonDeterministicRequireOrder:
Description: Always sort arrays returned by Dir.glob when requiring files.
Enabled: true
VersionAdded: '0.78'
Safe: false
Lint/NonLocalExitFromIterator:
Description: Do not use return in iterator to cause non-local exit.
Enabled: true
VersionAdded: '0.30'
# Supports --autocorrect
Lint/NumberConversion:
Description: Checks unsafe usage of number conversion methods.
Enabled: false
VersionAdded: '0.53'
VersionChanged: '1.1'
SafeAutoCorrect: false
AllowedMethods:
- ago
- from_now
- second
- seconds
- minute
- minutes
- hour
- hours
- day
- days
- week
- weeks
- fortnight
- fortnights
- in_milliseconds
AllowedPatterns: []
IgnoredClasses:
- Time
- DateTime
Lint/NumberedParameterAssignment:
Description: Checks for uses of numbered parameter assignment.
Enabled: true
VersionAdded: '1.9'
# Supports --autocorrect
Lint/OrAssignmentToConstant:
Description: Checks unintended or-assignment to constant.
Enabled: true
Safe: false
VersionAdded: '1.9'
# Supports --autocorrect
Lint/OrderedMagicComments:
Description: Checks the proper ordering of magic comments and whether a magic comment
is not placed before a shebang.
Enabled: true
SafeAutoCorrect: false
VersionAdded: '0.53'
VersionChanged: '1.37'
Lint/OutOfRangeRegexpRef:
Description: Checks for out of range reference for Regexp because it always returns
nil.
Enabled: true
Safe: false
VersionAdded: '0.89'
# Supports --autocorrect
Lint/ParenthesesAsGroupedExpression:
Description: Checks for method calls with a space before the opening parenthesis.
StyleGuide: "#parens-no-spaces"
Enabled: true
VersionAdded: '0.12'
VersionChanged: '0.83'
# Supports --autocorrect
Lint/PercentStringArray:
Description: Checks for unwanted commas and quotes in %w/%W literals.
Enabled: true
Safe: false
VersionAdded: '0.41'
# Supports --autocorrect
Lint/PercentSymbolArray:
Description: Checks for unwanted commas and colons in %i/%I literals.
Enabled: true
VersionAdded: '0.41'
# Supports --autocorrect
Lint/RaiseException:
Description: Checks for `raise` or `fail` statements which are raising `Exception`
class.
StyleGuide: "#raise-exception"
Enabled: true
Safe: false
VersionAdded: '0.81'
VersionChanged: '0.86'
AllowedImplicitNamespaces:
- Gem
Lint/RandOne:
Description: Checks for `rand(1)` calls. Such calls always return `0` and most likely
a mistake.
Enabled: true
VersionAdded: '0.36'
# Supports --autocorrect
Lint/RedundantCopDisableDirective:
Description: 'Checks for rubocop:disable comments that can be removed. Note: this
cop is not disabled when disabling all cops. It must be explicitly disabled.'
Enabled: true
VersionAdded: '0.76'
# Supports --autocorrect
Lint/RedundantCopEnableDirective:
Description: Checks for rubocop:enable comments that can be removed.
Enabled: true
VersionAdded: '0.76'
# Supports --autocorrect
Lint/RedundantDirGlobSort:
Description: Checks for redundant `sort` method to `Dir.glob` and `Dir[]`.
Enabled: true
VersionAdded: '1.8'
VersionChanged: '1.26'
SafeAutoCorrect: false
# Supports --autocorrect
Lint/RedundantRegexpQuantifiers:
Description: Checks for redundant quantifiers in Regexps.
Enabled: true
VersionAdded: '1.53'
# Supports --autocorrect
Lint/RedundantRequireStatement:
Description: Checks for unnecessary `require` statement.
Enabled: true
VersionAdded: '0.76'
VersionChanged: '1.57'
# Supports --autocorrect
Lint/RedundantSafeNavigation:
Description: Checks for redundant safe navigation calls.
Enabled: true
VersionAdded: '0.93'
AllowedMethods:
- instance_of?
- kind_of?
- is_a?
- eql?
- respond_to?
- equal?
- presence
- present?
Safe: false
# Supports --autocorrect
Lint/RedundantSplatExpansion:
Description: Checks for splat unnecessarily being called on literals.
Enabled: true
VersionAdded: '0.76'
VersionChanged: '1.7'
AllowPercentLiteralArrayArgument: true
# Supports --autocorrect
Lint/RedundantStringCoercion:
Description: Checks for Object#to_s usage in string interpolation.
StyleGuide: "#no-to-s"
Enabled: true
VersionAdded: '0.19'
VersionChanged: '0.77'
# Supports --autocorrect
Lint/RedundantWithIndex:
Description: Checks for redundant `with_index`.
Enabled: true
VersionAdded: '0.50'
# Supports --autocorrect
Lint/RedundantWithObject:
Description: Checks for redundant `with_object`.
Enabled: true
VersionAdded: '0.51'
Lint/RefinementImportMethods:
Description: Use `Refinement#import_methods` when using `include` or `prepend` in
`refine` block.
Enabled: true
SafeAutoCorrect: false
VersionAdded: '1.27'
# Supports --autocorrect
Lint/RegexpAsCondition:
Description: Do not use regexp literal as a condition. The regexp literal matches
`$_` implicitly.
Enabled: true
VersionAdded: '0.51'
VersionChanged: '0.86'
Lint/RequireParentheses:
Description: Use parentheses in the method call to avoid confusion about precedence.
Enabled: true
VersionAdded: '0.18'
Lint/RequireRangeParentheses:
Description: Checks that a range literal is enclosed in parentheses when the end of
the range is at a line break.
Enabled: true
VersionAdded: '1.32'
# Supports --autocorrect
Lint/RequireRelativeSelfPath:
Description: Checks for uses a file requiring itself with `require_relative`.
Enabled: true
VersionAdded: '1.22'
Lint/RescueException:
Description: Avoid rescuing the Exception class.
StyleGuide: "#no-blind-rescues"
Enabled: true
VersionAdded: '0.9'
VersionChanged: '0.27'
# Supports --autocorrect
Lint/RescueType:
Description: Avoid rescuing from non constants that could result in a `TypeError`.
Enabled: true
VersionAdded: '0.49'
Lint/ReturnInVoidContext:
Description: Checks for return in void context.
Enabled: true
VersionAdded: '0.50'
# Supports --autocorrect
Lint/SafeNavigationChain:
Description: Do not chain ordinary method call after safe navigation operator.
Enabled: true
VersionAdded: '0.47'
VersionChanged: '0.77'
AllowedMethods:
- present?
- blank?
- presence
- presence_in
- try
- try!
- in?
# Supports --autocorrect
Lint/SafeNavigationConsistency:
Description: Check to make sure that if safe navigation is used for a method call
in an `&&` or `||` condition that safe navigation is used for all method calls on
that same object.
Enabled: true
VersionAdded: '0.55'
VersionChanged: '0.77'
AllowedMethods:
- present?
- blank?
- presence
- try
- try!
# Supports --autocorrect
Lint/SafeNavigationWithEmpty:
Description: Avoid `foo&.empty?` in conditionals.
Enabled: true
VersionAdded: '0.62'
VersionChanged: '0.87'
# Supports --autocorrect
Lint/ScriptPermission:
Description: Grant script file execute permission.
Enabled: true
VersionAdded: '0.49'
VersionChanged: '0.50'
Lint/SelfAssignment:
Description: Checks for self-assignments.
Enabled: true
VersionAdded: '0.89'
# Supports --autocorrect
Lint/SendWithMixinArgument:
Description: Checks for `send` method when using mixin.
Enabled: true
VersionAdded: '0.75'
Lint/ShadowedArgument:
Description: Avoid reassigning arguments before they were used.
Enabled: true
VersionAdded: '0.52'
IgnoreImplicitReferences: false
Lint/ShadowedException:
Description: Avoid rescuing a higher level exception before a lower level exception.
Enabled: true
VersionAdded: '0.41'
Lint/ShadowingOuterLocalVariable:
Description: Do not use the same name as outer local variable for block arguments
or block local variables.
Enabled: true
VersionAdded: '0.9'
Lint/StructNewOverride:
Description: Disallow overriding the `Struct` built-in methods via `Struct.new`.
Enabled: true
VersionAdded: '0.81'
Lint/SuppressedException:
Description: Don't suppress exceptions.
StyleGuide: "#dont-hide-exceptions"
Enabled: true
AllowComments: true
AllowNil: true
VersionAdded: '0.9'
VersionChanged: '1.12'
# Supports --autocorrect
Lint/SymbolConversion:
Description: Checks for unnecessary symbol conversions.
Enabled: true
VersionAdded: '1.9'
VersionChanged: '1.16'
EnforcedStyle: strict
SupportedStyles:
- strict
- consistent
#Lint/Syntax:
# Description: Checks for syntax errors.
# Enabled: true
# VersionAdded: '0.9'
Lint/ToEnumArguments:
Description: Ensures that `to_enum`/`enum_for`, called for the current method, has
correct arguments.
Enabled: true
VersionAdded: '1.1'
# Supports --autocorrect
Lint/ToJSON:
Description: 'Ensure #to_json includes an optional argument.'
Enabled: true
VersionAdded: '0.66'
# Supports --autocorrect
Lint/TopLevelReturnWithArgument:
Description: Detects top level return statements with argument.
Enabled: true
VersionAdded: '0.89'
Exclude:
- "/Users/rubyon/Desktop/liaf-rails/**/*.jb"
# Supports --autocorrect
Lint/TrailingCommaInAttributeDeclaration:
Description: Checks for trailing commas in attribute declarations.
Enabled: true
AutoCorrect: contextual
VersionAdded: '0.90'
VersionChanged: '1.61'
# Supports --autocorrect
Lint/TripleQuotes:
Description: Checks for useless triple quote constructs.
Enabled: true
VersionAdded: '1.9'
Lint/UnderscorePrefixedVariableName:
Description: Do not use prefix `_` for a variable that is used.
Enabled: true
VersionAdded: '0.21'
AllowKeywordBlockArguments: false
Lint/UnexpectedBlockArity:
Description: Looks for blocks that have fewer arguments that the calling method expects.
Enabled: true
Safe: false
VersionAdded: '1.5'
Methods:
chunk_while: 2
each_with_index: 2
each_with_object: 2
inject: 2
max: 2
min: 2
minmax: 2
reduce: 2
slice_when: 2
sort: 2
# Supports --autocorrect
Lint/UnifiedInteger:
Description: Use Integer instead of Fixnum or Bignum.
Enabled: true
VersionAdded: '0.43'
Lint/UnmodifiedReduceAccumulator:
Description: Checks for `reduce` or `inject` blocks that do not update the accumulator
each iteration.
Enabled: true
VersionAdded: '1.1'
VersionChanged: '1.5'
Lint/UnreachableCode:
Description: Unreachable code.
Enabled: true
VersionAdded: '0.9'
Lint/UnreachableLoop:
Description: Checks for loops that will have at most one iteration.
Enabled: true
VersionAdded: '0.89'
VersionChanged: '1.7'
AllowedPatterns:
- !ruby/regexp /(exactly|at_least|at_most)\(\d+\)\.times/
# Supports --autocorrect
Lint/UnusedBlockArgument:
Description: Checks for unused block arguments.
StyleGuide: "#underscore-unused-vars"
Enabled: true
AutoCorrect: contextual
VersionAdded: '0.21'
VersionChanged: '1.61'
IgnoreEmptyBlocks: true
AllowUnusedKeywordArguments: false
# Supports --autocorrect
Lint/UnusedMethodArgument:
Description: Checks for unused method arguments.
StyleGuide: "#underscore-unused-vars"
Enabled: true
AutoCorrect: contextual
VersionAdded: '0.21'
VersionChanged: '1.61'
AllowUnusedKeywordArguments: false
IgnoreEmptyMethods: true
IgnoreNotImplementedMethods: true
Lint/UriEscapeUnescape:
Description: "`URI.escape` method is obsolete and should not be used. Instead, use
`CGI.escape`, `URI.encode_www_form` or `URI.encode_www_form_component` depending
on your specific use case. Also `URI.unescape` method is obsolete and should not
be used. Instead, use `CGI.unescape`, `URI.decode_www_form` or `URI.decode_www_form_component`
depending on your specific use case."
Enabled: true
VersionAdded: '0.50'
# Supports --autocorrect
Lint/UriRegexp: