cookstyle 0.0.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,23 +2,24 @@
2
2
 
3
3
  Style/AccessModifierIndentation:
4
4
  Description: Check indentation of private/protected visibility modifiers.
5
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-public-private-protected'
5
+ StyleGuide: '#indent-public-private-protected'
6
6
  Enabled: true
7
7
 
8
8
  Style/AccessorMethodName:
9
9
  Description: Check the naming of accessor methods for get_/set_.
10
+ StyleGuide: '#accessor_mutator_method_names'
10
11
  Enabled: true
11
12
 
12
13
  Style/Alias:
13
14
  Description: 'Use alias instead of alias_method.'
14
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#alias-method'
15
+ StyleGuide: '#alias-method'
15
16
  Enabled: true
16
17
 
17
18
  Style/AlignArray:
18
19
  Description: >-
19
20
  Align the elements of an array literal if they span more than
20
21
  one line.
21
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#align-multiline-arrays'
22
+ StyleGuide: '#align-multiline-arrays'
22
23
  Enabled: true
23
24
 
24
25
  Style/AlignHash:
@@ -31,47 +32,47 @@ Style/AlignParameters:
31
32
  Description: >-
32
33
  Align the parameters of a method call if they span more
33
34
  than one line.
34
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent'
35
+ StyleGuide: '#no-double-indent'
35
36
  Enabled: true
36
37
 
37
38
  Style/AndOr:
38
39
  Description: 'Use &&/|| instead of and/or.'
39
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-and-or-or'
40
+ StyleGuide: '#no-and-or-or'
40
41
  Enabled: true
41
42
 
42
43
  Style/ArrayJoin:
43
44
  Description: 'Use Array#join instead of Array#*.'
44
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#array-join'
45
+ StyleGuide: '#array-join'
45
46
  Enabled: true
46
47
 
47
48
  Style/AsciiComments:
48
49
  Description: 'Use only ascii symbols in comments.'
49
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments'
50
+ StyleGuide: '#english-comments'
50
51
  Enabled: true
51
52
 
52
53
  Style/AsciiIdentifiers:
53
54
  Description: 'Use only ascii symbols in identifiers.'
54
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers'
55
+ StyleGuide: '#english-identifiers'
55
56
  Enabled: true
56
57
 
57
58
  Style/Attr:
58
59
  Description: 'Checks for uses of Module#attr.'
59
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr'
60
+ StyleGuide: '#attr'
60
61
  Enabled: true
61
62
 
62
63
  Style/BeginBlock:
63
64
  Description: 'Avoid the use of BEGIN blocks.'
64
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-BEGIN-blocks'
65
+ StyleGuide: '#no-BEGIN-blocks'
65
66
  Enabled: true
66
67
 
67
68
  Style/BarePercentLiterals:
68
69
  Description: 'Checks if usage of %() or %Q() matches configuration.'
69
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-q-shorthand'
70
+ StyleGuide: '#percent-q-shorthand'
70
71
  Enabled: true
71
72
 
72
73
  Style/BlockComments:
73
74
  Description: 'Do not use block comments.'
74
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-block-comments'
75
+ StyleGuide: '#no-block-comments'
75
76
  Enabled: true
76
77
 
77
78
  Style/BlockEndNewline:
@@ -83,7 +84,7 @@ Style/BlockDelimiters:
83
84
  Avoid using {...} for multi-line blocks (multiline chaining is
84
85
  always ugly).
85
86
  Prefer {...} over do...end for single-line blocks.
86
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
87
+ StyleGuide: '#single-line-blocks'
87
88
  Enabled: true
88
89
 
89
90
  Style/BracesAroundHashParameters:
@@ -92,22 +93,22 @@ Style/BracesAroundHashParameters:
92
93
 
93
94
  Style/CaseEquality:
94
95
  Description: 'Avoid explicit use of the case equality operator(===).'
95
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality'
96
+ StyleGuide: '#no-case-equality'
96
97
  Enabled: true
97
98
 
98
99
  Style/CaseIndentation:
99
100
  Description: 'Indentation of when in a case/when/[else/]end.'
100
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-when-to-case'
101
+ StyleGuide: '#indent-when-to-case'
101
102
  Enabled: true
102
103
 
103
104
  Style/CharacterLiteral:
104
105
  Description: 'Checks for uses of character literals.'
105
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-character-literals'
106
+ StyleGuide: '#no-character-literals'
106
107
  Enabled: true
107
108
 
108
109
  Style/ClassAndModuleCamelCase:
109
110
  Description: 'Use CamelCase for classes and modules.'
110
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#camelcase-classes'
111
+ StyleGuide: '#camelcase-classes'
111
112
  Enabled: true
112
113
 
113
114
  Style/ClassAndModuleChildren:
@@ -120,12 +121,12 @@ Style/ClassCheck:
120
121
 
121
122
  Style/ClassMethods:
122
123
  Description: 'Use self when defining module/class methods.'
123
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#def-self-class-methods'
124
+ StyleGuide: '#def-self-class-methods'
124
125
  Enabled: true
125
126
 
126
127
  Style/ClassVars:
127
128
  Description: 'Avoid the use of class variables.'
128
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars'
129
+ StyleGuide: '#no-class-vars'
129
130
  Enabled: true
130
131
 
131
132
  Style/ClosingParenthesisIndentation:
@@ -134,19 +135,19 @@ Style/ClosingParenthesisIndentation:
134
135
 
135
136
  Style/ColonMethodCall:
136
137
  Description: 'Do not use :: for method call.'
137
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#double-colons'
138
+ StyleGuide: '#double-colons'
138
139
  Enabled: true
139
140
 
140
141
  Style/CommandLiteral:
141
142
  Description: 'Use `` or %x around command literals.'
142
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-x'
143
+ StyleGuide: '#percent-x'
143
144
  Enabled: true
144
145
 
145
146
  Style/CommentAnnotation:
146
147
  Description: >-
147
148
  Checks formatting of special comments
148
149
  (TODO, FIXME, OPTIMIZE, HACK, REVIEW).
149
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#annotate-keywords'
150
+ StyleGuide: '#annotate-keywords'
150
151
  Enabled: true
151
152
 
152
153
  Style/CommentIndentation:
@@ -162,17 +163,12 @@ Style/ConditionalAssignment:
162
163
 
163
164
  Style/ConstantName:
164
165
  Description: 'Constants should use SCREAMING_SNAKE_CASE.'
165
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#screaming-snake-case'
166
+ StyleGuide: '#screaming-snake-case'
166
167
  Enabled: true
167
168
 
168
169
  Style/DefWithParentheses:
169
170
  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'
171
+ StyleGuide: '#method-parens'
176
172
  Enabled: true
177
173
 
178
174
  Style/Documentation:
@@ -184,12 +180,18 @@ Style/Documentation:
184
180
 
185
181
  Style/DotPosition:
186
182
  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'
183
+ StyleGuide: '#consistent-multi-line-chains'
188
184
  Enabled: true
189
185
 
190
186
  Style/DoubleNegation:
191
187
  Description: 'Checks for uses of double negation (!!).'
192
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-bang-bang'
188
+ StyleGuide: '#no-bang-bang'
189
+ Enabled: true
190
+
191
+ Style/EachForSimpleLoop:
192
+ Description: >-
193
+ Use `Integer#times` for a simple loop which iterates a fixed
194
+ number of times.
193
195
  Enabled: true
194
196
 
195
197
  Style/EachWithObject:
@@ -204,9 +206,13 @@ Style/EmptyElse:
204
206
  Description: 'Avoid empty else-clauses.'
205
207
  Enabled: true
206
208
 
209
+ Style/EmptyCaseCondition:
210
+ Description: 'Avoid empty condition in case statements.'
211
+ Enabled: true
212
+
207
213
  Style/EmptyLineBetweenDefs:
208
214
  Description: 'Use empty lines between defs.'
209
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#empty-lines-between-methods'
215
+ StyleGuide: '#empty-lines-between-methods'
210
216
  Enabled: true
211
217
 
212
218
  Style/EmptyLines:
@@ -235,22 +241,27 @@ Style/EmptyLinesAroundMethodBody:
235
241
 
236
242
  Style/EmptyLiteral:
237
243
  Description: 'Prefer literals to Array.new/Hash.new/String.new.'
238
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#literal-array-hash'
244
+ StyleGuide: '#literal-array-hash'
245
+ Enabled: true
246
+
247
+ Style/EmptyMethod:
248
+ Description: 'Checks the formatting of empty method definitions.'
249
+ StyleGuide: '#no-single-line-methods'
239
250
  Enabled: true
240
251
 
241
252
  Style/EndBlock:
242
253
  Description: 'Avoid the use of END blocks.'
243
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-END-blocks'
254
+ StyleGuide: '#no-END-blocks'
244
255
  Enabled: true
245
256
 
246
257
  Style/EndOfLine:
247
258
  Description: 'Use Unix-style line endings.'
248
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#crlf'
259
+ StyleGuide: '#crlf'
249
260
  Enabled: true
250
261
 
251
262
  Style/EvenOdd:
252
- Description: 'Favor the use of Fixnum#even? && Fixnum#odd?'
253
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
263
+ Description: 'Favor the use of Integer#even? && Integer#odd?'
264
+ StyleGuide: '#predicate-methods'
254
265
  Enabled: true
255
266
 
256
267
  Style/ExtraSpacing:
@@ -259,7 +270,7 @@ Style/ExtraSpacing:
259
270
 
260
271
  Style/FileName:
261
272
  Description: 'Use snake_case for source file names.'
262
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
273
+ StyleGuide: '#snake-case-files'
263
274
  Enabled: true
264
275
 
265
276
  Style/FrozenStringLiteralComment:
@@ -279,35 +290,35 @@ Style/FirstParameterIndentation:
279
290
 
280
291
  Style/FlipFlop:
281
292
  Description: 'Checks for flip flops'
282
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-flip-flops'
293
+ StyleGuide: '#no-flip-flops'
283
294
  Enabled: true
284
295
 
285
296
  Style/For:
286
297
  Description: 'Checks use of for or each in multiline loops.'
287
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-for-loops'
298
+ StyleGuide: '#no-for-loops'
288
299
  Enabled: true
289
300
 
290
301
  Style/FormatString:
291
302
  Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
292
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#sprintf'
303
+ StyleGuide: '#sprintf'
293
304
  Enabled: true
294
305
 
295
306
  Style/GlobalVars:
296
307
  Description: 'Do not introduce global variables.'
297
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#instance-vars'
308
+ StyleGuide: '#instance-vars'
298
309
  Reference: 'http://www.zenspider.com/Languages/Ruby/QuickRef.html'
299
310
  Enabled: true
300
311
 
301
312
  Style/GuardClause:
302
313
  Description: 'Check for conditionals that can be replaced with guard clauses'
303
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
314
+ StyleGuide: '#no-nested-conditionals'
304
315
  Enabled: true
305
316
 
306
317
  Style/HashSyntax:
307
318
  Description: >-
308
319
  Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
309
320
  { :a => 1, :b => 2 }.
310
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-literals'
321
+ StyleGuide: '#hash-literals'
311
322
  Enabled: true
312
323
 
313
324
  Style/IfInsideElse:
@@ -318,7 +329,7 @@ Style/IfUnlessModifier:
318
329
  Description: >-
319
330
  Favor modifier if/unless usage when you have a
320
331
  single-line body.
321
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
332
+ StyleGuide: '#if-as-a-modifier'
322
333
  Enabled: true
323
334
 
324
335
  Style/IfUnlessModifierOfIfUnless:
@@ -328,7 +339,7 @@ Style/IfUnlessModifierOfIfUnless:
328
339
 
329
340
  Style/IfWithSemicolon:
330
341
  Description: 'Do not use if x; .... Use the ternary operator instead.'
331
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs'
342
+ StyleGuide: '#no-semicolon-ifs'
332
343
  Enabled: true
333
344
 
334
345
  Style/IndentationConsistency:
@@ -337,7 +348,7 @@ Style/IndentationConsistency:
337
348
 
338
349
  Style/IndentationWidth:
339
350
  Description: 'Use 2 spaces for indentation.'
340
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation'
351
+ StyleGuide: '#spaces-indentation'
341
352
  Enabled: true
342
353
 
343
354
  Style/IdenticalConditionalBranches:
@@ -365,22 +376,26 @@ Style/IndentHash:
365
376
 
366
377
  Style/InfiniteLoop:
367
378
  Description: 'Use Kernel#loop for infinite loops.'
368
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#infinite-loop'
379
+ StyleGuide: '#infinite-loop'
369
380
  Enabled: true
370
381
 
371
382
  Style/Lambda:
372
383
  Description: 'Use the new lambda literal syntax for single-line blocks.'
373
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#lambda-multi-line'
384
+ StyleGuide: '#lambda-multi-line'
385
+ Enabled: true
386
+
387
+ Style/SpaceInLambdaLiteral:
388
+ Description: 'Checks for spaces in lambda literals.'
374
389
  Enabled: true
375
390
 
376
391
  Style/LambdaCall:
377
392
  Description: 'Use lambda.call(...) instead of lambda.(...).'
378
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc-call'
393
+ StyleGuide: '#proc-call'
379
394
  Enabled: true
380
395
 
381
396
  Style/LeadingCommentSpace:
382
397
  Description: 'Comments should start with a space.'
383
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-space'
398
+ StyleGuide: '#hash-space'
384
399
  Enabled: true
385
400
 
386
401
  Style/LineEndConcatenation:
@@ -391,38 +406,73 @@ Style/LineEndConcatenation:
391
406
 
392
407
  Style/MethodCallParentheses:
393
408
  Description: 'Do not use parentheses for method calls with no arguments.'
394
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-args-no-parens'
409
+ StyleGuide: '#method-invocation-parens'
395
410
  Enabled: true
396
411
 
397
412
  Style/MethodDefParentheses:
398
413
  Description: >-
399
414
  Checks if the method definitions have or don't have
400
415
  parentheses.
401
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens'
416
+ StyleGuide: '#method-parens'
402
417
  Enabled: true
403
418
 
404
419
  Style/MethodName:
405
420
  Description: 'Use the configured style when naming methods.'
406
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars'
421
+ StyleGuide: '#snake-case-symbols-methods-vars'
422
+ Enabled: true
423
+
424
+ Style/MethodMissing:
425
+ Description: 'Avoid using `method_missing`.'
426
+ StyleGuide: '#no-method-missing'
407
427
  Enabled: true
408
428
 
409
429
  Style/ModuleFunction:
410
430
  Description: 'Checks for usage of `extend self` in modules.'
411
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#module-function'
431
+ StyleGuide: '#module-function'
432
+ Enabled: true
433
+
434
+ Style/MultilineArrayBraceLayout:
435
+ Description: >-
436
+ Checks that the closing brace in an array literal is
437
+ either on the same line as the last array element, or
438
+ a new line.
412
439
  Enabled: true
413
440
 
414
441
  Style/MultilineBlockChain:
415
442
  Description: 'Avoid multi-line chains of blocks.'
416
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
443
+ StyleGuide: '#single-line-blocks'
417
444
  Enabled: true
418
445
 
419
446
  Style/MultilineBlockLayout:
420
447
  Description: 'Ensures newlines after multiline block do statements.'
421
448
  Enabled: true
422
449
 
450
+ Style/MultilineHashBraceLayout:
451
+ Description: >-
452
+ Checks that the closing brace in a hash literal is
453
+ either on the same line as the last hash element, or
454
+ a new line.
455
+ Enabled: true
456
+
423
457
  Style/MultilineIfThen:
424
458
  Description: 'Do not use then for multi-line if/unless.'
425
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-then'
459
+ StyleGuide: '#no-then'
460
+ Enabled: true
461
+
462
+ Style/MultilineIfModifier:
463
+ Description: 'Only use if/unless modifiers on single line statements.'
464
+ StyleGuide: '#no-multiline-if-modifiers'
465
+ Enabled: true
466
+
467
+ Style/MultilineMemoization:
468
+ Description: 'Wrap multiline memoizations in a `begin` and `end` block.'
469
+ Enabled: true
470
+
471
+ Style/MultilineMethodCallBraceLayout:
472
+ Description: >-
473
+ Checks that the closing brace in a method call is
474
+ either on the same line as the last method argument, or
475
+ a new line.
426
476
  Enabled: true
427
477
 
428
478
  Style/MultilineMethodCallIndentation:
@@ -431,6 +481,13 @@ Style/MultilineMethodCallIndentation:
431
481
  that span more than one line.
432
482
  Enabled: true
433
483
 
484
+ Style/MultilineMethodDefinitionBraceLayout:
485
+ Description: >-
486
+ Checks that the closing brace in a method definition is
487
+ either on the same line as the last method parameter, or
488
+ a new line.
489
+ Enabled: true
490
+
434
491
  Style/MultilineOperationIndentation:
435
492
  Description: >-
436
493
  Checks indentation of binary operations that span more than
@@ -441,7 +498,7 @@ Style/MultilineTernaryOperator:
441
498
  Description: >-
442
499
  Avoid multi-line ?: (the ternary operator);
443
500
  use if/unless instead.
444
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-multiline-ternary'
501
+ StyleGuide: '#no-multiline-ternary'
445
502
  Enabled: true
446
503
 
447
504
  Style/MutableConstant:
@@ -452,17 +509,17 @@ Style/NegatedIf:
452
509
  Description: >-
453
510
  Favor unless over if for negative conditions
454
511
  (or control flow or).
455
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives'
512
+ StyleGuide: '#unless-for-negatives'
456
513
  Enabled: true
457
514
 
458
515
  Style/NegatedWhile:
459
516
  Description: 'Favor until over while for negative conditions.'
460
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#until-for-negatives'
517
+ StyleGuide: '#until-for-negatives'
461
518
  Enabled: true
462
519
 
463
520
  Style/NestedModifier:
464
521
  Description: 'Avoid using nested modifiers.'
465
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-modifiers'
522
+ StyleGuide: '#no-nested-modifiers'
466
523
  Enabled: true
467
524
 
468
525
  Style/NestedParenthesizedCalls:
@@ -473,53 +530,69 @@ Style/NestedParenthesizedCalls:
473
530
 
474
531
  Style/NestedTernaryOperator:
475
532
  Description: 'Use one expression per branch in a ternary operator.'
476
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-ternary'
533
+ StyleGuide: '#no-nested-ternary'
477
534
  Enabled: true
478
535
 
479
536
  Style/Next:
480
537
  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'
538
+ StyleGuide: '#no-nested-conditionals'
482
539
  Enabled: true
483
540
 
484
541
  Style/NilComparison:
485
542
  Description: 'Prefer x.nil? to x == nil.'
486
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
543
+ StyleGuide: '#predicate-methods'
487
544
  Enabled: true
488
545
 
489
546
  Style/NonNilCheck:
490
547
  Description: 'Checks for redundant nil checks.'
491
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-non-nil-checks'
548
+ StyleGuide: '#no-non-nil-checks'
492
549
  Enabled: true
493
550
 
494
551
  Style/Not:
495
552
  Description: 'Use ! instead of not.'
496
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bang-not-not'
553
+ StyleGuide: '#bang-not-not'
497
554
  Enabled: true
498
555
 
499
556
  Style/NumericLiterals:
500
557
  Description: >-
501
558
  Add underscores to large numeric literals to improve their
502
559
  readability.
503
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics'
560
+ StyleGuide: '#underscores-in-numerics'
561
+ Enabled: true
562
+
563
+ Style/NumericLiteralPrefix:
564
+ Description: 'Use smallcase prefixes for numeric literals.'
565
+ StyleGuide: '#numeric-literal-prefixes'
566
+ Enabled: true
567
+
568
+ Style/NumericPredicate:
569
+ Description: >-
570
+ Checks for the use of predicate- or comparison methods for
571
+ numeric comparisons.
572
+ StyleGuide: '#predicate-methods'
573
+ # This will change to a new method call which isn't guaranteed to be on the
574
+ # object. Switching these methods has to be done with knowledge of the types
575
+ # of the variables which rubocop doesn't have.
576
+ AutoCorrect: false
504
577
  Enabled: true
505
578
 
506
579
  Style/OneLineConditional:
507
580
  Description: >-
508
581
  Favor the ternary operator(?:) over
509
582
  if/then/else/end constructs.
510
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator'
583
+ StyleGuide: '#ternary-operator'
511
584
  Enabled: true
512
585
 
513
586
  Style/OpMethod:
514
587
  Description: 'When defining binary operators, name the argument other.'
515
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
588
+ StyleGuide: '#other-arg'
516
589
  Enabled: true
517
590
 
518
591
  Style/OptionalArguments:
519
592
  Description: >-
520
593
  Checks for optional arguments that do not appear at the end
521
594
  of the argument list
522
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#optional-arguments'
595
+ StyleGuide: '#optional-arguments'
523
596
  Enabled: true
524
597
 
525
598
  Style/ParallelAssignment:
@@ -527,19 +600,19 @@ Style/ParallelAssignment:
527
600
  Check for simple usages of parallel assignment.
528
601
  It will only warn when the number of variables
529
602
  matches on both sides of the assignment.
530
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parallel-assignment'
603
+ StyleGuide: '#parallel-assignment'
531
604
  Enabled: true
532
605
 
533
606
  Style/ParenthesesAroundCondition:
534
607
  Description: >-
535
608
  Don't use parentheses around the condition of an
536
609
  if/unless/while.
537
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-parens-if'
610
+ StyleGuide: '#no-parens-around-condition'
538
611
  Enabled: true
539
612
 
540
613
  Style/PercentLiteralDelimiters:
541
614
  Description: 'Use `%`-literal delimiters consistently'
542
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-literal-braces'
615
+ StyleGuide: '#percent-literal-braces'
543
616
  Enabled: true
544
617
 
545
618
  Style/PercentQLiterals:
@@ -548,32 +621,37 @@ Style/PercentQLiterals:
548
621
 
549
622
  Style/PerlBackrefs:
550
623
  Description: 'Avoid Perl-style regex back references.'
551
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
624
+ StyleGuide: '#no-perl-regexp-last-matchers'
552
625
  Enabled: true
553
626
 
554
627
  Style/PredicateName:
555
628
  Description: 'Check the names of predicate methods.'
556
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
629
+ StyleGuide: '#bool-methods-qmark'
630
+ Enabled: true
631
+
632
+ Style/PreferredHashMethods:
633
+ Description: 'Checks use of `has_key?` and `has_value?` Hash methods.'
634
+ StyleGuide: '#hash-key'
557
635
  Enabled: true
558
636
 
559
637
  Style/Proc:
560
638
  Description: 'Use proc instead of Proc.new.'
561
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc'
639
+ StyleGuide: '#proc'
562
640
  Enabled: true
563
641
 
564
642
  Style/RaiseArgs:
565
643
  Description: 'Checks the arguments passed to raise/fail.'
566
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#exception-class-messages'
644
+ StyleGuide: '#exception-class-messages'
567
645
  Enabled: true
568
646
 
569
647
  Style/RedundantBegin:
570
648
  Description: "Don't use begin blocks when they are not needed."
571
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#begin-implicit'
649
+ StyleGuide: '#begin-implicit'
572
650
  Enabled: true
573
651
 
574
652
  Style/RedundantException:
575
653
  Description: "Checks for an obsolete RuntimeException argument in raise/fail."
576
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-runtimeerror'
654
+ StyleGuide: '#no-explicit-runtimeerror'
577
655
  Enabled: true
578
656
 
579
657
  Style/RedundantFreeze:
@@ -586,17 +664,17 @@ Style/RedundantParentheses:
586
664
 
587
665
  Style/RedundantReturn:
588
666
  Description: "Don't use return where it's not required."
589
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-return'
667
+ StyleGuide: '#no-explicit-return'
590
668
  Enabled: true
591
669
 
592
670
  Style/RedundantSelf:
593
671
  Description: "Don't use self where it's not needed."
594
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-self-unless-required'
672
+ StyleGuide: '#no-self-unless-required'
595
673
  Enabled: true
596
674
 
597
675
  Style/RegexpLiteral:
598
676
  Description: 'Use / or %r around regular expressions.'
599
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r'
677
+ StyleGuide: '#percent-r'
600
678
  Enabled: true
601
679
 
602
680
  Style/RescueEnsureAlignment:
@@ -605,34 +683,40 @@ Style/RescueEnsureAlignment:
605
683
 
606
684
  Style/RescueModifier:
607
685
  Description: 'Avoid using rescue in its modifier form.'
608
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-rescue-modifiers'
686
+ StyleGuide: '#no-rescue-modifiers'
687
+ Enabled: true
688
+
689
+ Style/SafeNavigation:
690
+ Description: >-
691
+ This cop transforms usages of a method call safeguarded by
692
+ a check for the existance of the object to
693
+ safe navigation (`&.`).
609
694
  Enabled: true
610
695
 
611
696
  Style/SelfAssignment:
612
697
  Description: >-
613
698
  Checks for places where self-assignment shorthand should have
614
699
  been used.
615
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment'
700
+ StyleGuide: '#self-assignment'
616
701
  Enabled: true
617
702
 
618
703
  Style/Semicolon:
619
704
  Description: "Don't use semicolons to terminate expressions."
620
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon'
705
+ StyleGuide: '#no-semicolon'
621
706
  Enabled: true
622
707
 
623
708
  Style/SignalException:
624
709
  Description: 'Checks for proper usage of fail and raise.'
625
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#prefer-raise-over-fail'
710
+ StyleGuide: '#prefer-raise-over-fail'
626
711
  Enabled: true
627
712
 
628
713
  Style/SingleLineBlockParams:
629
714
  Description: 'Enforces the names of some block params.'
630
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#reduce-blocks'
631
715
  Enabled: true
632
716
 
633
717
  Style/SingleLineMethods:
634
718
  Description: 'Avoid single-line methods.'
635
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-single-line-methods'
719
+ StyleGuide: '#no-single-line-methods'
636
720
  Enabled: true
637
721
 
638
722
  Style/SpaceBeforeFirstArg:
@@ -643,29 +727,29 @@ Style/SpaceBeforeFirstArg:
643
727
 
644
728
  Style/SpaceAfterColon:
645
729
  Description: 'Use spaces after colons.'
646
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
730
+ StyleGuide: '#spaces-operators'
647
731
  Enabled: true
648
732
 
649
733
  Style/SpaceAfterComma:
650
734
  Description: 'Use spaces after commas.'
651
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
735
+ StyleGuide: '#spaces-operators'
652
736
  Enabled: true
653
737
 
654
738
  Style/SpaceAfterMethodName:
655
739
  Description: >-
656
740
  Do not put a space between a method name and the opening
657
741
  parenthesis in a method definition.
658
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
742
+ StyleGuide: '#parens-no-spaces'
659
743
  Enabled: true
660
744
 
661
745
  Style/SpaceAfterNot:
662
746
  Description: Tracks redundant space after the ! operator.
663
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-space-bang'
747
+ StyleGuide: '#no-space-bang'
664
748
  Enabled: true
665
749
 
666
750
  Style/SpaceAfterSemicolon:
667
751
  Description: 'Use spaces after semicolons.'
668
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
752
+ StyleGuide: '#spaces-operators'
669
753
  Enabled: true
670
754
 
671
755
  Style/SpaceBeforeBlockBraces:
@@ -704,7 +788,7 @@ Style/SpaceAroundEqualsInParameterDefault:
704
788
  Checks that the equals signs in parameter default assignments
705
789
  have or don't have surrounding space depending on
706
790
  configuration.
707
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-around-equals'
791
+ StyleGuide: '#spaces-around-equals'
708
792
  Enabled: true
709
793
 
710
794
  Style/SpaceAroundKeyword:
@@ -713,47 +797,55 @@ Style/SpaceAroundKeyword:
713
797
 
714
798
  Style/SpaceAroundOperators:
715
799
  Description: 'Use a single space around operators.'
716
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
800
+ StyleGuide: '#spaces-operators'
801
+ Enabled: true
802
+
803
+ Style/SpaceInsideArrayPercentLiteral:
804
+ Description: 'No unnecessary additional spaces between elements in %i/%w literals.'
805
+ Enabled: true
806
+
807
+ Style/SpaceInsidePercentLiteralDelimiters:
808
+ Description: 'No unnecessary spaces inside delimiters of %i/%w/%x literals.'
717
809
  Enabled: true
718
810
 
719
811
  Style/SpaceInsideBrackets:
720
812
  Description: 'No spaces after [ or before ].'
721
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
813
+ StyleGuide: '#no-spaces-braces'
722
814
  Enabled: true
723
815
 
724
816
  Style/SpaceInsideHashLiteralBraces:
725
817
  Description: "Use spaces inside hash literal braces - or don't."
726
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
818
+ StyleGuide: '#spaces-operators'
727
819
  Enabled: true
728
820
 
729
821
  Style/SpaceInsideParens:
730
822
  Description: 'No spaces after ( or before ).'
731
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
823
+ StyleGuide: '#no-spaces-braces'
732
824
  Enabled: true
733
825
 
734
826
  Style/SpaceInsideRangeLiteral:
735
827
  Description: 'No spaces inside range literals.'
736
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-space-inside-range-literals'
828
+ StyleGuide: '#no-space-inside-range-literals'
737
829
  Enabled: true
738
830
 
739
831
  Style/SpaceInsideStringInterpolation:
740
832
  Description: 'Checks for padding/surrounding spaces inside string interpolation.'
741
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#string-interpolation'
833
+ StyleGuide: '#string-interpolation'
742
834
  Enabled: true
743
835
 
744
836
  Style/SpecialGlobalVars:
745
837
  Description: 'Avoid Perl-style global variables.'
746
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms'
838
+ StyleGuide: '#no-cryptic-perlisms'
747
839
  Enabled: true
748
840
 
749
841
  Style/StabbyLambdaParentheses:
750
842
  Description: 'Check for the usage of parentheses around stabby lambda arguments.'
751
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#stabby-lambda-with-args'
843
+ StyleGuide: '#stabby-lambda-with-args'
752
844
  Enabled: true
753
845
 
754
846
  Style/StringLiterals:
755
847
  Description: 'Checks if uses of quotes match the configured preference.'
756
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals'
848
+ StyleGuide: '#consistent-string-literals'
757
849
  Enabled: true
758
850
 
759
851
  Style/StringLiteralsInInterpolation:
@@ -764,7 +856,7 @@ Style/StringLiteralsInInterpolation:
764
856
 
765
857
  Style/StructInheritance:
766
858
  Description: 'Checks for inheritance from Struct.new.'
767
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-extend-struct-new'
859
+ StyleGuide: '#no-extend-struct-new'
768
860
  Enabled: true
769
861
 
770
862
  Style/SymbolLiteral:
@@ -777,39 +869,43 @@ Style/SymbolProc:
777
869
 
778
870
  Style/Tab:
779
871
  Description: 'No hard tabs.'
780
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation'
872
+ StyleGuide: '#spaces-indentation'
873
+ Enabled: true
874
+
875
+ Style/TernaryParentheses:
876
+ Description: 'Checks for use of parentheses around ternary conditions.'
781
877
  Enabled: true
782
878
 
783
879
  Style/TrailingBlankLines:
784
880
  Description: 'Checks trailing blank lines and final newline.'
785
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#newline-eof'
881
+ StyleGuide: '#newline-eof'
786
882
  Enabled: true
787
883
 
788
884
  Style/TrailingCommaInArguments:
789
885
  Description: 'Checks for trailing comma in argument lists.'
790
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
886
+ StyleGuide: '#no-trailing-params-comma'
791
887
  Enabled: true
792
888
 
793
889
  Style/TrailingCommaInLiteral:
794
890
  Description: 'Checks for trailing comma in array and hash literals.'
795
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
891
+ StyleGuide: '#no-trailing-array-commas'
796
892
  Enabled: true
797
893
 
798
894
  Style/TrailingWhitespace:
799
895
  Description: 'Avoid trailing whitespace.'
800
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace'
896
+ StyleGuide: '#no-trailing-whitespace'
801
897
  Enabled: true
802
898
 
803
899
  Style/TrivialAccessors:
804
900
  Description: 'Prefer attr_* methods to trivial readers/writers.'
805
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family'
901
+ StyleGuide: '#attr_family'
806
902
  Enabled: true
807
903
 
808
904
  Style/UnlessElse:
809
905
  Description: >-
810
906
  Do not use unless with else. Rewrite these with the positive
811
907
  case first.
812
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-else-with-unless'
908
+ StyleGuide: '#no-else-with-unless'
813
909
  Enabled: true
814
910
 
815
911
  Style/UnneededCapitalW:
@@ -822,7 +918,7 @@ Style/UnneededInterpolation:
822
918
 
823
919
  Style/UnneededPercentQ:
824
920
  Description: 'Checks for %q/%Q when single quotes or double quotes would do.'
825
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-q'
921
+ StyleGuide: '#percent-q'
826
922
  Enabled: true
827
923
 
828
924
  Style/TrailingUnderscoreVariable:
@@ -836,34 +932,38 @@ Style/VariableInterpolation:
836
932
  Description: >-
837
933
  Don't interpolate global, instance and class variables
838
934
  directly in strings.
839
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#curlies-interpolate'
935
+ StyleGuide: '#curlies-interpolate'
840
936
  Enabled: true
841
937
 
842
938
  Style/VariableName:
843
939
  Description: 'Use the configured style when naming variables.'
844
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars'
940
+ StyleGuide: '#snake-case-symbols-methods-vars'
941
+ Enabled: true
942
+
943
+ Style/VariableNumber:
944
+ Description: 'Use the configured style when numbering variables.'
845
945
  Enabled: true
846
946
 
847
947
  Style/WhenThen:
848
948
  Description: 'Use when x then ... for one-line cases.'
849
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#one-line-cases'
949
+ StyleGuide: '#one-line-cases'
850
950
  Enabled: true
851
951
 
852
952
  Style/WhileUntilDo:
853
953
  Description: 'Checks for redundant do after while or until.'
854
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-multiline-while-do'
954
+ StyleGuide: '#no-multiline-while-do'
855
955
  Enabled: true
856
956
 
857
957
  Style/WhileUntilModifier:
858
958
  Description: >-
859
959
  Favor modifier while/until usage when you have a
860
960
  single-line body.
861
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier'
961
+ StyleGuide: '#while-as-a-modifier'
862
962
  Enabled: true
863
963
 
864
964
  Style/WordArray:
865
965
  Description: 'Use %w or %W for arrays of words.'
866
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w'
966
+ StyleGuide: '#percent-w'
867
967
  Enabled: true
868
968
 
869
969
  Style/ZeroLengthPredicate:
@@ -881,7 +981,7 @@ Metrics/AbcSize:
881
981
 
882
982
  Metrics/BlockNesting:
883
983
  Description: 'Avoid excessive block nesting'
884
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count'
984
+ StyleGuide: '#three-is-the-number-thou-shalt-count'
885
985
  Enabled: true
886
986
 
887
987
  Metrics/ClassLength:
@@ -900,17 +1000,21 @@ Metrics/CyclomaticComplexity:
900
1000
 
901
1001
  Metrics/LineLength:
902
1002
  Description: 'Limit lines to 80 characters.'
903
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
1003
+ StyleGuide: '#80-character-limits'
904
1004
  Enabled: true
905
1005
 
906
1006
  Metrics/MethodLength:
907
1007
  Description: 'Avoid methods longer than 10 lines of code.'
908
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
1008
+ StyleGuide: '#short-methods'
1009
+ Enabled: true
1010
+
1011
+ Metrics/BlockLength:
1012
+ Description: 'Avoid long blocks with many lines.'
909
1013
  Enabled: true
910
1014
 
911
1015
  Metrics/ParameterLists:
912
1016
  Description: 'Avoid parameter lists longer than three or four parameters.'
913
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params'
1017
+ StyleGuide: '#too-many-params'
914
1018
  Enabled: true
915
1019
 
916
1020
  Metrics/PerceivedComplexity:
@@ -926,7 +1030,7 @@ Lint/AmbiguousOperator:
926
1030
  Description: >-
927
1031
  Checks for ambiguous operators in the first argument of a
928
1032
  method invocation without parentheses.
929
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-as-args'
1033
+ StyleGuide: '#method-invocation-parens'
930
1034
  Enabled: true
931
1035
 
932
1036
  Lint/AmbiguousRegexpLiteral:
@@ -937,7 +1041,7 @@ Lint/AmbiguousRegexpLiteral:
937
1041
 
938
1042
  Lint/AssignmentInCondition:
939
1043
  Description: "Don't use assignment in conditions."
940
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition'
1044
+ StyleGuide: '#safe-assignment-in-condition'
941
1045
  Enabled: true
942
1046
 
943
1047
  Lint/BlockAlignment:
@@ -952,7 +1056,7 @@ Lint/ConditionPosition:
952
1056
  Description: >-
953
1057
  Checks for condition placed in a confusing position relative to
954
1058
  the keyword.
955
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
1059
+ StyleGuide: '#same-line-condition'
956
1060
  Enabled: true
957
1061
 
958
1062
  Lint/Debugger:
@@ -967,6 +1071,10 @@ Lint/DeprecatedClassMethods:
967
1071
  Description: 'Check for deprecated class method calls.'
968
1072
  Enabled: true
969
1073
 
1074
+ Lint/DuplicateCaseCondition:
1075
+ Description: 'Do not repeat values in case conditionals.'
1076
+ Enabled: true
1077
+
970
1078
  Lint/DuplicateMethods:
971
1079
  Description: 'Check for duplicate method definitions.'
972
1080
  Enabled: true
@@ -987,10 +1095,18 @@ Lint/EmptyEnsure:
987
1095
  Description: 'Checks for empty ensure block.'
988
1096
  Enabled: true
989
1097
 
1098
+ Lint/EmptyExpression:
1099
+ Description: 'Checks for empty expressions.'
1100
+ Enabled: true
1101
+
990
1102
  Lint/EmptyInterpolation:
991
1103
  Description: 'Checks for empty string interpolation.'
992
1104
  Enabled: true
993
1105
 
1106
+ Lint/EmptyWhen:
1107
+ Description: 'Checks for `when` branches with empty bodies.'
1108
+ Enabled: true
1109
+
994
1110
  Lint/EndAlignment:
995
1111
  Description: 'Align ends correctly.'
996
1112
  Enabled: true
@@ -1001,7 +1117,7 @@ Lint/EndInMethod:
1001
1117
 
1002
1118
  Lint/EnsureReturn:
1003
1119
  Description: 'Do not use return in an ensure block.'
1004
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-return-ensure'
1120
+ StyleGuide: '#no-return-ensure'
1005
1121
  Enabled: true
1006
1122
 
1007
1123
  Lint/Eval:
@@ -1020,7 +1136,7 @@ Lint/FormatParameterMismatch:
1020
1136
 
1021
1137
  Lint/HandleExceptions:
1022
1138
  Description: "Don't suppress exception."
1023
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions'
1139
+ StyleGuide: '#dont-hide-exceptions'
1024
1140
  Enabled: true
1025
1141
 
1026
1142
  Lint/ImplicitStringConcatenation:
@@ -1035,6 +1151,10 @@ Lint/IneffectiveAccessModifier:
1035
1151
  the visibility of a class method, which does not work.
1036
1152
  Enabled: true
1037
1153
 
1154
+ Lint/InheritException:
1155
+ Description: 'Avoid inheriting from the `Exception` class.'
1156
+ Enabled: true
1157
+
1038
1158
  Lint/InvalidCharacterLiteral:
1039
1159
  Description: >-
1040
1160
  Checks for invalid character literals with a non-escaped
@@ -1053,12 +1173,12 @@ Lint/Loop:
1053
1173
  Description: >-
1054
1174
  Use Kernel#loop with break rather than begin/end/until or
1055
1175
  begin/end/while for post-loop tests.
1056
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#loop-with-break'
1176
+ StyleGuide: '#loop-with-break'
1057
1177
  Enabled: true
1058
1178
 
1059
1179
  Lint/NestedMethodDefinition:
1060
1180
  Description: 'Do not use nested method definitions.'
1061
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-methods'
1181
+ StyleGuide: '#no-nested-methods'
1062
1182
  Enabled: true
1063
1183
 
1064
1184
  Lint/NextWithoutAccumulator:
@@ -1075,7 +1195,17 @@ Lint/ParenthesesAsGroupedExpression:
1075
1195
  Description: >-
1076
1196
  Checks for method calls with a space before the opening
1077
1197
  parenthesis.
1078
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
1198
+ StyleGuide: '#parens-no-spaces'
1199
+ Enabled: true
1200
+
1201
+ Lint/PercentStringArray:
1202
+ Description: >-
1203
+ Checks for unwanted commas and quotes in %w/%W literals.
1204
+ Enabled: true
1205
+
1206
+ Lint/PercentSymbolArray:
1207
+ Description: >-
1208
+ Checks for unwanted commas and colons in %i/%I literals.
1079
1209
  Enabled: true
1080
1210
 
1081
1211
  Lint/RandOne:
@@ -1092,7 +1222,13 @@ Lint/RequireParentheses:
1092
1222
 
1093
1223
  Lint/RescueException:
1094
1224
  Description: 'Avoid rescuing the Exception class.'
1095
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-blind-rescues'
1225
+ StyleGuide: '#no-blind-rescues'
1226
+ Enabled: true
1227
+
1228
+ Lint/ShadowedException:
1229
+ Description: >-
1230
+ Avoid rescuing a higher level exception
1231
+ before a lower level exception.
1096
1232
  Enabled: true
1097
1233
 
1098
1234
  Lint/ShadowingOuterLocalVariable:
@@ -1103,13 +1239,17 @@ Lint/ShadowingOuterLocalVariable:
1103
1239
 
1104
1240
  Lint/StringConversionInInterpolation:
1105
1241
  Description: 'Checks for Object#to_s usage in string interpolation.'
1106
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-to-s'
1242
+ StyleGuide: '#no-to-s'
1107
1243
  Enabled: true
1108
1244
 
1109
1245
  Lint/UnderscorePrefixedVariableName:
1110
1246
  Description: 'Do not use prefix `_` for a variable that is used.'
1111
1247
  Enabled: true
1112
1248
 
1249
+ Lint/UnifiedInteger:
1250
+ Description: 'Use Integer instead of Fixnum or Bignum'
1251
+ Enabled: true
1252
+
1113
1253
  Lint/UnneededDisable:
1114
1254
  Description: >-
1115
1255
  Checks for rubocop:disable comments that can be removed.
@@ -1117,14 +1257,18 @@ Lint/UnneededDisable:
1117
1257
  It must be explicitly disabled.
1118
1258
  Enabled: true
1119
1259
 
1260
+ Lint/UnneededSplatExpansion:
1261
+ Description: 'Checks for splat unnecessarily being called on literals'
1262
+ Enabled: true
1263
+
1120
1264
  Lint/UnusedBlockArgument:
1121
1265
  Description: 'Checks for unused block arguments.'
1122
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
1266
+ StyleGuide: '#underscore-unused-vars'
1123
1267
  Enabled: true
1124
1268
 
1125
1269
  Lint/UnusedMethodArgument:
1126
1270
  Description: 'Checks for unused method arguments.'
1127
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
1271
+ StyleGuide: '#underscore-unused-vars'
1128
1272
  Enabled: true
1129
1273
 
1130
1274
  Lint/UnreachableCode:
@@ -1134,10 +1278,11 @@ Lint/UnreachableCode:
1134
1278
  Lint/UselessAccessModifier:
1135
1279
  Description: 'Checks for useless access modifiers.'
1136
1280
  Enabled: true
1281
+ ContextCreatingMethods: []
1137
1282
 
1138
1283
  Lint/UselessAssignment:
1139
1284
  Description: 'Checks for useless assignment to a local variable.'
1140
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
1285
+ StyleGuide: '#underscore-unused-vars'
1141
1286
  Enabled: true
1142
1287
 
1143
1288
  Lint/UselessComparison:
@@ -1203,6 +1348,10 @@ Performance/DoubleStartEndWith:
1203
1348
  Performance/EndWith:
1204
1349
  Description: 'Use `end_with?` instead of a regex match anchored to the end of a string.'
1205
1350
  Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end'
1351
+ # This will change to a new method call which isn't guaranteed to be on the
1352
+ # object. Switching these methods has to be done with knowledge of the types
1353
+ # of the variables which rubocop doesn't have.
1354
+ AutoCorrect: false
1206
1355
  Enabled: true
1207
1356
 
1208
1357
  Performance/FixedSize:
@@ -1226,7 +1375,7 @@ Performance/HashEachMethods:
1226
1375
  Description: >-
1227
1376
  Use `Hash#each_key` and `Hash#each_value` instead of
1228
1377
  `Hash#keys.each` and `Hash#values.each`.
1229
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-each'
1378
+ StyleGuide: '#hash-each'
1230
1379
  Enabled: true
1231
1380
  AutoCorrect: false
1232
1381
 
@@ -1267,7 +1416,7 @@ Performance/ReverseEach:
1267
1416
  Performance/Sample:
1268
1417
  Description: >-
1269
1418
  Use `sample` instead of `shuffle.first`,
1270
- `shuffle.last`, and `shuffle[Fixnum]`.
1419
+ `shuffle.last`, and `shuffle[Integer]`.
1271
1420
  Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
1272
1421
  Enabled: true
1273
1422
 
@@ -1278,9 +1427,17 @@ Performance/Size:
1278
1427
  Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code'
1279
1428
  Enabled: true
1280
1429
 
1430
+ Performance/CompareWithBlock:
1431
+ Description: 'Use `sort_by(&:foo)` instead of `sort_by { |a, b| a.foo <=> b.foo }`.'
1432
+ Enabled: true
1433
+
1281
1434
  Performance/StartWith:
1282
1435
  Description: 'Use `start_with?` instead of a regex match anchored to the beginning of a string.'
1283
1436
  Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end'
1437
+ # This will change to a new method call which isn't guaranteed to be on the
1438
+ # object. Switching these methods has to be done with knowledge of the types
1439
+ # of the variables which rubocop doesn't have.
1440
+ AutoCorrect: false
1284
1441
  Enabled: true
1285
1442
 
1286
1443
  Performance/StringReplacement:
@@ -1311,22 +1468,60 @@ Rails/Delegate:
1311
1468
  Description: 'Prefer delegate method for delegations.'
1312
1469
  Enabled: true
1313
1470
 
1471
+ Rails/DelegateAllowBlank:
1472
+ Description: 'Do not use allow_blank as an option to delegate.'
1473
+ Enabled: true
1474
+
1475
+ Rails/DynamicFindBy:
1476
+ Description: 'Use `find_by` instead of dynamic `find_by_*`.'
1477
+ StyleGuide: 'https://github.com/bbatsov/rails-style-guide#find_by'
1478
+ Enabled: true
1479
+
1480
+ Rails/EnumUniqueness:
1481
+ Description: 'Avoid duplicate integers in hash-syntax `enum` declaration.'
1482
+ Enabled: true
1483
+
1484
+ Rails/Exit:
1485
+ Description: >-
1486
+ Favor `fail`, `break`, `return`, etc. over `exit` in
1487
+ application or library code outside of Rake files to avoid
1488
+ exits during unit testing or running in production.
1489
+ Enabled: true
1490
+
1314
1491
  Rails/FindBy:
1315
1492
  Description: 'Prefer find_by over where.first.'
1493
+ StyleGuide: 'https://github.com/bbatsov/rails-style-guide#find_by'
1316
1494
  Enabled: true
1317
1495
 
1318
1496
  Rails/FindEach:
1319
1497
  Description: 'Prefer all.find_each over all.find.'
1498
+ StyleGuide: 'https://github.com/bbatsov/rails-style-guide#find-each'
1320
1499
  Enabled: true
1321
1500
 
1322
1501
  Rails/HasAndBelongsToMany:
1323
1502
  Description: 'Prefer has_many :through to has_and_belongs_to_many.'
1503
+ StyleGuide: 'https://github.com/bbatsov/rails-style-guide#has-many-through'
1504
+ Enabled: true
1505
+
1506
+ Rails/HttpPositionalArguments:
1507
+ Description: 'Use keyword arguments instead of positional arguments in http method calls.'
1508
+ Enabled: true
1509
+ Include:
1510
+ - 'spec/**/*'
1511
+ - 'test/**/*'
1512
+
1513
+ Rails/NotNullColumn:
1514
+ Description: 'Do not add a NOT NULL column without a default value'
1324
1515
  Enabled: true
1325
1516
 
1326
1517
  Rails/Output:
1327
1518
  Description: 'Checks for calls to puts, print, etc.'
1328
1519
  Enabled: true
1329
1520
 
1521
+ Rails/OutputSafety:
1522
+ Description: 'The use of `html_safe` or `raw` may be a security risk.'
1523
+ Enabled: true
1524
+
1330
1525
  Rails/PluralizationGrammar:
1331
1526
  Description: 'Checks for incorrect grammar when using methods like `3.day.ago`.'
1332
1527
  Enabled: true
@@ -1335,6 +1530,15 @@ Rails/ReadWriteAttribute:
1335
1530
  Description: >-
1336
1531
  Checks for read_attribute(:attr) and
1337
1532
  write_attribute(:attr, val).
1533
+ StyleGuide: 'https://github.com/bbatsov/rails-style-guide#read-attribute'
1534
+ Enabled: true
1535
+
1536
+ Rails/RequestReferer:
1537
+ Description: 'Use consistent syntax for request.referer.'
1538
+ Enabled: true
1539
+
1540
+ Rails/SafeNavigation:
1541
+ Description: "Use Ruby's safe navigation operator (`&.`) instead of `try!`"
1338
1542
  Enabled: true
1339
1543
 
1340
1544
  Rails/ScopeArgs:
@@ -1347,6 +1551,38 @@ Rails/TimeZone:
1347
1551
  Reference: 'http://danilenko.org/2012/7/6/rails_timezones'
1348
1552
  Enabled: true
1349
1553
 
1554
+ Rails/UniqBeforePluck:
1555
+ Description: 'Prefer the use of uniq or distinct before pluck.'
1556
+ Enabled: true
1557
+
1350
1558
  Rails/Validation:
1351
1559
  Description: 'Use validates :attribute, hash of validations.'
1352
1560
  Enabled: true
1561
+
1562
+ Security/JSONLoad:
1563
+ Description: >-
1564
+ Prefer usage of `JSON.parse` over `JSON.load` due to potential
1565
+ security issues. See reference for more information.
1566
+ Reference: 'http://ruby-doc.org/stdlib-2.3.0/libdoc/json/rdoc/JSON.html#method-i-load'
1567
+ Enabled: true
1568
+ # Autocorrect here will change to a method that may cause crashes depending
1569
+ # on the value of the argument.
1570
+ AutoCorrect: false
1571
+
1572
+ ##################### Bundler #############################
1573
+
1574
+ Bundler/DuplicatedGem:
1575
+ Description: 'Checks for duplicate gem entries in Gemfile.'
1576
+ Enabled: true
1577
+ Include:
1578
+ - '**/Gemfile'
1579
+ - '**/gems.rb'
1580
+
1581
+ Bundler/OrderedGems:
1582
+ Description: >-
1583
+ Sort alphabetically gems appearing within a contiguous set
1584
+ of lines in the Gemfile
1585
+ Enabled: true
1586
+ Include:
1587
+ - '**/Gemfile'
1588
+ - '**/gems.rb'