gatemedia_rubocop 0.3.0 → 0.4.0

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