ruby-cbc 0.3.18 → 0.3.19

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