graphql-pundit 0.5.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1745 +0,0 @@
1
- # These are all the cops that are enabled in the default configuration.
2
-
3
- #################### Layout ###############################
4
-
5
- Layout/AccessModifierIndentation:
6
- Description: Check indentation of private/protected visibility modifiers.
7
- StyleGuide: '#indent-public-private-protected'
8
- Enabled: true
9
-
10
- Layout/AlignArray:
11
- Description: >-
12
- Align the elements of an array literal if they span more than
13
- one line.
14
- StyleGuide: '#align-multiline-arrays'
15
- Enabled: true
16
-
17
- Layout/AlignHash:
18
- Description: >-
19
- Align the elements of a hash literal if they span more than
20
- one line.
21
- Enabled: true
22
-
23
- Layout/AlignParameters:
24
- Description: >-
25
- Align the parameters of a method call if they span more
26
- than one line.
27
- StyleGuide: '#no-double-indent'
28
- Enabled: true
29
-
30
- Layout/BlockEndNewline:
31
- Description: 'Put end statement of multiline block on its own line.'
32
- Enabled: true
33
-
34
- Layout/CaseIndentation:
35
- Description: 'Indentation of when in a case/when/[else/]end.'
36
- StyleGuide: '#indent-when-to-case'
37
- Enabled: true
38
-
39
- Layout/ClosingParenthesisIndentation:
40
- Description: 'Checks the indentation of hanging closing parentheses.'
41
- Enabled: true
42
-
43
- Layout/CommentIndentation:
44
- Description: 'Indentation of comments.'
45
- Enabled: true
46
-
47
- Layout/DotPosition:
48
- Description: 'Checks the position of the dot in multi-line method calls.'
49
- StyleGuide: '#consistent-multi-line-chains'
50
- Enabled: true
51
-
52
- Layout/ElseAlignment:
53
- Description: 'Align elses and elsifs correctly.'
54
- Enabled: true
55
-
56
- Layout/EmptyLineBetweenDefs:
57
- Description: 'Use empty lines between defs.'
58
- StyleGuide: '#empty-lines-between-methods'
59
- Enabled: true
60
-
61
- Layout/EmptyLines:
62
- Description: "Don't use several empty lines in a row."
63
- StyleGuide: '#two-or-more-empty-lines'
64
- Enabled: true
65
-
66
- Layout/EmptyLinesAroundAccessModifier:
67
- Description: "Keep blank lines around access modifiers."
68
- StyleGuide: '#empty-lines-around-access-modifier'
69
- Enabled: true
70
-
71
- Layout/EmptyLinesAroundBeginBody:
72
- Description: "Keeps track of empty lines around begin-end bodies."
73
- StyleGuide: '#empty-lines-around-bodies'
74
- Enabled: true
75
-
76
- Layout/EmptyLinesAroundBlockBody:
77
- Description: "Keeps track of empty lines around block bodies."
78
- StyleGuide: '#empty-lines-around-bodies'
79
- Enabled: true
80
-
81
- Layout/EmptyLinesAroundClassBody:
82
- Description: "Keeps track of empty lines around class bodies."
83
- StyleGuide: '#empty-lines-around-bodies'
84
- Enabled: true
85
-
86
- Layout/EmptyLinesAroundExceptionHandlingKeywords:
87
- Description: "Keeps track of empty lines around exception handling keywords."
88
- StyleGuide: '#empty-lines-around-bodies'
89
- Enabled: true
90
-
91
- Layout/EmptyLinesAroundModuleBody:
92
- Description: "Keeps track of empty lines around module bodies."
93
- StyleGuide: '#empty-lines-around-bodies'
94
- Enabled: true
95
-
96
- Layout/EmptyLinesAroundMethodBody:
97
- Description: "Keeps track of empty lines around method bodies."
98
- StyleGuide: '#empty-lines-around-bodies'
99
- Enabled: true
100
-
101
- Layout/EndOfLine:
102
- Description: 'Use Unix-style line endings.'
103
- StyleGuide: '#crlf'
104
- Enabled: true
105
-
106
- Layout/ExtraSpacing:
107
- Description: 'Do not use unnecessary spacing.'
108
- Enabled: true
109
-
110
- Layout/InitialIndentation:
111
- Description: >-
112
- Checks the indentation of the first non-blank non-comment line in a file.
113
- Enabled: true
114
-
115
- Layout/FirstParameterIndentation:
116
- Description: 'Checks the indentation of the first parameter in a method call.'
117
- Enabled: true
118
-
119
- Layout/IndentationConsistency:
120
- Description: 'Keep indentation straight.'
121
- StyleGuide: '#spaces-indentation'
122
- Enabled: true
123
-
124
- Layout/IndentationWidth:
125
- Description: 'Use 2 spaces for indentation.'
126
- StyleGuide: '#spaces-indentation'
127
- Enabled: true
128
-
129
- Layout/IndentArray:
130
- Description: >-
131
- Checks the indentation of the first element in an array
132
- literal.
133
- Enabled: true
134
-
135
- Layout/IndentAssignment:
136
- Description: >-
137
- Checks the indentation of the first line of the
138
- right-hand-side of a multi-line assignment.
139
- Enabled: true
140
-
141
- Layout/IndentHash:
142
- Description: 'Checks the indentation of the first key in a hash literal.'
143
- Enabled: true
144
-
145
- Layout/IndentHeredoc:
146
- Description: 'This cops checks the indentation of the here document bodies.'
147
- StyleGuide: '#squiggly-heredocs'
148
- Enabled: true
149
-
150
- Layout/SpaceInLambdaLiteral:
151
- Description: 'Checks for spaces in lambda literals.'
152
- Enabled: true
153
-
154
- Layout/LeadingCommentSpace:
155
- Description: 'Comments should start with a space.'
156
- StyleGuide: '#hash-space'
157
- Enabled: true
158
-
159
- Layout/MultilineArrayBraceLayout:
160
- Description: >-
161
- Checks that the closing brace in an array literal is
162
- either on the same line as the last array element, or
163
- a new line.
164
- Enabled: true
165
-
166
- Layout/MultilineBlockLayout:
167
- Description: 'Ensures newlines after multiline block do statements.'
168
- Enabled: true
169
-
170
- Layout/MultilineHashBraceLayout:
171
- Description: >-
172
- Checks that the closing brace in a hash literal is
173
- either on the same line as the last hash element, or
174
- a new line.
175
- Enabled: true
176
-
177
- Layout/MultilineMethodCallBraceLayout:
178
- Description: >-
179
- Checks that the closing brace in a method call is
180
- either on the same line as the last method argument, or
181
- a new line.
182
- Enabled: true
183
-
184
- Layout/MultilineMethodCallIndentation:
185
- Description: >-
186
- Checks indentation of method calls with the dot operator
187
- that span more than one line.
188
- Enabled: true
189
-
190
- Layout/MultilineMethodDefinitionBraceLayout:
191
- Description: >-
192
- Checks that the closing brace in a method definition is
193
- either on the same line as the last method parameter, or
194
- a new line.
195
- Enabled: true
196
-
197
- Layout/MultilineOperationIndentation:
198
- Description: >-
199
- Checks indentation of binary operations that span more than
200
- one line.
201
- Enabled: true
202
-
203
- Layout/EmptyLineAfterMagicComment:
204
- Description: 'Add an empty line after magic comments to separate them from code.'
205
- StyleGuide: '#separate-magic-comments-from-code'
206
- Enabled: true
207
-
208
- Layout/RescueEnsureAlignment:
209
- Description: 'Align rescues and ensures correctly.'
210
- Enabled: true
211
-
212
- Layout/SpaceBeforeFirstArg:
213
- Description: >-
214
- Checks that exactly one space is used between a method name
215
- and the first argument for method calls without parentheses.
216
- Enabled: true
217
-
218
- Layout/SpaceAfterColon:
219
- Description: 'Use spaces after colons.'
220
- StyleGuide: '#spaces-operators'
221
- Enabled: true
222
-
223
- Layout/SpaceAfterComma:
224
- Description: 'Use spaces after commas.'
225
- StyleGuide: '#spaces-operators'
226
- Enabled: true
227
-
228
- Layout/SpaceAfterMethodName:
229
- Description: >-
230
- Do not put a space between a method name and the opening
231
- parenthesis in a method definition.
232
- StyleGuide: '#parens-no-spaces'
233
- Enabled: true
234
-
235
- Layout/SpaceAfterNot:
236
- Description: Tracks redundant space after the ! operator.
237
- StyleGuide: '#no-space-bang'
238
- Enabled: true
239
-
240
- Layout/SpaceAfterSemicolon:
241
- Description: 'Use spaces after semicolons.'
242
- StyleGuide: '#spaces-operators'
243
- Enabled: true
244
-
245
- Layout/SpaceBeforeBlockBraces:
246
- Description: >-
247
- Checks that the left block brace has or doesn't have space
248
- before it.
249
- Enabled: true
250
-
251
- Layout/SpaceBeforeComma:
252
- Description: 'No spaces before commas.'
253
- Enabled: true
254
-
255
- Layout/SpaceBeforeComment:
256
- Description: >-
257
- Checks for missing space between code and a comment on the
258
- same line.
259
- Enabled: true
260
-
261
- Layout/SpaceBeforeSemicolon:
262
- Description: 'No spaces before semicolons.'
263
- Enabled: true
264
-
265
- Layout/SpaceInsideBlockBraces:
266
- Description: >-
267
- Checks that block braces have or don't have surrounding space.
268
- For blocks taking parameters, checks that the left brace has
269
- or doesn't have trailing space.
270
- Enabled: true
271
-
272
- Layout/SpaceAroundBlockParameters:
273
- Description: 'Checks the spacing inside and after block parameters pipes.'
274
- Enabled: true
275
-
276
- Layout/SpaceAroundEqualsInParameterDefault:
277
- Description: >-
278
- Checks that the equals signs in parameter default assignments
279
- have or don't have surrounding space depending on
280
- configuration.
281
- StyleGuide: '#spaces-around-equals'
282
- Enabled: true
283
-
284
- Layout/SpaceAroundKeyword:
285
- Description: 'Use a space around keywords if appropriate.'
286
- Enabled: true
287
-
288
- Layout/SpaceAroundOperators:
289
- Description: 'Use a single space around operators.'
290
- StyleGuide: '#spaces-operators'
291
- Enabled: true
292
-
293
- Layout/SpaceInsideArrayPercentLiteral:
294
- Description: 'No unnecessary additional spaces between elements in %i/%w literals.'
295
- Enabled: true
296
-
297
- Layout/SpaceInsidePercentLiteralDelimiters:
298
- Description: 'No unnecessary spaces inside delimiters of %i/%w/%x literals.'
299
- Enabled: true
300
-
301
- Layout/SpaceInsideBrackets:
302
- Description: 'No spaces after [ or before ].'
303
- StyleGuide: '#no-spaces-braces'
304
- Enabled: true
305
-
306
- Layout/SpaceInsideHashLiteralBraces:
307
- Description: "Use spaces inside hash literal braces - or don't."
308
- StyleGuide: '#spaces-operators'
309
- Enabled: true
310
-
311
- Layout/SpaceInsideParens:
312
- Description: 'No spaces after ( or before ).'
313
- StyleGuide: '#no-spaces-braces'
314
- Enabled: true
315
-
316
- Layout/SpaceInsideRangeLiteral:
317
- Description: 'No spaces inside range literals.'
318
- StyleGuide: '#no-space-inside-range-literals'
319
- Enabled: true
320
-
321
- Layout/SpaceInsideStringInterpolation:
322
- Description: 'Checks for padding/surrounding spaces inside string interpolation.'
323
- StyleGuide: '#string-interpolation'
324
- Enabled: true
325
-
326
- Layout/Tab:
327
- Description: 'No hard tabs.'
328
- StyleGuide: '#spaces-indentation'
329
- Enabled: true
330
-
331
- Layout/TrailingBlankLines:
332
- Description: 'Checks trailing blank lines and final newline.'
333
- StyleGuide: '#newline-eof'
334
- Enabled: true
335
-
336
- Layout/TrailingWhitespace:
337
- Description: 'Avoid trailing whitespace.'
338
- StyleGuide: '#no-trailing-whitespace'
339
- Enabled: true
340
-
341
- #################### Naming ##############################
342
-
343
- Naming/AccessorMethodName:
344
- Description: Check the naming of accessor methods for get_/set_.
345
- StyleGuide: '#accessor_mutator_method_names'
346
- Enabled: true
347
-
348
- Naming/AsciiIdentifiers:
349
- Description: 'Use only ascii symbols in identifiers.'
350
- StyleGuide: '#english-identifiers'
351
- Enabled: true
352
-
353
- Naming/BinaryOperatorParameterName:
354
- Description: 'When defining binary operators, name the argument other.'
355
- StyleGuide: '#other-arg'
356
- Enabled: true
357
-
358
- Naming/ClassAndModuleCamelCase:
359
- Description: 'Use CamelCase for classes and modules.'
360
- StyleGuide: '#camelcase-classes'
361
- Enabled: true
362
-
363
- Naming/ConstantName:
364
- Description: 'Constants should use SCREAMING_SNAKE_CASE.'
365
- StyleGuide: '#screaming-snake-case'
366
- Enabled: true
367
-
368
- Naming/FileName:
369
- Description: 'Use snake_case for source file names.'
370
- StyleGuide: '#snake-case-files'
371
- Enabled: true
372
-
373
- Naming/MethodName:
374
- Description: 'Use the configured style when naming methods.'
375
- StyleGuide: '#snake-case-symbols-methods-vars'
376
- Enabled: true
377
-
378
- Naming/PredicateName:
379
- Description: 'Check the names of predicate methods.'
380
- StyleGuide: '#bool-methods-qmark'
381
- Enabled: true
382
-
383
- Naming/VariableName:
384
- Description: 'Use the configured style when naming variables.'
385
- StyleGuide: '#snake-case-symbols-methods-vars'
386
- Enabled: true
387
-
388
- Naming/VariableNumber:
389
- Description: 'Use the configured style when numbering variables.'
390
- Enabled: true
391
-
392
- #################### Style ###############################
393
-
394
- Style/Alias:
395
- Description: 'Use alias instead of alias_method.'
396
- StyleGuide: '#alias-method'
397
- Enabled: true
398
-
399
- Style/AndOr:
400
- Description: 'Use &&/|| instead of and/or.'
401
- StyleGuide: '#no-and-or-or'
402
- Enabled: true
403
-
404
- Style/ArrayJoin:
405
- Description: 'Use Array#join instead of Array#*.'
406
- StyleGuide: '#array-join'
407
- Enabled: true
408
-
409
- Style/AsciiComments:
410
- Description: 'Use only ascii symbols in comments.'
411
- StyleGuide: '#english-comments'
412
- Enabled: true
413
-
414
- Style/Attr:
415
- Description: 'Checks for uses of Module#attr.'
416
- StyleGuide: '#attr'
417
- Enabled: true
418
-
419
- Style/BeginBlock:
420
- Description: 'Avoid the use of BEGIN blocks.'
421
- StyleGuide: '#no-BEGIN-blocks'
422
- Enabled: true
423
-
424
- Style/BarePercentLiterals:
425
- Description: 'Checks if usage of %() or %Q() matches configuration.'
426
- StyleGuide: '#percent-q-shorthand'
427
- Enabled: true
428
-
429
- Style/BlockComments:
430
- Description: 'Do not use block comments.'
431
- StyleGuide: '#no-block-comments'
432
- Enabled: true
433
-
434
- Style/BlockDelimiters:
435
- Description: >-
436
- Avoid using {...} for multi-line blocks (multiline chaining is
437
- always ugly).
438
- Prefer {...} over do...end for single-line blocks.
439
- StyleGuide: '#single-line-blocks'
440
- Enabled: true
441
-
442
- Style/BracesAroundHashParameters:
443
- Description: 'Enforce braces style around hash parameters.'
444
- Enabled: true
445
-
446
- Style/CaseEquality:
447
- Description: 'Avoid explicit use of the case equality operator(===).'
448
- StyleGuide: '#no-case-equality'
449
- Enabled: true
450
-
451
- Style/CharacterLiteral:
452
- Description: 'Checks for uses of character literals.'
453
- StyleGuide: '#no-character-literals'
454
- Enabled: true
455
-
456
- Style/ClassAndModuleChildren:
457
- Description: 'Checks style of children classes and modules.'
458
- Enabled: true
459
-
460
- Style/ClassCheck:
461
- Description: 'Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.'
462
- Enabled: true
463
-
464
- Style/ClassMethods:
465
- Description: 'Use self when defining module/class methods.'
466
- StyleGuide: '#def-self-class-methods'
467
- Enabled: true
468
-
469
- Style/ClassVars:
470
- Description: 'Avoid the use of class variables.'
471
- StyleGuide: '#no-class-vars'
472
- Enabled: true
473
-
474
- Style/ColonMethodCall:
475
- Description: 'Do not use :: for method call.'
476
- StyleGuide: '#double-colons'
477
- Enabled: true
478
-
479
- Style/CommandLiteral:
480
- Description: 'Use `` or %x around command literals.'
481
- StyleGuide: '#percent-x'
482
- Enabled: true
483
-
484
- Style/CommentAnnotation:
485
- Description: >-
486
- Checks formatting of special comments
487
- (TODO, FIXME, OPTIMIZE, HACK, REVIEW).
488
- StyleGuide: '#annotate-keywords'
489
- Enabled: true
490
-
491
- Style/ConditionalAssignment:
492
- Description: >-
493
- Use the return value of `if` and `case` statements for
494
- assignment to a variable and variable comparison instead
495
- of assigning that variable inside of each branch.
496
- Enabled: true
497
-
498
- Style/DefWithParentheses:
499
- Description: 'Use def with parentheses when there are arguments.'
500
- StyleGuide: '#method-parens'
501
- Enabled: true
502
-
503
- Style/Documentation:
504
- Description: 'Document classes and non-namespace modules.'
505
- Enabled: true
506
- Exclude:
507
- - 'spec/**/*'
508
- - 'test/**/*'
509
-
510
- Style/DoubleNegation:
511
- Description: 'Checks for uses of double negation (!!).'
512
- StyleGuide: '#no-bang-bang'
513
- Enabled: true
514
-
515
- Style/EachForSimpleLoop:
516
- Description: >-
517
- Use `Integer#times` for a simple loop which iterates a fixed
518
- number of times.
519
- Enabled: true
520
-
521
- Style/EachWithObject:
522
- Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
523
- Enabled: true
524
-
525
- Style/EmptyElse:
526
- Description: 'Avoid empty else-clauses.'
527
- Enabled: true
528
-
529
- Style/EmptyCaseCondition:
530
- Description: 'Avoid empty condition in case statements.'
531
- Enabled: true
532
-
533
- Style/EmptyLiteral:
534
- Description: 'Prefer literals to Array.new/Hash.new/String.new.'
535
- StyleGuide: '#literal-array-hash'
536
- Enabled: true
537
-
538
- Style/EmptyMethod:
539
- Description: 'Checks the formatting of empty method definitions.'
540
- StyleGuide: '#no-single-line-methods'
541
- Enabled: true
542
-
543
- Style/EndBlock:
544
- Description: 'Avoid the use of END blocks.'
545
- StyleGuide: '#no-END-blocks'
546
- Enabled: true
547
-
548
- Style/EvenOdd:
549
- Description: 'Favor the use of Integer#even? && Integer#odd?'
550
- StyleGuide: '#predicate-methods'
551
- Enabled: true
552
-
553
- Style/FrozenStringLiteralComment:
554
- Description: >-
555
- Add the frozen_string_literal comment to the top of files
556
- to help transition from Ruby 2.3.0 to Ruby 3.0.
557
- Enabled: true
558
-
559
- Style/FlipFlop:
560
- Description: 'Checks for flip flops'
561
- StyleGuide: '#no-flip-flops'
562
- Enabled: true
563
-
564
- Style/For:
565
- Description: 'Checks use of for or each in multiline loops.'
566
- StyleGuide: '#no-for-loops'
567
- Enabled: true
568
-
569
- Style/FormatString:
570
- Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
571
- StyleGuide: '#sprintf'
572
- Enabled: true
573
-
574
- Style/FormatStringToken:
575
- Description: 'Use a consistent style for format string tokens.'
576
- Enabled: true
577
-
578
- Style/GlobalVars:
579
- Description: 'Do not introduce global variables.'
580
- StyleGuide: '#instance-vars'
581
- Reference: 'http://www.zenspider.com/Languages/Ruby/QuickRef.html'
582
- Enabled: true
583
-
584
- Style/GuardClause:
585
- Description: 'Check for conditionals that can be replaced with guard clauses'
586
- StyleGuide: '#no-nested-conditionals'
587
- Enabled: true
588
-
589
- Style/HashSyntax:
590
- Description: >-
591
- Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
592
- { :a => 1, :b => 2 }.
593
- StyleGuide: '#hash-literals'
594
- Enabled: true
595
-
596
- Style/IfInsideElse:
597
- Description: 'Finds if nodes inside else, which can be converted to elsif.'
598
- Enabled: true
599
-
600
- Style/IfUnlessModifier:
601
- Description: >-
602
- Favor modifier if/unless usage when you have a
603
- single-line body.
604
- StyleGuide: '#if-as-a-modifier'
605
- Enabled: true
606
-
607
- Style/IfUnlessModifierOfIfUnless:
608
- Description: >-
609
- Avoid modifier if/unless usage on conditionals.
610
- Enabled: true
611
-
612
- Style/IfWithSemicolon:
613
- Description: 'Do not use if x; .... Use the ternary operator instead.'
614
- StyleGuide: '#no-semicolon-ifs'
615
- Enabled: true
616
-
617
- Style/IdenticalConditionalBranches:
618
- Description: >-
619
- Checks that conditional statements do not have an identical
620
- line at the end of each branch, which can validly be moved
621
- out of the conditional.
622
- Enabled: true
623
-
624
- Style/InfiniteLoop:
625
- Description: 'Use Kernel#loop for infinite loops.'
626
- StyleGuide: '#infinite-loop'
627
- Enabled: true
628
-
629
- Style/InverseMethods:
630
- Description: >-
631
- Use the inverse method instead of `!.method`
632
- if an inverse method is defined.
633
- Enabled: true
634
-
635
- Style/Lambda:
636
- Description: 'Use the new lambda literal syntax for single-line blocks.'
637
- StyleGuide: '#lambda-multi-line'
638
- Enabled: true
639
-
640
- Style/LambdaCall:
641
- Description: 'Use lambda.call(...) instead of lambda.(...).'
642
- StyleGuide: '#proc-call'
643
- Enabled: true
644
-
645
- Style/LineEndConcatenation:
646
- Description: >-
647
- Use \ instead of + or << to concatenate two string literals at
648
- line end.
649
- Enabled: true
650
-
651
- Style/MethodCallWithoutArgsParentheses:
652
- Description: 'Do not use parentheses for method calls with no arguments.'
653
- StyleGuide: '#method-invocation-parens'
654
- Enabled: true
655
-
656
- Style/MethodDefParentheses:
657
- Description: >-
658
- Checks if the method definitions have or don't have
659
- parentheses.
660
- StyleGuide: '#method-parens'
661
- Enabled: true
662
-
663
- Style/MethodMissing:
664
- Description: 'Avoid using `method_missing`.'
665
- StyleGuide: '#no-method-missing'
666
- Enabled: true
667
-
668
- Style/MixinGrouping:
669
- Description: 'Checks for grouping of mixins in `class` and `module` bodies.'
670
- StyleGuide: '#mixin-grouping'
671
- Enabled: true
672
-
673
- Style/ModuleFunction:
674
- Description: 'Checks for usage of `extend self` in modules.'
675
- StyleGuide: '#module-function'
676
- Enabled: true
677
-
678
- Style/MultilineBlockChain:
679
- Description: 'Avoid multi-line chains of blocks.'
680
- StyleGuide: '#single-line-blocks'
681
- Enabled: true
682
-
683
- Style/MultilineIfThen:
684
- Description: 'Do not use then for multi-line if/unless.'
685
- StyleGuide: '#no-then'
686
- Enabled: true
687
-
688
- Style/MultilineIfModifier:
689
- Description: 'Only use if/unless modifiers on single line statements.'
690
- StyleGuide: '#no-multiline-if-modifiers'
691
- Enabled: true
692
-
693
- Style/MultilineMemoization:
694
- Description: 'Wrap multiline memoizations in a `begin` and `end` block.'
695
- Enabled: true
696
-
697
- Style/MultilineTernaryOperator:
698
- Description: >-
699
- Avoid multi-line ?: (the ternary operator);
700
- use if/unless instead.
701
- StyleGuide: '#no-multiline-ternary'
702
- Enabled: true
703
-
704
- Style/MultipleComparison:
705
- Description: >-
706
- Avoid comparing a variable with multiple items in a conditional,
707
- use Array#include? instead.
708
- Enabled: true
709
-
710
- Style/MutableConstant:
711
- Description: 'Do not assign mutable objects to constants.'
712
- Enabled: true
713
-
714
- Style/NegatedIf:
715
- Description: >-
716
- Favor unless over if for negative conditions
717
- (or control flow or).
718
- StyleGuide: '#unless-for-negatives'
719
- Enabled: true
720
-
721
- Style/NegatedWhile:
722
- Description: 'Favor until over while for negative conditions.'
723
- StyleGuide: '#until-for-negatives'
724
- Enabled: true
725
-
726
- Style/NestedModifier:
727
- Description: 'Avoid using nested modifiers.'
728
- StyleGuide: '#no-nested-modifiers'
729
- Enabled: true
730
-
731
- Style/NestedParenthesizedCalls:
732
- Description: >-
733
- Parenthesize method calls which are nested inside the
734
- argument list of another parenthesized method call.
735
- Enabled: true
736
-
737
- Style/NestedTernaryOperator:
738
- Description: 'Use one expression per branch in a ternary operator.'
739
- StyleGuide: '#no-nested-ternary'
740
- Enabled: true
741
-
742
- Style/Next:
743
- Description: 'Use `next` to skip iteration instead of a condition at the end.'
744
- StyleGuide: '#no-nested-conditionals'
745
- Enabled: true
746
-
747
- Style/NilComparison:
748
- Description: 'Prefer x.nil? to x == nil.'
749
- StyleGuide: '#predicate-methods'
750
- Enabled: true
751
-
752
- Style/NonNilCheck:
753
- Description: 'Checks for redundant nil checks.'
754
- StyleGuide: '#no-non-nil-checks'
755
- Enabled: true
756
-
757
- Style/Not:
758
- Description: 'Use ! instead of not.'
759
- StyleGuide: '#bang-not-not'
760
- Enabled: true
761
-
762
- Style/NumericLiterals:
763
- Description: >-
764
- Add underscores to large numeric literals to improve their
765
- readability.
766
- StyleGuide: '#underscores-in-numerics'
767
- Enabled: true
768
-
769
- Style/NumericLiteralPrefix:
770
- Description: 'Use smallcase prefixes for numeric literals.'
771
- StyleGuide: '#numeric-literal-prefixes'
772
- Enabled: true
773
-
774
- Style/NumericPredicate:
775
- Description: >-
776
- Checks for the use of predicate- or comparison methods for
777
- numeric comparisons.
778
- StyleGuide: '#predicate-methods'
779
- # This will change to a new method call which isn't guaranteed to be on the
780
- # object. Switching these methods has to be done with knowledge of the types
781
- # of the variables which rubocop doesn't have.
782
- AutoCorrect: false
783
- Enabled: true
784
-
785
- Style/OneLineConditional:
786
- Description: >-
787
- Favor the ternary operator(?:) over
788
- if/then/else/end constructs.
789
- StyleGuide: '#ternary-operator'
790
- Enabled: true
791
-
792
- Style/OptionalArguments:
793
- Description: >-
794
- Checks for optional arguments that do not appear at the end
795
- of the argument list
796
- StyleGuide: '#optional-arguments'
797
- Enabled: true
798
-
799
- Style/ParallelAssignment:
800
- Description: >-
801
- Check for simple usages of parallel assignment.
802
- It will only warn when the number of variables
803
- matches on both sides of the assignment.
804
- StyleGuide: '#parallel-assignment'
805
- Enabled: true
806
-
807
- Style/ParenthesesAroundCondition:
808
- Description: >-
809
- Don't use parentheses around the condition of an
810
- if/unless/while.
811
- StyleGuide: '#no-parens-around-condition'
812
- Enabled: true
813
-
814
- Style/PercentLiteralDelimiters:
815
- Description: 'Use `%`-literal delimiters consistently'
816
- StyleGuide: '#percent-literal-braces'
817
- Enabled: true
818
-
819
- Style/PercentQLiterals:
820
- Description: 'Checks if uses of %Q/%q match the configured preference.'
821
- Enabled: true
822
-
823
- Style/PerlBackrefs:
824
- Description: 'Avoid Perl-style regex back references.'
825
- StyleGuide: '#no-perl-regexp-last-matchers'
826
- Enabled: true
827
-
828
- Style/PreferredHashMethods:
829
- Description: 'Checks use of `has_key?` and `has_value?` Hash methods.'
830
- StyleGuide: '#hash-key'
831
- Enabled: true
832
-
833
- Style/Proc:
834
- Description: 'Use proc instead of Proc.new.'
835
- StyleGuide: '#proc'
836
- Enabled: true
837
-
838
- Style/RaiseArgs:
839
- Description: 'Checks the arguments passed to raise/fail.'
840
- StyleGuide: '#exception-class-messages'
841
- Enabled: true
842
-
843
- Style/RedundantBegin:
844
- Description: "Don't use begin blocks when they are not needed."
845
- StyleGuide: '#begin-implicit'
846
- Enabled: true
847
-
848
- Style/RedundantException:
849
- Description: "Checks for an obsolete RuntimeException argument in raise/fail."
850
- StyleGuide: '#no-explicit-runtimeerror'
851
- Enabled: true
852
-
853
- Style/RedundantFreeze:
854
- Description: "Checks usages of Object#freeze on immutable objects."
855
- Enabled: true
856
-
857
- Style/RedundantParentheses:
858
- Description: "Checks for parentheses that seem not to serve any purpose."
859
- Enabled: true
860
-
861
- Style/RedundantReturn:
862
- Description: "Don't use return where it's not required."
863
- StyleGuide: '#no-explicit-return'
864
- Enabled: true
865
-
866
- Style/RedundantSelf:
867
- Description: "Don't use self where it's not needed."
868
- StyleGuide: '#no-self-unless-required'
869
- Enabled: true
870
-
871
- Style/RegexpLiteral:
872
- Description: 'Use / or %r around regular expressions.'
873
- StyleGuide: '#percent-r'
874
- Enabled: true
875
-
876
- Style/RescueModifier:
877
- Description: 'Avoid using rescue in its modifier form.'
878
- StyleGuide: '#no-rescue-modifiers'
879
- Enabled: true
880
-
881
- Style/SafeNavigation:
882
- Description: >-
883
- This cop transforms usages of a method call safeguarded by
884
- a check for the existance of the object to
885
- safe navigation (`&.`).
886
- Enabled: true
887
-
888
- Style/SelfAssignment:
889
- Description: >-
890
- Checks for places where self-assignment shorthand should have
891
- been used.
892
- StyleGuide: '#self-assignment'
893
- Enabled: true
894
-
895
- Style/Semicolon:
896
- Description: "Don't use semicolons to terminate expressions."
897
- StyleGuide: '#no-semicolon'
898
- Enabled: true
899
-
900
- Style/SignalException:
901
- Description: 'Checks for proper usage of fail and raise.'
902
- StyleGuide: '#prefer-raise-over-fail'
903
- Enabled: true
904
-
905
- Style/SingleLineMethods:
906
- Description: 'Avoid single-line methods.'
907
- StyleGuide: '#no-single-line-methods'
908
- Enabled: true
909
-
910
- Style/SpecialGlobalVars:
911
- Description: 'Avoid Perl-style global variables.'
912
- StyleGuide: '#no-cryptic-perlisms'
913
- Enabled: true
914
-
915
- Style/StabbyLambdaParentheses:
916
- Description: 'Check for the usage of parentheses around stabby lambda arguments.'
917
- StyleGuide: '#stabby-lambda-with-args'
918
- Enabled: true
919
-
920
- Style/StringLiterals:
921
- Description: 'Checks if uses of quotes match the configured preference.'
922
- StyleGuide: '#consistent-string-literals'
923
- Enabled: true
924
-
925
- Style/StringLiteralsInInterpolation:
926
- Description: >-
927
- Checks if uses of quotes inside expressions in interpolated
928
- strings match the configured preference.
929
- Enabled: true
930
-
931
- Style/StructInheritance:
932
- Description: 'Checks for inheritance from Struct.new.'
933
- StyleGuide: '#no-extend-struct-new'
934
- Enabled: true
935
-
936
- Style/SymbolArray:
937
- Description: 'Use %i or %I for arrays of symbols.'
938
- StyleGuide: '#percent-i'
939
- Enabled: true
940
-
941
- Style/SymbolLiteral:
942
- Description: 'Use plain symbols instead of string symbols when possible.'
943
- Enabled: true
944
-
945
- Style/SymbolProc:
946
- Description: 'Use symbols as procs instead of blocks when possible.'
947
- Enabled: true
948
-
949
- Style/TernaryParentheses:
950
- Description: 'Checks for use of parentheses around ternary conditions.'
951
- Enabled: true
952
-
953
- Style/TrailingCommaInArguments:
954
- Description: 'Checks for trailing comma in argument lists.'
955
- StyleGuide: '#no-trailing-params-comma'
956
- Enabled: true
957
-
958
- Style/TrailingCommaInLiteral:
959
- Description: 'Checks for trailing comma in array and hash literals.'
960
- StyleGuide: '#no-trailing-array-commas'
961
- Enabled: true
962
-
963
- Style/TrivialAccessors:
964
- Description: 'Prefer attr_* methods to trivial readers/writers.'
965
- StyleGuide: '#attr_family'
966
- Enabled: true
967
-
968
- Style/UnlessElse:
969
- Description: >-
970
- Do not use unless with else. Rewrite these with the positive
971
- case first.
972
- StyleGuide: '#no-else-with-unless'
973
- Enabled: true
974
-
975
- Style/UnneededCapitalW:
976
- Description: 'Checks for %W when interpolation is not needed.'
977
- Enabled: true
978
-
979
- Style/UnneededInterpolation:
980
- Description: 'Checks for strings that are just an interpolated expression.'
981
- Enabled: true
982
-
983
- Style/UnneededPercentQ:
984
- Description: 'Checks for %q/%Q when single quotes or double quotes would do.'
985
- StyleGuide: '#percent-q'
986
- Enabled: true
987
-
988
- Style/TrailingUnderscoreVariable:
989
- Description: >-
990
- Checks for the usage of unneeded trailing underscores at the
991
- end of parallel variable assignment.
992
- AllowNamedUnderscoreVariables: true
993
- Enabled: true
994
-
995
- Style/VariableInterpolation:
996
- Description: >-
997
- Don't interpolate global, instance and class variables
998
- directly in strings.
999
- StyleGuide: '#curlies-interpolate'
1000
- Enabled: true
1001
-
1002
- Style/WhenThen:
1003
- Description: 'Use when x then ... for one-line cases.'
1004
- StyleGuide: '#one-line-cases'
1005
- Enabled: true
1006
-
1007
- Style/WhileUntilDo:
1008
- Description: 'Checks for redundant do after while or until.'
1009
- StyleGuide: '#no-multiline-while-do'
1010
- Enabled: true
1011
-
1012
- Style/WhileUntilModifier:
1013
- Description: >-
1014
- Favor modifier while/until usage when you have a
1015
- single-line body.
1016
- StyleGuide: '#while-as-a-modifier'
1017
- Enabled: true
1018
-
1019
- Style/WordArray:
1020
- Description: 'Use %w or %W for arrays of words.'
1021
- StyleGuide: '#percent-w'
1022
- Enabled: true
1023
-
1024
- Style/YodaCondition:
1025
- Description: 'Do not use literals as the first operand of a comparison.'
1026
- Reference: 'https://en.wikipedia.org/wiki/Yoda_conditions'
1027
- Enabled: true
1028
-
1029
- Style/ZeroLengthPredicate:
1030
- Description: 'Use #empty? when testing for objects of length 0.'
1031
- Enabled: true
1032
-
1033
- #################### Metrics ###############################
1034
-
1035
- Metrics/AbcSize:
1036
- Description: >-
1037
- A calculated magnitude based on number of assignments,
1038
- branches, and conditions.
1039
- Reference: 'http://c2.com/cgi/wiki?AbcMetric'
1040
- Enabled: true
1041
-
1042
- Metrics/BlockNesting:
1043
- Description: 'Avoid excessive block nesting'
1044
- StyleGuide: '#three-is-the-number-thou-shalt-count'
1045
- Enabled: true
1046
-
1047
- Metrics/ClassLength:
1048
- Description: 'Avoid classes longer than 100 lines of code.'
1049
- Enabled: true
1050
-
1051
- Metrics/ModuleLength:
1052
- Description: 'Avoid modules longer than 100 lines of code.'
1053
- Enabled: true
1054
-
1055
- Metrics/CyclomaticComplexity:
1056
- Description: >-
1057
- A complexity metric that is strongly correlated to the number
1058
- of test cases needed to validate a method.
1059
- Enabled: true
1060
-
1061
- Metrics/LineLength:
1062
- Description: 'Limit lines to 80 characters.'
1063
- StyleGuide: '#80-character-limits'
1064
- Enabled: true
1065
-
1066
- Metrics/MethodLength:
1067
- Description: 'Avoid methods longer than 10 lines of code.'
1068
- StyleGuide: '#short-methods'
1069
- Enabled: true
1070
-
1071
- Metrics/BlockLength:
1072
- Description: 'Avoid long blocks with many lines.'
1073
- Enabled: true
1074
-
1075
- Metrics/ParameterLists:
1076
- Description: 'Avoid parameter lists longer than three or four parameters.'
1077
- StyleGuide: '#too-many-params'
1078
- Enabled: true
1079
-
1080
- Metrics/PerceivedComplexity:
1081
- Description: >-
1082
- A complexity metric geared towards measuring complexity for a
1083
- human reader.
1084
- Enabled: true
1085
-
1086
- #################### Lint ##################################
1087
- ### Warnings
1088
-
1089
- Lint/AmbiguousBlockAssociation:
1090
- Description: >-
1091
- Checks for ambiguous block association with method when param passed without
1092
- parentheses.
1093
- StyleGuide: '#syntax'
1094
- Enabled: true
1095
-
1096
- Lint/AmbiguousOperator:
1097
- Description: >-
1098
- Checks for ambiguous operators in the first argument of a
1099
- method invocation without parentheses.
1100
- StyleGuide: '#method-invocation-parens'
1101
- Enabled: true
1102
-
1103
- Lint/AmbiguousRegexpLiteral:
1104
- Description: >-
1105
- Checks for ambiguous regexp literals in the first argument of
1106
- a method invocation without parentheses.
1107
- Enabled: true
1108
-
1109
- Lint/AssignmentInCondition:
1110
- Description: "Don't use assignment in conditions."
1111
- StyleGuide: '#safe-assignment-in-condition'
1112
- Enabled: true
1113
-
1114
- Lint/BlockAlignment:
1115
- Description: 'Align block ends correctly.'
1116
- Enabled: true
1117
-
1118
- Lint/CircularArgumentReference:
1119
- Description: "Default values in optional keyword arguments and optional ordinal arguments should not refer back to the name of the argument."
1120
- Enabled: true
1121
-
1122
- Lint/ConditionPosition:
1123
- Description: >-
1124
- Checks for condition placed in a confusing position relative to
1125
- the keyword.
1126
- StyleGuide: '#same-line-condition'
1127
- Enabled: true
1128
-
1129
- Lint/Debugger:
1130
- Description: 'Check for debugger calls.'
1131
- Enabled: true
1132
-
1133
- Lint/DefEndAlignment:
1134
- Description: 'Align ends corresponding to defs correctly.'
1135
- Enabled: true
1136
-
1137
- Lint/DeprecatedClassMethods:
1138
- Description: 'Check for deprecated class method calls.'
1139
- Enabled: true
1140
-
1141
- Lint/DuplicateCaseCondition:
1142
- Description: 'Do not repeat values in case conditionals.'
1143
- Enabled: true
1144
-
1145
- Lint/DuplicateMethods:
1146
- Description: 'Check for duplicate method definitions.'
1147
- Enabled: true
1148
-
1149
- Lint/DuplicatedKey:
1150
- Description: 'Check for duplicate keys in hash literals.'
1151
- Enabled: true
1152
-
1153
- Lint/EachWithObjectArgument:
1154
- Description: 'Check for immutable argument given to each_with_object.'
1155
- Enabled: true
1156
-
1157
- Lint/ElseLayout:
1158
- Description: 'Check for odd code arrangement in an else block.'
1159
- Enabled: true
1160
-
1161
- Lint/EmptyEnsure:
1162
- Description: 'Checks for empty ensure block.'
1163
- Enabled: true
1164
- AutoCorrect: false
1165
-
1166
- Lint/EmptyExpression:
1167
- Description: 'Checks for empty expressions.'
1168
- Enabled: true
1169
-
1170
- Lint/EmptyInterpolation:
1171
- Description: 'Checks for empty string interpolation.'
1172
- Enabled: true
1173
-
1174
- Lint/EmptyWhen:
1175
- Description: 'Checks for `when` branches with empty bodies.'
1176
- Enabled: true
1177
-
1178
- Lint/EndAlignment:
1179
- Description: 'Align ends correctly.'
1180
- Enabled: true
1181
-
1182
- Lint/EndInMethod:
1183
- Description: 'END blocks should not be placed inside method definitions.'
1184
- Enabled: true
1185
-
1186
- Lint/EnsureReturn:
1187
- Description: 'Do not use return in an ensure block.'
1188
- StyleGuide: '#no-return-ensure'
1189
- Enabled: true
1190
-
1191
- Lint/FloatOutOfRange:
1192
- Description: >-
1193
- Catches floating-point literals too large or small for Ruby to
1194
- represent.
1195
- Enabled: true
1196
-
1197
- Lint/FormatParameterMismatch:
1198
- Description: 'The number of parameters to format/sprint must match the fields.'
1199
- Enabled: true
1200
-
1201
- Lint/HandleExceptions:
1202
- Description: "Don't suppress exception."
1203
- StyleGuide: '#dont-hide-exceptions'
1204
- Enabled: true
1205
-
1206
- Lint/ImplicitStringConcatenation:
1207
- Description: >-
1208
- Checks for adjacent string literals on the same line, which
1209
- could better be represented as a single string literal.
1210
- Enabled: true
1211
-
1212
- Lint/IneffectiveAccessModifier:
1213
- Description: >-
1214
- Checks for attempts to use `private` or `protected` to set
1215
- the visibility of a class method, which does not work.
1216
- Enabled: true
1217
-
1218
- Lint/InheritException:
1219
- Description: 'Avoid inheriting from the `Exception` class.'
1220
- Enabled: true
1221
-
1222
- Lint/LiteralInInterpolation:
1223
- Description: 'Checks for literals used in interpolation.'
1224
- Enabled: true
1225
-
1226
- Lint/Loop:
1227
- Description: >-
1228
- Use Kernel#loop with break rather than begin/end/until or
1229
- begin/end/while for post-loop tests.
1230
- StyleGuide: '#loop-with-break'
1231
- Enabled: true
1232
-
1233
- Lint/MultipleCompare:
1234
- Description: "Use `&&` operator to compare multiple value."
1235
- Enabled: true
1236
-
1237
- Lint/NestedMethodDefinition:
1238
- Description: 'Do not use nested method definitions.'
1239
- StyleGuide: '#no-nested-methods'
1240
- Enabled: true
1241
-
1242
- Lint/NextWithoutAccumulator:
1243
- Description: >-
1244
- Do not omit the accumulator when calling `next`
1245
- in a `reduce`/`inject` block.
1246
- Enabled: true
1247
-
1248
- Lint/NonLocalExitFromIterator:
1249
- Description: 'Do not use return in iterator to cause non-local exit.'
1250
- Enabled: true
1251
-
1252
- Lint/ParenthesesAsGroupedExpression:
1253
- Description: >-
1254
- Checks for method calls with a space before the opening
1255
- parenthesis.
1256
- StyleGuide: '#parens-no-spaces'
1257
- Enabled: true
1258
-
1259
- Lint/PercentStringArray:
1260
- Description: >-
1261
- Checks for unwanted commas and quotes in %w/%W literals.
1262
- Enabled: true
1263
-
1264
- Lint/PercentSymbolArray:
1265
- Description: >-
1266
- Checks for unwanted commas and colons in %i/%I literals.
1267
- Enabled: true
1268
-
1269
- Lint/RandOne:
1270
- Description: >-
1271
- Checks for `rand(1)` calls. Such calls always return `0`
1272
- and most likely a mistake.
1273
- Enabled: true
1274
-
1275
- Lint/RequireParentheses:
1276
- Description: >-
1277
- Use parentheses in the method call to avoid confusion
1278
- about precedence.
1279
- Enabled: true
1280
-
1281
- Lint/RescueException:
1282
- Description: 'Avoid rescuing the Exception class.'
1283
- StyleGuide: '#no-blind-rescues'
1284
- Enabled: true
1285
-
1286
- Lint/RescueType:
1287
- Description: 'Avoid rescuing from non constants that could result in a `TypeError`.'
1288
- Enabled: true
1289
-
1290
- Lint/SafeNavigationChain:
1291
- Description: 'Do not chain ordinary method call after safe navigation operator.'
1292
- Enabled: true
1293
-
1294
- Lint/ScriptPermission:
1295
- Description: 'Grant script file execute permission.'
1296
- Enabled: true
1297
-
1298
- Lint/ShadowedException:
1299
- Description: >-
1300
- Avoid rescuing a higher level exception
1301
- before a lower level exception.
1302
- Enabled: true
1303
-
1304
- Lint/ShadowingOuterLocalVariable:
1305
- Description: >-
1306
- Do not use the same name as outer local variable
1307
- for block arguments or block local variables.
1308
- Enabled: true
1309
-
1310
- Lint/StringConversionInInterpolation:
1311
- Description: 'Checks for Object#to_s usage in string interpolation.'
1312
- StyleGuide: '#no-to-s'
1313
- Enabled: true
1314
-
1315
- Lint/UnderscorePrefixedVariableName:
1316
- Description: 'Do not use prefix `_` for a variable that is used.'
1317
- Enabled: true
1318
-
1319
- Lint/UnifiedInteger:
1320
- Description: 'Use Integer instead of Fixnum or Bignum'
1321
- Enabled: true
1322
-
1323
- Lint/UnneededDisable:
1324
- Description: >-
1325
- Checks for rubocop:disable comments that can be removed.
1326
- Note: this cop is not disabled when disabling all cops.
1327
- It must be explicitly disabled.
1328
- Enabled: true
1329
-
1330
- Lint/UnneededSplatExpansion:
1331
- Description: 'Checks for splat unnecessarily being called on literals'
1332
- Enabled: true
1333
-
1334
- Lint/UnusedBlockArgument:
1335
- Description: 'Checks for unused block arguments.'
1336
- StyleGuide: '#underscore-unused-vars'
1337
- Enabled: true
1338
-
1339
- Lint/UnusedMethodArgument:
1340
- Description: 'Checks for unused method arguments.'
1341
- StyleGuide: '#underscore-unused-vars'
1342
- Enabled: true
1343
-
1344
- Lint/UnreachableCode:
1345
- Description: 'Unreachable code.'
1346
- Enabled: true
1347
-
1348
- Lint/UselessAccessModifier:
1349
- Description: 'Checks for useless access modifiers.'
1350
- Enabled: true
1351
- ContextCreatingMethods: []
1352
- MethodCreatingMethods: []
1353
-
1354
- Lint/UselessAssignment:
1355
- Description: 'Checks for useless assignment to a local variable.'
1356
- StyleGuide: '#underscore-unused-vars'
1357
- Enabled: true
1358
-
1359
- Lint/UselessComparison:
1360
- Description: 'Checks for comparison of something with itself.'
1361
- Enabled: true
1362
-
1363
- Lint/UselessElseWithoutRescue:
1364
- Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
1365
- Enabled: true
1366
-
1367
- Lint/UselessSetterCall:
1368
- Description: 'Checks for useless setter call to a local variable.'
1369
- Enabled: true
1370
-
1371
- Lint/Void:
1372
- Description: 'Possible use of operator/literal/variable in void context.'
1373
- Enabled: true
1374
-
1375
- #################### Performance ###########################
1376
-
1377
- Performance/Caller:
1378
- Description: >-
1379
- Use `caller(n..n)` instead of `caller`.
1380
- Enabled: true
1381
-
1382
- Performance/Casecmp:
1383
- Description: >-
1384
- Use `casecmp` rather than `downcase ==`, `upcase ==`, `== downcase`, or `== upcase`..
1385
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringcasecmp-vs-stringdowncase---code'
1386
- Enabled: true
1387
-
1388
- Performance/CaseWhenSplat:
1389
- Description: >-
1390
- Place `when` conditions that use splat at the end
1391
- of the list of `when` branches.
1392
- Enabled: true
1393
-
1394
- Performance/Count:
1395
- Description: >-
1396
- Use `count` instead of `select...size`, `reject...size`,
1397
- `select...count`, `reject...count`, `select...length`,
1398
- and `reject...length`.
1399
- # This cop has known compatibility issues with `ActiveRecord` and other
1400
- # frameworks. ActiveRecord's `count` ignores the block that is passed to it.
1401
- # For more information, see the documentation in the cop itself.
1402
- # If you understand the known risk, you can disable `SafeMode`.
1403
- SafeMode: true
1404
- Enabled: true
1405
-
1406
- Performance/Detect:
1407
- Description: >-
1408
- Use `detect` instead of `select.first`, `find_all.first`,
1409
- `select.last`, and `find_all.last`.
1410
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code'
1411
- # This cop has known compatibility issues with `ActiveRecord` and other
1412
- # frameworks. `ActiveRecord` does not implement a `detect` method and `find`
1413
- # has its own meaning. Correcting `ActiveRecord` methods with this cop
1414
- # should be considered unsafe.
1415
- SafeMode: true
1416
- Enabled: true
1417
-
1418
- Performance/DoubleStartEndWith:
1419
- Description: >-
1420
- Use `str.{start,end}_with?(x, ..., y, ...)`
1421
- instead of `str.{start,end}_with?(x, ...) || str.{start,end}_with?(y, ...)`.
1422
- Enabled: true
1423
-
1424
- Performance/EndWith:
1425
- Description: 'Use `end_with?` instead of a regex match anchored to the end of a string.'
1426
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end'
1427
- # This will change to a new method call which isn't guaranteed to be on the
1428
- # object. Switching these methods has to be done with knowledge of the types
1429
- # of the variables which rubocop doesn't have.
1430
- AutoCorrect: false
1431
- Enabled: true
1432
-
1433
- Performance/FixedSize:
1434
- Description: 'Do not compute the size of statically sized objects except in constants'
1435
- Enabled: true
1436
-
1437
- Performance/FlatMap:
1438
- Description: >-
1439
- Use `Enumerable#flat_map`
1440
- instead of `Enumerable#map...Array#flatten(1)`
1441
- or `Enumberable#collect..Array#flatten(1)`
1442
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code'
1443
- Enabled: true
1444
- EnabledForFlattenWithoutParams: false
1445
- # If enabled, this cop will warn about usages of
1446
- # `flatten` being called without any parameters.
1447
- # This can be dangerous since `flat_map` will only flatten 1 level, and
1448
- # `flatten` without any parameters can flatten multiple levels.
1449
-
1450
- Performance/HashEachMethods:
1451
- Description: >-
1452
- Use `Hash#each_key` and `Hash#each_value` instead of
1453
- `Hash#keys.each` and `Hash#values.each`.
1454
- StyleGuide: '#hash-each'
1455
- Enabled: true
1456
- AutoCorrect: false
1457
-
1458
- Performance/LstripRstrip:
1459
- Description: 'Use `strip` instead of `lstrip.rstrip`.'
1460
- Enabled: true
1461
-
1462
- Performance/RangeInclude:
1463
- Description: 'Use `Range#cover?` instead of `Range#include?`.'
1464
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#cover-vs-include-code'
1465
- Enabled: true
1466
-
1467
- Performance/RedundantBlockCall:
1468
- Description: 'Use `yield` instead of `block.call`.'
1469
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#proccall-vs-yield-code'
1470
- Enabled: true
1471
-
1472
- Performance/RedundantMatch:
1473
- Description: >-
1474
- Use `=~` instead of `String#match` or `Regexp#match` in a context where the
1475
- returned `MatchData` is not needed.
1476
- Enabled: true
1477
-
1478
- Performance/RedundantMerge:
1479
- Description: 'Use Hash#[]=, rather than Hash#merge! with a single key-value pair.'
1480
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#hashmerge-vs-hash-code'
1481
- Enabled: true
1482
-
1483
- Performance/RedundantSortBy:
1484
- Description: 'Use `sort` instead of `sort_by { |x| x }`.'
1485
- Enabled: true
1486
-
1487
- Performance/RegexpMatch:
1488
- Description: >-
1489
- Use `match?` instead of `Regexp#match`, `String#match`, `Symbol#match`,
1490
- `Regexp#===`, or `=~` when `MatchData` is not used.
1491
- Enabled: true
1492
-
1493
- Performance/ReverseEach:
1494
- Description: 'Use `reverse_each` instead of `reverse.each`.'
1495
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code'
1496
- Enabled: true
1497
-
1498
- Performance/Sample:
1499
- Description: >-
1500
- Use `sample` instead of `shuffle.first`,
1501
- `shuffle.last`, and `shuffle[Integer]`.
1502
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
1503
- Enabled: true
1504
-
1505
- Performance/Size:
1506
- Description: >-
1507
- Use `size` instead of `count` for counting
1508
- the number of elements in `Array` and `Hash`.
1509
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code'
1510
- Enabled: true
1511
-
1512
- Performance/CompareWithBlock:
1513
- Description: 'Use `sort_by(&:foo)` instead of `sort_by { |a, b| a.foo <=> b.foo }`.'
1514
- Enabled: true
1515
-
1516
- Performance/StartWith:
1517
- Description: 'Use `start_with?` instead of a regex match anchored to the beginning of a string.'
1518
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end'
1519
- # This will change to a new method call which isn't guaranteed to be on the
1520
- # object. Switching these methods has to be done with knowledge of the types
1521
- # of the variables which rubocop doesn't have.
1522
- AutoCorrect: false
1523
- Enabled: true
1524
-
1525
- Performance/StringReplacement:
1526
- Description: >-
1527
- Use `tr` instead of `gsub` when you are replacing the same
1528
- number of characters. Use `delete` instead of `gsub` when
1529
- you are deleting characters.
1530
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code'
1531
- Enabled: true
1532
-
1533
- Performance/TimesMap:
1534
- Description: 'Checks for .times.map calls.'
1535
- Enabled: true
1536
-
1537
- #################### Rails #################################
1538
-
1539
- Rails/ActionFilter:
1540
- Description: 'Enforces consistent use of action filter methods.'
1541
- Enabled: true
1542
-
1543
- Rails/ApplicationJob:
1544
- Description: 'Check that jobs subclass ApplicationJob.'
1545
- Enabled: true
1546
-
1547
- Rails/ApplicationRecord:
1548
- Description: 'Check that models subclass ApplicationRecord.'
1549
- Enabled: true
1550
-
1551
- Rails/ActiveSupportAliases:
1552
- Description: >-
1553
- Avoid ActiveSupport aliases of standard ruby methods:
1554
- `String#starts_with?`, `String#ends_with?`,
1555
- `Array#append`, `Array#prepend`.
1556
- Enabled: true
1557
-
1558
- Rails/Blank:
1559
- Description: 'Enforce using `blank?` and `present?`.'
1560
- Enabled: true
1561
- # Convert checks for `nil` or `empty?` to `blank?`
1562
- NilOrEmpty: true
1563
- # Convert usages of not `present?` to `blank?`
1564
- NotPresent: true
1565
- # Convert usages of `unless` `present?` to `if` `blank?`
1566
- UnlessPresent: true
1567
-
1568
- Rails/Date:
1569
- Description: >-
1570
- Checks the correct usage of date aware methods,
1571
- such as Date.today, Date.current etc.
1572
- Enabled: true
1573
-
1574
- Rails/Delegate:
1575
- Description: 'Prefer delegate method for delegations.'
1576
- Enabled: true
1577
-
1578
- Rails/DelegateAllowBlank:
1579
- Description: 'Do not use allow_blank as an option to delegate.'
1580
- Enabled: true
1581
-
1582
- Rails/DynamicFindBy:
1583
- Description: 'Use `find_by` instead of dynamic `find_by_*`.'
1584
- StyleGuide: 'https://github.com/bbatsov/rails-style-guide#find_by'
1585
- Enabled: true
1586
-
1587
- Rails/EnumUniqueness:
1588
- Description: 'Avoid duplicate integers in hash-syntax `enum` declaration.'
1589
- Enabled: true
1590
-
1591
- Rails/Exit:
1592
- Description: >-
1593
- Favor `fail`, `break`, `return`, etc. over `exit` in
1594
- application or library code outside of Rake files to avoid
1595
- exits during unit testing or running in production.
1596
- Enabled: true
1597
-
1598
- Rails/FilePath:
1599
- Description: 'Use `Rails.root.join` for file path joining.'
1600
- Enabled: true
1601
-
1602
- Rails/FindBy:
1603
- Description: 'Prefer find_by over where.first.'
1604
- StyleGuide: 'https://github.com/bbatsov/rails-style-guide#find_by'
1605
- Enabled: true
1606
-
1607
- Rails/FindEach:
1608
- Description: 'Prefer all.find_each over all.find.'
1609
- StyleGuide: 'https://github.com/bbatsov/rails-style-guide#find-each'
1610
- Enabled: true
1611
-
1612
- Rails/HasAndBelongsToMany:
1613
- Description: 'Prefer has_many :through to has_and_belongs_to_many.'
1614
- StyleGuide: 'https://github.com/bbatsov/rails-style-guide#has-many-through'
1615
- Enabled: true
1616
-
1617
- Rails/HttpPositionalArguments:
1618
- Description: 'Use keyword arguments instead of positional arguments in http method calls.'
1619
- Enabled: true
1620
- Include:
1621
- - 'spec/**/*'
1622
- - 'test/**/*'
1623
-
1624
- Rails/NotNullColumn:
1625
- Description: 'Do not add a NOT NULL column without a default value'
1626
- Enabled: true
1627
-
1628
- Rails/Output:
1629
- Description: 'Checks for calls to puts, print, etc.'
1630
- Enabled: true
1631
-
1632
- Rails/OutputSafety:
1633
- Description: 'The use of `html_safe` or `raw` may be a security risk.'
1634
- Enabled: true
1635
-
1636
- Rails/PluralizationGrammar:
1637
- Description: 'Checks for incorrect grammar when using methods like `3.day.ago`.'
1638
- Enabled: true
1639
-
1640
- Rails/Present:
1641
- Description: 'Enforce using `blank?` and `present?`.'
1642
- Enabled: true
1643
- NotNilAndNotEmpty: true
1644
- # Convert checks for not `nil` and not `empty?` to `present?`
1645
- NotBlank: true
1646
- # Convert usages of not `blank?` to `present?`
1647
- UnlessBlank: true
1648
- # Convert usages of `unless` `blank?` to `if` `present?`
1649
-
1650
- Rails/ReadWriteAttribute:
1651
- Description: >-
1652
- Checks for read_attribute(:attr) and
1653
- write_attribute(:attr, val).
1654
- StyleGuide: 'https://github.com/bbatsov/rails-style-guide#read-attribute'
1655
- Enabled: true
1656
-
1657
- Rails/RelativeDateConstant:
1658
- Description: 'Do not assign relative date to constants.'
1659
- Enabled: true
1660
-
1661
- Rails/RequestReferer:
1662
- Description: 'Use consistent syntax for request.referer.'
1663
- Enabled: true
1664
-
1665
- Rails/ReversibleMigration:
1666
- Description: 'Checks whether the change method of the migration file is reversible.'
1667
- StyleGuide: 'https://github.com/bbatsov/rails-style-guide#reversible-migration'
1668
- Reference: 'http://api.rubyonrails.org/classes/ActiveRecord/Migration/CommandRecorder.html'
1669
- Enabled: true
1670
-
1671
- Rails/SafeNavigation:
1672
- Description: "Use Ruby's safe navigation operator (`&.`) instead of `try!`"
1673
- Enabled: true
1674
-
1675
- Rails/ScopeArgs:
1676
- Description: 'Checks the arguments of ActiveRecord scopes.'
1677
- Enabled: true
1678
-
1679
- Rails/TimeZone:
1680
- Description: 'Checks the correct usage of time zone aware methods.'
1681
- StyleGuide: 'https://github.com/bbatsov/rails-style-guide#time'
1682
- Reference: 'http://danilenko.org/2012/7/6/rails_timezones'
1683
- Enabled: true
1684
-
1685
- Rails/UniqBeforePluck:
1686
- Description: 'Prefer the use of uniq or distinct before pluck.'
1687
- Enabled: true
1688
-
1689
- Rails/SkipsModelValidations:
1690
- Description: >-
1691
- Use methods that skips model validations with caution.
1692
- See reference for more information.
1693
- Reference: 'http://guides.rubyonrails.org/active_record_validations.html#skipping-validations'
1694
- Enabled: true
1695
-
1696
- Rails/Validation:
1697
- Description: 'Use validates :attribute, hash of validations.'
1698
- Enabled: true
1699
-
1700
- #################### Security ##############################
1701
-
1702
- Security/Eval:
1703
- Description: 'The use of eval represents a serious security risk.'
1704
- Enabled: true
1705
-
1706
- Security/JSONLoad:
1707
- Description: >-
1708
- Prefer usage of `JSON.parse` over `JSON.load` due to potential
1709
- security issues. See reference for more information.
1710
- Reference: 'http://ruby-doc.org/stdlib-2.3.0/libdoc/json/rdoc/JSON.html#method-i-load'
1711
- Enabled: true
1712
- # Autocorrect here will change to a method that may cause crashes depending
1713
- # on the value of the argument.
1714
- AutoCorrect: false
1715
-
1716
- Security/MarshalLoad:
1717
- Description: >-
1718
- Avoid using of `Marshal.load` or `Marshal.restore` due to potential
1719
- security issues. See reference for more information.
1720
- Reference: 'http://ruby-doc.org/core-2.3.3/Marshal.html#module-Marshal-label-Security+considerations'
1721
- Enabled: true
1722
-
1723
- Security/YAMLLoad:
1724
- Description: >-
1725
- Prefer usage of `YAML.safe_load` over `YAML.load` due to potential
1726
- security issues. See reference for more information.
1727
- Reference: 'https://ruby-doc.org/stdlib-2.3.3/libdoc/yaml/rdoc/YAML.html#module-YAML-label-Security'
1728
- Enabled: true
1729
-
1730
- #################### Bundler ###############################
1731
-
1732
- Bundler/DuplicatedGem:
1733
- Description: 'Checks for duplicate gem entries in Gemfile.'
1734
- Enabled: true
1735
- Include:
1736
- - '**/Gemfile'
1737
- - '**/gems.rb'
1738
-
1739
- Bundler/OrderedGems:
1740
- Description: >-
1741
- Gems within groups in the Gemfile should be alphabetically sorted.
1742
- Enabled: true
1743
- Include:
1744
- - '**/Gemfile'
1745
- - '**/gems.rb'