lcgstyle 0.0.1

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,1352 @@
1
+ # These are all the cops that are enabled in the default configuration.
2
+
3
+ Style/AccessModifierIndentation:
4
+ Description: Check indentation of private/protected visibility modifiers.
5
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-public-private-protected'
6
+ Enabled: true
7
+
8
+ Style/AccessorMethodName:
9
+ Description: Check the naming of accessor methods for get_/set_.
10
+ Enabled: true
11
+
12
+ Style/Alias:
13
+ Description: 'Use alias instead of alias_method.'
14
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#alias-method'
15
+ Enabled: true
16
+
17
+ Style/AlignArray:
18
+ Description: >-
19
+ Align the elements of an array literal if they span more than
20
+ one line.
21
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#align-multiline-arrays'
22
+ Enabled: true
23
+
24
+ Style/AlignHash:
25
+ Description: >-
26
+ Align the elements of a hash literal if they span more than
27
+ one line.
28
+ Enabled: true
29
+
30
+ Style/AlignParameters:
31
+ Description: >-
32
+ Align the parameters of a method call if they span more
33
+ than one line.
34
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent'
35
+ Enabled: true
36
+
37
+ Style/AndOr:
38
+ Description: 'Use &&/|| instead of and/or.'
39
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-and-or-or'
40
+ Enabled: true
41
+
42
+ Style/ArrayJoin:
43
+ Description: 'Use Array#join instead of Array#*.'
44
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#array-join'
45
+ Enabled: true
46
+
47
+ Style/AsciiComments:
48
+ Description: 'Use only ascii symbols in comments.'
49
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments'
50
+ Enabled: true
51
+
52
+ Style/AsciiIdentifiers:
53
+ Description: 'Use only ascii symbols in identifiers.'
54
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers'
55
+ Enabled: true
56
+
57
+ Style/Attr:
58
+ Description: 'Checks for uses of Module#attr.'
59
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr'
60
+ Enabled: true
61
+
62
+ Style/BeginBlock:
63
+ Description: 'Avoid the use of BEGIN blocks.'
64
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-BEGIN-blocks'
65
+ Enabled: true
66
+
67
+ Style/BarePercentLiterals:
68
+ Description: 'Checks if usage of %() or %Q() matches configuration.'
69
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-q-shorthand'
70
+ Enabled: true
71
+
72
+ Style/BlockComments:
73
+ Description: 'Do not use block comments.'
74
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-block-comments'
75
+ Enabled: true
76
+
77
+ Style/BlockEndNewline:
78
+ Description: 'Put end statement of multiline block on its own line.'
79
+ Enabled: true
80
+
81
+ Style/BlockDelimiters:
82
+ Description: >-
83
+ Avoid using {...} for multi-line blocks (multiline chaining is
84
+ always ugly).
85
+ Prefer {...} over do...end for single-line blocks.
86
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
87
+ Enabled: true
88
+
89
+ Style/BracesAroundHashParameters:
90
+ Description: 'Enforce braces style around hash parameters.'
91
+ Enabled: true
92
+
93
+ Style/CaseEquality:
94
+ Description: 'Avoid explicit use of the case equality operator(===).'
95
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality'
96
+ Enabled: true
97
+
98
+ Style/CaseIndentation:
99
+ Description: 'Indentation of when in a case/when/[else/]end.'
100
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-when-to-case'
101
+ Enabled: true
102
+
103
+ Style/CharacterLiteral:
104
+ Description: 'Checks for uses of character literals.'
105
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-character-literals'
106
+ Enabled: true
107
+
108
+ Style/ClassAndModuleCamelCase:
109
+ Description: 'Use CamelCase for classes and modules.'
110
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#camelcase-classes'
111
+ Enabled: true
112
+
113
+ Style/ClassAndModuleChildren:
114
+ Description: 'Checks style of children classes and modules.'
115
+ Enabled: true
116
+
117
+ Style/ClassCheck:
118
+ Description: 'Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.'
119
+ Enabled: true
120
+
121
+ Style/ClassMethods:
122
+ Description: 'Use self when defining module/class methods.'
123
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#def-self-class-methods'
124
+ Enabled: true
125
+
126
+ Style/ClassVars:
127
+ Description: 'Avoid the use of class variables.'
128
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars'
129
+ Enabled: true
130
+
131
+ Style/ClosingParenthesisIndentation:
132
+ Description: 'Checks the indentation of hanging closing parentheses.'
133
+ Enabled: true
134
+
135
+ Style/ColonMethodCall:
136
+ Description: 'Do not use :: for method call.'
137
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#double-colons'
138
+ Enabled: true
139
+
140
+ Style/CommandLiteral:
141
+ Description: 'Use `` or %x around command literals.'
142
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-x'
143
+ Enabled: true
144
+
145
+ Style/CommentAnnotation:
146
+ Description: >-
147
+ Checks formatting of special comments
148
+ (TODO, FIXME, OPTIMIZE, HACK, REVIEW).
149
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#annotate-keywords'
150
+ Enabled: true
151
+
152
+ Style/CommentIndentation:
153
+ Description: 'Indentation of comments.'
154
+ Enabled: true
155
+
156
+ Style/ConditionalAssignment:
157
+ Description: >-
158
+ Use the return value of `if` and `case` statements for
159
+ assignment to a variable and variable comparison instead
160
+ of assigning that variable inside of each branch.
161
+ Enabled: true
162
+
163
+ Style/ConstantName:
164
+ Description: 'Constants should use SCREAMING_SNAKE_CASE.'
165
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#screaming-snake-case'
166
+ Enabled: true
167
+
168
+ Style/DefWithParentheses:
169
+ Description: 'Use def with parentheses when there are arguments.'
170
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens'
171
+ Enabled: true
172
+
173
+ Style/DeprecatedHashMethods:
174
+ Description: 'Checks for use of deprecated Hash methods.'
175
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-key'
176
+ Enabled: true
177
+
178
+ Style/Documentation:
179
+ Description: 'Document classes and non-namespace modules.'
180
+ Enabled: true
181
+ Exclude:
182
+ - 'spec/**/*'
183
+ - 'test/**/*'
184
+
185
+ Style/DotPosition:
186
+ Description: 'Checks the position of the dot in multi-line method calls.'
187
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
188
+ Enabled: true
189
+
190
+ Style/DoubleNegation:
191
+ Description: 'Checks for uses of double negation (!!).'
192
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-bang-bang'
193
+ Enabled: true
194
+
195
+ Style/EachWithObject:
196
+ Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
197
+ Enabled: true
198
+
199
+ Style/ElseAlignment:
200
+ Description: 'Align elses and elsifs correctly.'
201
+ Enabled: true
202
+
203
+ Style/EmptyElse:
204
+ Description: 'Avoid empty else-clauses.'
205
+ Enabled: true
206
+
207
+ Style/EmptyLineBetweenDefs:
208
+ Description: 'Use empty lines between defs.'
209
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#empty-lines-between-methods'
210
+ Enabled: true
211
+
212
+ Style/EmptyLines:
213
+ Description: "Don't use several empty lines in a row."
214
+ Enabled: true
215
+
216
+ Style/EmptyLinesAroundAccessModifier:
217
+ Description: "Keep blank lines around access modifiers."
218
+ Enabled: true
219
+
220
+ Style/EmptyLinesAroundBlockBody:
221
+ Description: "Keeps track of empty lines around block bodies."
222
+ Enabled: true
223
+
224
+ Style/EmptyLinesAroundClassBody:
225
+ Description: "Keeps track of empty lines around class bodies."
226
+ Enabled: true
227
+
228
+ Style/EmptyLinesAroundModuleBody:
229
+ Description: "Keeps track of empty lines around module bodies."
230
+ Enabled: true
231
+
232
+ Style/EmptyLinesAroundMethodBody:
233
+ Description: "Keeps track of empty lines around method bodies."
234
+ Enabled: true
235
+
236
+ Style/EmptyLiteral:
237
+ Description: 'Prefer literals to Array.new/Hash.new/String.new.'
238
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#literal-array-hash'
239
+ Enabled: true
240
+
241
+ Style/EndBlock:
242
+ Description: 'Avoid the use of END blocks.'
243
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-END-blocks'
244
+ Enabled: true
245
+
246
+ Style/EndOfLine:
247
+ Description: 'Use Unix-style line endings.'
248
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#crlf'
249
+ Enabled: true
250
+
251
+ Style/EvenOdd:
252
+ Description: 'Favor the use of Fixnum#even? && Fixnum#odd?'
253
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
254
+ Enabled: true
255
+
256
+ Style/ExtraSpacing:
257
+ Description: 'Do not use unnecessary spacing.'
258
+ Enabled: true
259
+
260
+ Style/FileName:
261
+ Description: 'Use snake_case for source file names.'
262
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
263
+ Enabled: true
264
+
265
+ Style/FrozenStringLiteralComment:
266
+ Description: >-
267
+ Add the frozen_string_literal comment to the top of files
268
+ to help transition from Ruby 2.3.0 to Ruby 3.0.
269
+ Enabled: true
270
+
271
+ Style/InitialIndentation:
272
+ Description: >-
273
+ Checks the indentation of the first non-blank non-comment line in a file.
274
+ Enabled: true
275
+
276
+ Style/FirstParameterIndentation:
277
+ Description: 'Checks the indentation of the first parameter in a method call.'
278
+ Enabled: true
279
+
280
+ Style/FlipFlop:
281
+ Description: 'Checks for flip flops'
282
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-flip-flops'
283
+ Enabled: true
284
+
285
+ Style/For:
286
+ Description: 'Checks use of for or each in multiline loops.'
287
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-for-loops'
288
+ Enabled: true
289
+
290
+ Style/FormatString:
291
+ Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
292
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#sprintf'
293
+ Enabled: true
294
+
295
+ Style/GlobalVars:
296
+ Description: 'Do not introduce global variables.'
297
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#instance-vars'
298
+ Reference: 'http://www.zenspider.com/Languages/Ruby/QuickRef.html'
299
+ Enabled: true
300
+
301
+ Style/GuardClause:
302
+ Description: 'Check for conditionals that can be replaced with guard clauses'
303
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
304
+ Enabled: true
305
+
306
+ Style/HashSyntax:
307
+ Description: >-
308
+ Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
309
+ { :a => 1, :b => 2 }.
310
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-literals'
311
+ Enabled: true
312
+
313
+ Style/IfInsideElse:
314
+ Description: 'Finds if nodes inside else, which can be converted to elsif.'
315
+ Enabled: true
316
+
317
+ Style/IfUnlessModifier:
318
+ Description: >-
319
+ Favor modifier if/unless usage when you have a
320
+ single-line body.
321
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
322
+ Enabled: true
323
+
324
+ Style/IfUnlessModifierOfIfUnless:
325
+ Description: >-
326
+ Avoid modifier if/unless usage on conditionals.
327
+ Enabled: true
328
+
329
+ Style/IfWithSemicolon:
330
+ Description: 'Do not use if x; .... Use the ternary operator instead.'
331
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs'
332
+ Enabled: true
333
+
334
+ Style/IndentationConsistency:
335
+ Description: 'Keep indentation straight.'
336
+ Enabled: true
337
+
338
+ Style/IndentationWidth:
339
+ Description: 'Use 2 spaces for indentation.'
340
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation'
341
+ Enabled: true
342
+
343
+ Style/IdenticalConditionalBranches:
344
+ Description: >-
345
+ Checks that conditional statements do not have an identical
346
+ line at the end of each branch, which can validly be moved
347
+ out of the conditional.
348
+ Enabled: true
349
+
350
+ Style/IndentArray:
351
+ Description: >-
352
+ Checks the indentation of the first element in an array
353
+ literal.
354
+ Enabled: true
355
+
356
+ Style/IndentAssignment:
357
+ Description: >-
358
+ Checks the indentation of the first line of the
359
+ right-hand-side of a multi-line assignment.
360
+ Enabled: true
361
+
362
+ Style/IndentHash:
363
+ Description: 'Checks the indentation of the first key in a hash literal.'
364
+ Enabled: true
365
+
366
+ Style/InfiniteLoop:
367
+ Description: 'Use Kernel#loop for infinite loops.'
368
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#infinite-loop'
369
+ Enabled: true
370
+
371
+ Style/Lambda:
372
+ Description: 'Use the new lambda literal syntax for single-line blocks.'
373
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#lambda-multi-line'
374
+ Enabled: true
375
+
376
+ Style/LambdaCall:
377
+ Description: 'Use lambda.call(...) instead of lambda.(...).'
378
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc-call'
379
+ Enabled: true
380
+
381
+ Style/LeadingCommentSpace:
382
+ Description: 'Comments should start with a space.'
383
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-space'
384
+ Enabled: true
385
+
386
+ Style/LineEndConcatenation:
387
+ Description: >-
388
+ Use \ instead of + or << to concatenate two string literals at
389
+ line end.
390
+ Enabled: true
391
+
392
+ Style/MethodCallParentheses:
393
+ Description: 'Do not use parentheses for method calls with no arguments.'
394
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-args-no-parens'
395
+ Enabled: true
396
+
397
+ Style/MethodDefParentheses:
398
+ Description: >-
399
+ Checks if the method definitions have or don't have
400
+ parentheses.
401
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens'
402
+ Enabled: true
403
+
404
+ Style/MethodName:
405
+ Description: 'Use the configured style when naming methods.'
406
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars'
407
+ Enabled: true
408
+
409
+ Style/ModuleFunction:
410
+ Description: 'Checks for usage of `extend self` in modules.'
411
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#module-function'
412
+ Enabled: true
413
+
414
+ Style/MultilineBlockChain:
415
+ Description: 'Avoid multi-line chains of blocks.'
416
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
417
+ Enabled: true
418
+
419
+ Style/MultilineBlockLayout:
420
+ Description: 'Ensures newlines after multiline block do statements.'
421
+ Enabled: true
422
+
423
+ Style/MultilineIfThen:
424
+ Description: 'Do not use then for multi-line if/unless.'
425
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-then'
426
+ Enabled: true
427
+
428
+ Style/MultilineMethodCallIndentation:
429
+ Description: >-
430
+ Checks indentation of method calls with the dot operator
431
+ that span more than one line.
432
+ Enabled: true
433
+
434
+ Style/MultilineOperationIndentation:
435
+ Description: >-
436
+ Checks indentation of binary operations that span more than
437
+ one line.
438
+ Enabled: true
439
+
440
+ Style/MultilineTernaryOperator:
441
+ Description: >-
442
+ Avoid multi-line ?: (the ternary operator);
443
+ use if/unless instead.
444
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-multiline-ternary'
445
+ Enabled: true
446
+
447
+ Style/MutableConstant:
448
+ Description: 'Do not assign mutable objects to constants.'
449
+ Enabled: true
450
+
451
+ Style/NegatedIf:
452
+ Description: >-
453
+ Favor unless over if for negative conditions
454
+ (or control flow or).
455
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives'
456
+ Enabled: true
457
+
458
+ Style/NegatedWhile:
459
+ Description: 'Favor until over while for negative conditions.'
460
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#until-for-negatives'
461
+ Enabled: true
462
+
463
+ Style/NestedModifier:
464
+ Description: 'Avoid using nested modifiers.'
465
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-modifiers'
466
+ Enabled: true
467
+
468
+ Style/NestedParenthesizedCalls:
469
+ Description: >-
470
+ Parenthesize method calls which are nested inside the
471
+ argument list of another parenthesized method call.
472
+ Enabled: true
473
+
474
+ Style/NestedTernaryOperator:
475
+ Description: 'Use one expression per branch in a ternary operator.'
476
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-ternary'
477
+ Enabled: true
478
+
479
+ Style/Next:
480
+ Description: 'Use `next` to skip iteration instead of a condition at the end.'
481
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
482
+ Enabled: true
483
+
484
+ Style/NilComparison:
485
+ Description: 'Prefer x.nil? to x == nil.'
486
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
487
+ Enabled: true
488
+
489
+ Style/NonNilCheck:
490
+ Description: 'Checks for redundant nil checks.'
491
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-non-nil-checks'
492
+ Enabled: true
493
+
494
+ Style/Not:
495
+ Description: 'Use ! instead of not.'
496
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bang-not-not'
497
+ Enabled: true
498
+
499
+ Style/NumericLiterals:
500
+ Description: >-
501
+ Add underscores to large numeric literals to improve their
502
+ readability.
503
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics'
504
+ Enabled: true
505
+
506
+ Style/OneLineConditional:
507
+ Description: >-
508
+ Favor the ternary operator(?:) over
509
+ if/then/else/end constructs.
510
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator'
511
+ Enabled: true
512
+
513
+ Style/OpMethod:
514
+ Description: 'When defining binary operators, name the argument other.'
515
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
516
+ Enabled: true
517
+
518
+ Style/OptionalArguments:
519
+ Description: >-
520
+ Checks for optional arguments that do not appear at the end
521
+ of the argument list
522
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#optional-arguments'
523
+ Enabled: true
524
+
525
+ Style/ParallelAssignment:
526
+ Description: >-
527
+ Check for simple usages of parallel assignment.
528
+ It will only warn when the number of variables
529
+ matches on both sides of the assignment.
530
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parallel-assignment'
531
+ Enabled: true
532
+
533
+ Style/ParenthesesAroundCondition:
534
+ Description: >-
535
+ Don't use parentheses around the condition of an
536
+ if/unless/while.
537
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-parens-if'
538
+ Enabled: true
539
+
540
+ Style/PercentLiteralDelimiters:
541
+ Description: 'Use `%`-literal delimiters consistently'
542
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-literal-braces'
543
+ Enabled: true
544
+
545
+ Style/PercentQLiterals:
546
+ Description: 'Checks if uses of %Q/%q match the configured preference.'
547
+ Enabled: true
548
+
549
+ Style/PerlBackrefs:
550
+ Description: 'Avoid Perl-style regex back references.'
551
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
552
+ Enabled: true
553
+
554
+ Style/PredicateName:
555
+ Description: 'Check the names of predicate methods.'
556
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
557
+ Enabled: true
558
+
559
+ Style/Proc:
560
+ Description: 'Use proc instead of Proc.new.'
561
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc'
562
+ Enabled: true
563
+
564
+ Style/RaiseArgs:
565
+ Description: 'Checks the arguments passed to raise/fail.'
566
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#exception-class-messages'
567
+ Enabled: true
568
+
569
+ Style/RedundantBegin:
570
+ Description: "Don't use begin blocks when they are not needed."
571
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#begin-implicit'
572
+ Enabled: true
573
+
574
+ Style/RedundantException:
575
+ Description: "Checks for an obsolete RuntimeException argument in raise/fail."
576
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-runtimeerror'
577
+ Enabled: true
578
+
579
+ Style/RedundantFreeze:
580
+ Description: "Checks usages of Object#freeze on immutable objects."
581
+ Enabled: true
582
+
583
+ Style/RedundantParentheses:
584
+ Description: "Checks for parentheses that seem not to serve any purpose."
585
+ Enabled: true
586
+
587
+ Style/RedundantReturn:
588
+ Description: "Don't use return where it's not required."
589
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-return'
590
+ Enabled: true
591
+
592
+ Style/RedundantSelf:
593
+ Description: "Don't use self where it's not needed."
594
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-self-unless-required'
595
+ Enabled: true
596
+
597
+ Style/RegexpLiteral:
598
+ Description: 'Use / or %r around regular expressions.'
599
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r'
600
+ Enabled: true
601
+
602
+ Style/RescueEnsureAlignment:
603
+ Description: 'Align rescues and ensures correctly.'
604
+ Enabled: true
605
+
606
+ Style/RescueModifier:
607
+ Description: 'Avoid using rescue in its modifier form.'
608
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-rescue-modifiers'
609
+ Enabled: true
610
+
611
+ Style/SelfAssignment:
612
+ Description: >-
613
+ Checks for places where self-assignment shorthand should have
614
+ been used.
615
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment'
616
+ Enabled: true
617
+
618
+ Style/Semicolon:
619
+ Description: "Don't use semicolons to terminate expressions."
620
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon'
621
+ Enabled: true
622
+
623
+ Style/SignalException:
624
+ Description: 'Checks for proper usage of fail and raise.'
625
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#prefer-raise-over-fail'
626
+ Enabled: true
627
+
628
+ Style/SingleLineBlockParams:
629
+ Description: 'Enforces the names of some block params.'
630
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#reduce-blocks'
631
+ Enabled: true
632
+
633
+ Style/SingleLineMethods:
634
+ Description: 'Avoid single-line methods.'
635
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-single-line-methods'
636
+ Enabled: true
637
+
638
+ Style/SpaceBeforeFirstArg:
639
+ Description: >-
640
+ Checks that exactly one space is used between a method name
641
+ and the first argument for method calls without parentheses.
642
+ Enabled: true
643
+
644
+ Style/SpaceAfterColon:
645
+ Description: 'Use spaces after colons.'
646
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
647
+ Enabled: true
648
+
649
+ Style/SpaceAfterComma:
650
+ Description: 'Use spaces after commas.'
651
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
652
+ Enabled: true
653
+
654
+ Style/SpaceAfterMethodName:
655
+ Description: >-
656
+ Do not put a space between a method name and the opening
657
+ parenthesis in a method definition.
658
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
659
+ Enabled: true
660
+
661
+ Style/SpaceAfterNot:
662
+ Description: Tracks redundant space after the ! operator.
663
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-space-bang'
664
+ Enabled: true
665
+
666
+ Style/SpaceAfterSemicolon:
667
+ Description: 'Use spaces after semicolons.'
668
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
669
+ Enabled: true
670
+
671
+ Style/SpaceBeforeBlockBraces:
672
+ Description: >-
673
+ Checks that the left block brace has or doesn't have space
674
+ before it.
675
+ Enabled: true
676
+
677
+ Style/SpaceBeforeComma:
678
+ Description: 'No spaces before commas.'
679
+ Enabled: true
680
+
681
+ Style/SpaceBeforeComment:
682
+ Description: >-
683
+ Checks for missing space between code and a comment on the
684
+ same line.
685
+ Enabled: true
686
+
687
+ Style/SpaceBeforeSemicolon:
688
+ Description: 'No spaces before semicolons.'
689
+ Enabled: true
690
+
691
+ Style/SpaceInsideBlockBraces:
692
+ Description: >-
693
+ Checks that block braces have or don't have surrounding space.
694
+ For blocks taking parameters, checks that the left brace has
695
+ or doesn't have trailing space.
696
+ Enabled: true
697
+
698
+ Style/SpaceAroundBlockParameters:
699
+ Description: 'Checks the spacing inside and after block parameters pipes.'
700
+ Enabled: true
701
+
702
+ Style/SpaceAroundEqualsInParameterDefault:
703
+ Description: >-
704
+ Checks that the equals signs in parameter default assignments
705
+ have or don't have surrounding space depending on
706
+ configuration.
707
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-around-equals'
708
+ Enabled: true
709
+
710
+ Style/SpaceAroundKeyword:
711
+ Description: 'Use a space around keywords if appropriate.'
712
+ Enabled: true
713
+
714
+ Style/SpaceAroundOperators:
715
+ Description: 'Use a single space around operators.'
716
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
717
+ Enabled: true
718
+
719
+ Style/SpaceInsideBrackets:
720
+ Description: 'No spaces after [ or before ].'
721
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
722
+ Enabled: true
723
+
724
+ Style/SpaceInsideHashLiteralBraces:
725
+ Description: "Use spaces inside hash literal braces - or don't."
726
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
727
+ Enabled: true
728
+
729
+ Style/SpaceInsideParens:
730
+ Description: 'No spaces after ( or before ).'
731
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
732
+ Enabled: true
733
+
734
+ Style/SpaceInsideRangeLiteral:
735
+ Description: 'No spaces inside range literals.'
736
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-space-inside-range-literals'
737
+ Enabled: true
738
+
739
+ Style/SpaceInsideStringInterpolation:
740
+ Description: 'Checks for padding/surrounding spaces inside string interpolation.'
741
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#string-interpolation'
742
+ Enabled: true
743
+
744
+ Style/SpecialGlobalVars:
745
+ Description: 'Avoid Perl-style global variables.'
746
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms'
747
+ Enabled: true
748
+
749
+ Style/StabbyLambdaParentheses:
750
+ Description: 'Check for the usage of parentheses around stabby lambda arguments.'
751
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#stabby-lambda-with-args'
752
+ Enabled: true
753
+
754
+ Style/StringLiterals:
755
+ Description: 'Checks if uses of quotes match the configured preference.'
756
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals'
757
+ Enabled: true
758
+
759
+ Style/StringLiteralsInInterpolation:
760
+ Description: >-
761
+ Checks if uses of quotes inside expressions in interpolated
762
+ strings match the configured preference.
763
+ Enabled: true
764
+
765
+ Style/StructInheritance:
766
+ Description: 'Checks for inheritance from Struct.new.'
767
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-extend-struct-new'
768
+ Enabled: true
769
+
770
+ Style/SymbolLiteral:
771
+ Description: 'Use plain symbols instead of string symbols when possible.'
772
+ Enabled: true
773
+
774
+ Style/SymbolProc:
775
+ Description: 'Use symbols as procs instead of blocks when possible.'
776
+ Enabled: true
777
+
778
+ Style/Tab:
779
+ Description: 'No hard tabs.'
780
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation'
781
+ Enabled: true
782
+
783
+ Style/TrailingBlankLines:
784
+ Description: 'Checks trailing blank lines and final newline.'
785
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#newline-eof'
786
+ Enabled: true
787
+
788
+ Style/TrailingCommaInArguments:
789
+ Description: 'Checks for trailing comma in argument lists.'
790
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
791
+ Enabled: true
792
+
793
+ Style/TrailingCommaInLiteral:
794
+ Description: 'Checks for trailing comma in array and hash literals.'
795
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
796
+ Enabled: true
797
+
798
+ Style/TrailingWhitespace:
799
+ Description: 'Avoid trailing whitespace.'
800
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace'
801
+ Enabled: true
802
+
803
+ Style/TrivialAccessors:
804
+ Description: 'Prefer attr_* methods to trivial readers/writers.'
805
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family'
806
+ Enabled: true
807
+
808
+ Style/UnlessElse:
809
+ Description: >-
810
+ Do not use unless with else. Rewrite these with the positive
811
+ case first.
812
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-else-with-unless'
813
+ Enabled: true
814
+
815
+ Style/UnneededCapitalW:
816
+ Description: 'Checks for %W when interpolation is not needed.'
817
+ Enabled: true
818
+
819
+ Style/UnneededInterpolation:
820
+ Description: 'Checks for strings that are just an interpolated expression.'
821
+ Enabled: true
822
+
823
+ Style/UnneededPercentQ:
824
+ Description: 'Checks for %q/%Q when single quotes or double quotes would do.'
825
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-q'
826
+ Enabled: true
827
+
828
+ Style/TrailingUnderscoreVariable:
829
+ Description: >-
830
+ Checks for the usage of unneeded trailing underscores at the
831
+ end of parallel variable assignment.
832
+ AllowNamedUnderscoreVariables: true
833
+ Enabled: true
834
+
835
+ Style/VariableInterpolation:
836
+ Description: >-
837
+ Don't interpolate global, instance and class variables
838
+ directly in strings.
839
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#curlies-interpolate'
840
+ Enabled: true
841
+
842
+ Style/VariableName:
843
+ Description: 'Use the configured style when naming variables.'
844
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars'
845
+ Enabled: true
846
+
847
+ Style/WhenThen:
848
+ Description: 'Use when x then ... for one-line cases.'
849
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#one-line-cases'
850
+ Enabled: true
851
+
852
+ Style/WhileUntilDo:
853
+ Description: 'Checks for redundant do after while or until.'
854
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-multiline-while-do'
855
+ Enabled: true
856
+
857
+ Style/WhileUntilModifier:
858
+ Description: >-
859
+ Favor modifier while/until usage when you have a
860
+ single-line body.
861
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier'
862
+ Enabled: true
863
+
864
+ Style/WordArray:
865
+ Description: 'Use %w or %W for arrays of words.'
866
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w'
867
+ Enabled: true
868
+
869
+ Style/ZeroLengthPredicate:
870
+ Description: 'Use #empty? when testing for objects of length 0.'
871
+ Enabled: true
872
+
873
+ #################### Metrics ################################
874
+
875
+ Metrics/AbcSize:
876
+ Description: >-
877
+ A calculated magnitude based on number of assignments,
878
+ branches, and conditions.
879
+ Reference: 'http://c2.com/cgi/wiki?AbcMetric'
880
+ Enabled: true
881
+
882
+ Metrics/BlockNesting:
883
+ Description: 'Avoid excessive block nesting'
884
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count'
885
+ Enabled: true
886
+
887
+ Metrics/ClassLength:
888
+ Description: 'Avoid classes longer than 100 lines of code.'
889
+ Enabled: true
890
+
891
+ Metrics/ModuleLength:
892
+ Description: 'Avoid modules longer than 100 lines of code.'
893
+ Enabled: true
894
+
895
+ Metrics/CyclomaticComplexity:
896
+ Description: >-
897
+ A complexity metric that is strongly correlated to the number
898
+ of test cases needed to validate a method.
899
+ Enabled: true
900
+
901
+ Metrics/LineLength:
902
+ Description: 'Limit lines to 80 characters.'
903
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
904
+ Enabled: true
905
+
906
+ Metrics/MethodLength:
907
+ Description: 'Avoid methods longer than 10 lines of code.'
908
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
909
+ Enabled: true
910
+
911
+ Metrics/ParameterLists:
912
+ Description: 'Avoid parameter lists longer than three or four parameters.'
913
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params'
914
+ Enabled: true
915
+
916
+ Metrics/PerceivedComplexity:
917
+ Description: >-
918
+ A complexity metric geared towards measuring complexity for a
919
+ human reader.
920
+ Enabled: true
921
+
922
+ #################### Lint ################################
923
+ ### Warnings
924
+
925
+ Lint/AmbiguousOperator:
926
+ Description: >-
927
+ Checks for ambiguous operators in the first argument of a
928
+ method invocation without parentheses.
929
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-as-args'
930
+ Enabled: true
931
+
932
+ Lint/AmbiguousRegexpLiteral:
933
+ Description: >-
934
+ Checks for ambiguous regexp literals in the first argument of
935
+ a method invocation without parentheses.
936
+ Enabled: true
937
+
938
+ Lint/AssignmentInCondition:
939
+ Description: "Don't use assignment in conditions."
940
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition'
941
+ Enabled: true
942
+
943
+ Lint/BlockAlignment:
944
+ Description: 'Align block ends correctly.'
945
+ Enabled: true
946
+
947
+ Lint/CircularArgumentReference:
948
+ Description: "Default values in optional keyword arguments and optional ordinal arguments should not refer back to the name of the argument."
949
+ Enabled: true
950
+
951
+ Lint/ConditionPosition:
952
+ Description: >-
953
+ Checks for condition placed in a confusing position relative to
954
+ the keyword.
955
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
956
+ Enabled: true
957
+
958
+ Lint/Debugger:
959
+ Description: 'Check for debugger calls.'
960
+ Enabled: true
961
+
962
+ Lint/DefEndAlignment:
963
+ Description: 'Align ends corresponding to defs correctly.'
964
+ Enabled: true
965
+
966
+ Lint/DeprecatedClassMethods:
967
+ Description: 'Check for deprecated class method calls.'
968
+ Enabled: true
969
+
970
+ Lint/DuplicateMethods:
971
+ Description: 'Check for duplicate method definitions.'
972
+ Enabled: true
973
+
974
+ Lint/DuplicatedKey:
975
+ Description: 'Check for duplicate keys in hash literals.'
976
+ Enabled: true
977
+
978
+ Lint/EachWithObjectArgument:
979
+ Description: 'Check for immutable argument given to each_with_object.'
980
+ Enabled: true
981
+
982
+ Lint/ElseLayout:
983
+ Description: 'Check for odd code arrangement in an else block.'
984
+ Enabled: true
985
+
986
+ Lint/EmptyEnsure:
987
+ Description: 'Checks for empty ensure block.'
988
+ Enabled: true
989
+
990
+ Lint/EmptyInterpolation:
991
+ Description: 'Checks for empty string interpolation.'
992
+ Enabled: true
993
+
994
+ Lint/EndAlignment:
995
+ Description: 'Align ends correctly.'
996
+ Enabled: true
997
+
998
+ Lint/EndInMethod:
999
+ Description: 'END blocks should not be placed inside method definitions.'
1000
+ Enabled: true
1001
+
1002
+ Lint/EnsureReturn:
1003
+ Description: 'Do not use return in an ensure block.'
1004
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-return-ensure'
1005
+ Enabled: true
1006
+
1007
+ Lint/Eval:
1008
+ Description: 'The use of eval represents a serious security risk.'
1009
+ Enabled: true
1010
+
1011
+ Lint/FloatOutOfRange:
1012
+ Description: >-
1013
+ Catches floating-point literals too large or small for Ruby to
1014
+ represent.
1015
+ Enabled: true
1016
+
1017
+ Lint/FormatParameterMismatch:
1018
+ Description: 'The number of parameters to format/sprint must match the fields.'
1019
+ Enabled: true
1020
+
1021
+ Lint/HandleExceptions:
1022
+ Description: "Don't suppress exception."
1023
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions'
1024
+ Enabled: true
1025
+
1026
+ Lint/ImplicitStringConcatenation:
1027
+ Description: >-
1028
+ Checks for adjacent string literals on the same line, which
1029
+ could better be represented as a single string literal.
1030
+ Enabled: true
1031
+
1032
+ Lint/IneffectiveAccessModifier:
1033
+ Description: >-
1034
+ Checks for attempts to use `private` or `protected` to set
1035
+ the visibility of a class method, which does not work.
1036
+ Enabled: true
1037
+
1038
+ Lint/InvalidCharacterLiteral:
1039
+ Description: >-
1040
+ Checks for invalid character literals with a non-escaped
1041
+ whitespace character.
1042
+ Enabled: true
1043
+
1044
+ Lint/LiteralInCondition:
1045
+ Description: 'Checks of literals used in conditions.'
1046
+ Enabled: true
1047
+
1048
+ Lint/LiteralInInterpolation:
1049
+ Description: 'Checks for literals used in interpolation.'
1050
+ Enabled: true
1051
+
1052
+ Lint/Loop:
1053
+ Description: >-
1054
+ Use Kernel#loop with break rather than begin/end/until or
1055
+ begin/end/while for post-loop tests.
1056
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#loop-with-break'
1057
+ Enabled: true
1058
+
1059
+ Lint/NestedMethodDefinition:
1060
+ Description: 'Do not use nested method definitions.'
1061
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-methods'
1062
+ Enabled: true
1063
+
1064
+ Lint/NextWithoutAccumulator:
1065
+ Description: >-
1066
+ Do not omit the accumulator when calling `next`
1067
+ in a `reduce`/`inject` block.
1068
+ Enabled: true
1069
+
1070
+ Lint/NonLocalExitFromIterator:
1071
+ Description: 'Do not use return in iterator to cause non-local exit.'
1072
+ Enabled: true
1073
+
1074
+ Lint/ParenthesesAsGroupedExpression:
1075
+ Description: >-
1076
+ Checks for method calls with a space before the opening
1077
+ parenthesis.
1078
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
1079
+ Enabled: true
1080
+
1081
+ Lint/RandOne:
1082
+ Description: >-
1083
+ Checks for `rand(1)` calls. Such calls always return `0`
1084
+ and most likely a mistake.
1085
+ Enabled: true
1086
+
1087
+ Lint/RequireParentheses:
1088
+ Description: >-
1089
+ Use parentheses in the method call to avoid confusion
1090
+ about precedence.
1091
+ Enabled: true
1092
+
1093
+ Lint/RescueException:
1094
+ Description: 'Avoid rescuing the Exception class.'
1095
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-blind-rescues'
1096
+ Enabled: true
1097
+
1098
+ Lint/ShadowingOuterLocalVariable:
1099
+ Description: >-
1100
+ Do not use the same name as outer local variable
1101
+ for block arguments or block local variables.
1102
+ Enabled: true
1103
+
1104
+ Lint/StringConversionInInterpolation:
1105
+ Description: 'Checks for Object#to_s usage in string interpolation.'
1106
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-to-s'
1107
+ Enabled: true
1108
+
1109
+ Lint/UnderscorePrefixedVariableName:
1110
+ Description: 'Do not use prefix `_` for a variable that is used.'
1111
+ Enabled: true
1112
+
1113
+ Lint/UnneededDisable:
1114
+ Description: >-
1115
+ Checks for rubocop:disable comments that can be removed.
1116
+ Note: this cop is not disabled when disabling all cops.
1117
+ It must be explicitly disabled.
1118
+ Enabled: true
1119
+
1120
+ Lint/UnusedBlockArgument:
1121
+ Description: 'Checks for unused block arguments.'
1122
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
1123
+ Enabled: true
1124
+
1125
+ Lint/UnusedMethodArgument:
1126
+ Description: 'Checks for unused method arguments.'
1127
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
1128
+ Enabled: true
1129
+
1130
+ Lint/UnreachableCode:
1131
+ Description: 'Unreachable code.'
1132
+ Enabled: true
1133
+
1134
+ Lint/UselessAccessModifier:
1135
+ Description: 'Checks for useless access modifiers.'
1136
+ Enabled: true
1137
+
1138
+ Lint/UselessAssignment:
1139
+ Description: 'Checks for useless assignment to a local variable.'
1140
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
1141
+ Enabled: true
1142
+
1143
+ Lint/UselessComparison:
1144
+ Description: 'Checks for comparison of something with itself.'
1145
+ Enabled: true
1146
+
1147
+ Lint/UselessElseWithoutRescue:
1148
+ Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
1149
+ Enabled: true
1150
+
1151
+ Lint/UselessSetterCall:
1152
+ Description: 'Checks for useless setter call to a local variable.'
1153
+ Enabled: true
1154
+
1155
+ Lint/Void:
1156
+ Description: 'Possible use of operator/literal/variable in void context.'
1157
+ Enabled: true
1158
+
1159
+ ##################### Performance #############################
1160
+
1161
+ Performance/Casecmp:
1162
+ Description: >-
1163
+ Use `casecmp` rather than `downcase ==`, `upcase ==`, `== downcase`, or `== upcase`..
1164
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringcasecmp-vs-stringdowncase---code'
1165
+ Enabled: true
1166
+
1167
+ Performance/CaseWhenSplat:
1168
+ Description: >-
1169
+ Place `when` conditions that use splat at the end
1170
+ of the list of `when` branches.
1171
+ Enabled: true
1172
+
1173
+ Performance/Count:
1174
+ Description: >-
1175
+ Use `count` instead of `select...size`, `reject...size`,
1176
+ `select...count`, `reject...count`, `select...length`,
1177
+ and `reject...length`.
1178
+ # This cop has known compatibility issues with `ActiveRecord` and other
1179
+ # frameworks. ActiveRecord's `count` ignores the block that is passed to it.
1180
+ # For more information, see the documentation in the cop itself.
1181
+ # If you understand the known risk, you can disable `SafeMode`.
1182
+ SafeMode: true
1183
+ Enabled: true
1184
+
1185
+ Performance/Detect:
1186
+ Description: >-
1187
+ Use `detect` instead of `select.first`, `find_all.first`,
1188
+ `select.last`, and `find_all.last`.
1189
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code'
1190
+ # This cop has known compatibility issues with `ActiveRecord` and other
1191
+ # frameworks. `ActiveRecord` does not implement a `detect` method and `find`
1192
+ # has its own meaning. Correcting `ActiveRecord` methods with this cop
1193
+ # should be considered unsafe.
1194
+ SafeMode: true
1195
+ Enabled: true
1196
+
1197
+ Performance/DoubleStartEndWith:
1198
+ Description: >-
1199
+ Use `str.{start,end}_with?(x, ..., y, ...)`
1200
+ instead of `str.{start,end}_with?(x, ...) || str.{start,end}_with?(y, ...)`.
1201
+ Enabled: true
1202
+
1203
+ Performance/EndWith:
1204
+ Description: 'Use `end_with?` instead of a regex match anchored to the end of a string.'
1205
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end'
1206
+ Enabled: true
1207
+
1208
+ Performance/FixedSize:
1209
+ Description: 'Do not compute the size of statically sized objects except in constants'
1210
+ Enabled: true
1211
+
1212
+ Performance/FlatMap:
1213
+ Description: >-
1214
+ Use `Enumerable#flat_map`
1215
+ instead of `Enumerable#map...Array#flatten(1)`
1216
+ or `Enumberable#collect..Array#flatten(1)`
1217
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code'
1218
+ Enabled: true
1219
+ EnabledForFlattenWithoutParams: false
1220
+ # If enabled, this cop will warn about usages of
1221
+ # `flatten` being called without any parameters.
1222
+ # This can be dangerous since `flat_map` will only flatten 1 level, and
1223
+ # `flatten` without any parameters can flatten multiple levels.
1224
+
1225
+ Performance/HashEachMethods:
1226
+ Description: >-
1227
+ Use `Hash#each_key` and `Hash#each_value` instead of
1228
+ `Hash#keys.each` and `Hash#values.each`.
1229
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-each'
1230
+ Enabled: true
1231
+ AutoCorrect: false
1232
+
1233
+ Performance/LstripRstrip:
1234
+ Description: 'Use `strip` instead of `lstrip.rstrip`.'
1235
+ Enabled: true
1236
+
1237
+ Performance/RangeInclude:
1238
+ Description: 'Use `Range#cover?` instead of `Range#include?`.'
1239
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#cover-vs-include-code'
1240
+ Enabled: true
1241
+
1242
+ Performance/RedundantBlockCall:
1243
+ Description: 'Use `yield` instead of `block.call`.'
1244
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#proccall-vs-yield-code'
1245
+ Enabled: true
1246
+
1247
+ Performance/RedundantMatch:
1248
+ Description: >-
1249
+ Use `=~` instead of `String#match` or `Regexp#match` in a context where the
1250
+ returned `MatchData` is not needed.
1251
+ Enabled: true
1252
+
1253
+ Performance/RedundantMerge:
1254
+ Description: 'Use Hash#[]=, rather than Hash#merge! with a single key-value pair.'
1255
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#hashmerge-vs-hash-code'
1256
+ Enabled: true
1257
+
1258
+ Performance/RedundantSortBy:
1259
+ Description: 'Use `sort` instead of `sort_by { |x| x }`.'
1260
+ Enabled: true
1261
+
1262
+ Performance/ReverseEach:
1263
+ Description: 'Use `reverse_each` instead of `reverse.each`.'
1264
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code'
1265
+ Enabled: true
1266
+
1267
+ Performance/Sample:
1268
+ Description: >-
1269
+ Use `sample` instead of `shuffle.first`,
1270
+ `shuffle.last`, and `shuffle[Fixnum]`.
1271
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
1272
+ Enabled: true
1273
+
1274
+ Performance/Size:
1275
+ Description: >-
1276
+ Use `size` instead of `count` for counting
1277
+ the number of elements in `Array` and `Hash`.
1278
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code'
1279
+ Enabled: true
1280
+
1281
+ Performance/StartWith:
1282
+ Description: 'Use `start_with?` instead of a regex match anchored to the beginning of a string.'
1283
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end'
1284
+ Enabled: true
1285
+
1286
+ Performance/StringReplacement:
1287
+ Description: >-
1288
+ Use `tr` instead of `gsub` when you are replacing the same
1289
+ number of characters. Use `delete` instead of `gsub` when
1290
+ you are deleting characters.
1291
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code'
1292
+ Enabled: true
1293
+
1294
+ Performance/TimesMap:
1295
+ Description: 'Checks for .times.map calls.'
1296
+ Enabled: true
1297
+
1298
+ ##################### Rails ##################################
1299
+
1300
+ Rails/ActionFilter:
1301
+ Description: 'Enforces consistent use of action filter methods.'
1302
+ Enabled: true
1303
+
1304
+ Rails/Date:
1305
+ Description: >-
1306
+ Checks the correct usage of date aware methods,
1307
+ such as Date.today, Date.current etc.
1308
+ Enabled: true
1309
+
1310
+ Rails/Delegate:
1311
+ Description: 'Prefer delegate method for delegations.'
1312
+ Enabled: true
1313
+
1314
+ Rails/FindBy:
1315
+ Description: 'Prefer find_by over where.first.'
1316
+ Enabled: true
1317
+
1318
+ Rails/FindEach:
1319
+ Description: 'Prefer all.find_each over all.find.'
1320
+ Enabled: true
1321
+
1322
+ Rails/HasAndBelongsToMany:
1323
+ Description: 'Prefer has_many :through to has_and_belongs_to_many.'
1324
+ Enabled: true
1325
+
1326
+ Rails/Output:
1327
+ Description: 'Checks for calls to puts, print, etc.'
1328
+ Enabled: true
1329
+
1330
+ Rails/PluralizationGrammar:
1331
+ Description: 'Checks for incorrect grammar when using methods like `3.day.ago`.'
1332
+ Enabled: true
1333
+
1334
+ Rails/ReadWriteAttribute:
1335
+ Description: >-
1336
+ Checks for read_attribute(:attr) and
1337
+ write_attribute(:attr, val).
1338
+ Enabled: true
1339
+
1340
+ Rails/ScopeArgs:
1341
+ Description: 'Checks the arguments of ActiveRecord scopes.'
1342
+ Enabled: true
1343
+
1344
+ Rails/TimeZone:
1345
+ Description: 'Checks the correct usage of time zone aware methods.'
1346
+ StyleGuide: 'https://github.com/bbatsov/rails-style-guide#time'
1347
+ Reference: 'http://danilenko.org/2012/7/6/rails_timezones'
1348
+ Enabled: true
1349
+
1350
+ Rails/Validation:
1351
+ Description: 'Use validates :attribute, hash of validations.'
1352
+ Enabled: true