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