chefstyle 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,16 +16,23 @@ Style/AutoResourceCleanup:
16
16
 
17
17
  Style/CollectionMethods:
18
18
  Description: 'Preferred collection methods.'
19
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#map-find-select-reduce-size'
19
+ StyleGuide: '#map-find-select-reduce-size'
20
20
  Enabled: false
21
21
 
22
22
  Style/Copyright:
23
23
  Description: 'Include a copyright notice in each file before any code.'
24
24
  Enabled: false
25
25
 
26
+ Style/DocumentationMethod:
27
+ Description: 'Public methods.'
28
+ Enabled: false
29
+ Exclude:
30
+ - 'spec/**/*'
31
+ - 'test/**/*'
32
+
26
33
  Style/Encoding:
27
34
  Description: 'Use UTF-8 as the source file encoding.'
28
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#utf-8'
35
+ StyleGuide: '#utf-8'
29
36
  Enabled: false
30
37
 
31
38
  Style/FirstArrayElementLineBreak:
@@ -59,12 +66,17 @@ Style/ImplicitRuntimeError:
59
66
  Enabled: false
60
67
 
61
68
  Style/InlineComment:
62
- Description: 'Avoid inline comments.'
69
+ Description: 'Avoid trailing inline comments.'
70
+ Enabled: false
71
+
72
+ Style/MethodCallWithArgsParentheses:
73
+ Description: 'Use parentheses for method calls with arguments.'
74
+ StyleGuide: '#method-invocation-parens'
63
75
  Enabled: false
64
76
 
65
77
  Style/MethodCalledOnDoEndBlock:
66
78
  Description: 'Avoid chaining a method call on a do...end block.'
67
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
79
+ StyleGuide: '#single-line-blocks'
68
80
  Enabled: false
69
81
 
70
82
  Style/MissingElse:
@@ -86,7 +98,7 @@ Style/MissingElse:
86
98
 
87
99
  Style/MultilineAssignmentLayout:
88
100
  Description: 'Check for a newline after the assignment operator in multi-line assignments.'
89
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-conditional-assignment'
101
+ StyleGuide: '#indent-conditional-assignment'
90
102
  Enabled: false
91
103
 
92
104
  Style/OptionHash:
@@ -95,7 +107,7 @@ Style/OptionHash:
95
107
 
96
108
  Style/Send:
97
109
  Description: 'Prefer `Object#__send__` or `Object#public_send` to `send`, as `send` may overlap with existing methods.'
98
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#prefer-public-send'
110
+ StyleGuide: '#prefer-public-send'
99
111
  Enabled: false
100
112
 
101
113
  Style/StringMethods:
@@ -104,5 +116,9 @@ Style/StringMethods:
104
116
 
105
117
  Style/SymbolArray:
106
118
  Description: 'Use %i or %I for arrays of symbols.'
107
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-i'
119
+ StyleGuide: '#percent-i'
120
+ Enabled: false
121
+
122
+ Style/SingleLineBlockParams:
123
+ Description: 'Enforces the names of some block params.'
108
124
  Enabled: false
@@ -2,24 +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: 'https://github.com/bbatsov/ruby-style-guide#accessor_mutator_method_names'
10
+ StyleGuide: '#accessor_mutator_method_names'
11
11
  Enabled: true
12
12
 
13
13
  Style/Alias:
14
14
  Description: 'Use alias instead of alias_method.'
15
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#alias-method'
15
+ StyleGuide: '#alias-method'
16
16
  Enabled: true
17
17
 
18
18
  Style/AlignArray:
19
19
  Description: >-
20
20
  Align the elements of an array literal if they span more than
21
21
  one line.
22
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#align-multiline-arrays'
22
+ StyleGuide: '#align-multiline-arrays'
23
23
  Enabled: true
24
24
 
25
25
  Style/AlignHash:
@@ -32,47 +32,47 @@ Style/AlignParameters:
32
32
  Description: >-
33
33
  Align the parameters of a method call if they span more
34
34
  than one line.
35
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent'
35
+ StyleGuide: '#no-double-indent'
36
36
  Enabled: true
37
37
 
38
38
  Style/AndOr:
39
39
  Description: 'Use &&/|| instead of and/or.'
40
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-and-or-or'
40
+ StyleGuide: '#no-and-or-or'
41
41
  Enabled: true
42
42
 
43
43
  Style/ArrayJoin:
44
44
  Description: 'Use Array#join instead of Array#*.'
45
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#array-join'
45
+ StyleGuide: '#array-join'
46
46
  Enabled: true
47
47
 
48
48
  Style/AsciiComments:
49
49
  Description: 'Use only ascii symbols in comments.'
50
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments'
50
+ StyleGuide: '#english-comments'
51
51
  Enabled: true
52
52
 
53
53
  Style/AsciiIdentifiers:
54
54
  Description: 'Use only ascii symbols in identifiers.'
55
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers'
55
+ StyleGuide: '#english-identifiers'
56
56
  Enabled: true
57
57
 
58
58
  Style/Attr:
59
59
  Description: 'Checks for uses of Module#attr.'
60
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr'
60
+ StyleGuide: '#attr'
61
61
  Enabled: true
62
62
 
63
63
  Style/BeginBlock:
64
64
  Description: 'Avoid the use of BEGIN blocks.'
65
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-BEGIN-blocks'
65
+ StyleGuide: '#no-BEGIN-blocks'
66
66
  Enabled: true
67
67
 
68
68
  Style/BarePercentLiterals:
69
69
  Description: 'Checks if usage of %() or %Q() matches configuration.'
70
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-q-shorthand'
70
+ StyleGuide: '#percent-q-shorthand'
71
71
  Enabled: true
72
72
 
73
73
  Style/BlockComments:
74
74
  Description: 'Do not use block comments.'
75
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-block-comments'
75
+ StyleGuide: '#no-block-comments'
76
76
  Enabled: true
77
77
 
78
78
  Style/BlockEndNewline:
@@ -84,7 +84,7 @@ Style/BlockDelimiters:
84
84
  Avoid using {...} for multi-line blocks (multiline chaining is
85
85
  always ugly).
86
86
  Prefer {...} over do...end for single-line blocks.
87
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
87
+ StyleGuide: '#single-line-blocks'
88
88
  Enabled: true
89
89
 
90
90
  Style/BracesAroundHashParameters:
@@ -93,22 +93,22 @@ Style/BracesAroundHashParameters:
93
93
 
94
94
  Style/CaseEquality:
95
95
  Description: 'Avoid explicit use of the case equality operator(===).'
96
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality'
96
+ StyleGuide: '#no-case-equality'
97
97
  Enabled: true
98
98
 
99
99
  Style/CaseIndentation:
100
100
  Description: 'Indentation of when in a case/when/[else/]end.'
101
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-when-to-case'
101
+ StyleGuide: '#indent-when-to-case'
102
102
  Enabled: true
103
103
 
104
104
  Style/CharacterLiteral:
105
105
  Description: 'Checks for uses of character literals.'
106
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-character-literals'
106
+ StyleGuide: '#no-character-literals'
107
107
  Enabled: true
108
108
 
109
109
  Style/ClassAndModuleCamelCase:
110
110
  Description: 'Use CamelCase for classes and modules.'
111
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#camelcase-classes'
111
+ StyleGuide: '#camelcase-classes'
112
112
  Enabled: true
113
113
 
114
114
  Style/ClassAndModuleChildren:
@@ -121,12 +121,12 @@ Style/ClassCheck:
121
121
 
122
122
  Style/ClassMethods:
123
123
  Description: 'Use self when defining module/class methods.'
124
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#def-self-class-methods'
124
+ StyleGuide: '#def-self-class-methods'
125
125
  Enabled: true
126
126
 
127
127
  Style/ClassVars:
128
128
  Description: 'Avoid the use of class variables.'
129
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars'
129
+ StyleGuide: '#no-class-vars'
130
130
  Enabled: true
131
131
 
132
132
  Style/ClosingParenthesisIndentation:
@@ -135,19 +135,19 @@ Style/ClosingParenthesisIndentation:
135
135
 
136
136
  Style/ColonMethodCall:
137
137
  Description: 'Do not use :: for method call.'
138
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#double-colons'
138
+ StyleGuide: '#double-colons'
139
139
  Enabled: true
140
140
 
141
141
  Style/CommandLiteral:
142
142
  Description: 'Use `` or %x around command literals.'
143
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-x'
143
+ StyleGuide: '#percent-x'
144
144
  Enabled: true
145
145
 
146
146
  Style/CommentAnnotation:
147
147
  Description: >-
148
148
  Checks formatting of special comments
149
149
  (TODO, FIXME, OPTIMIZE, HACK, REVIEW).
150
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#annotate-keywords'
150
+ StyleGuide: '#annotate-keywords'
151
151
  Enabled: true
152
152
 
153
153
  Style/CommentIndentation:
@@ -163,17 +163,12 @@ Style/ConditionalAssignment:
163
163
 
164
164
  Style/ConstantName:
165
165
  Description: 'Constants should use SCREAMING_SNAKE_CASE.'
166
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#screaming-snake-case'
166
+ StyleGuide: '#screaming-snake-case'
167
167
  Enabled: true
168
168
 
169
169
  Style/DefWithParentheses:
170
170
  Description: 'Use def with parentheses when there are arguments.'
171
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens'
172
- Enabled: true
173
-
174
- Style/PreferredHashMethods:
175
- Description: 'Checks use of `has_key?` and `has_value?` Hash methods.'
176
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-key'
171
+ StyleGuide: '#method-parens'
177
172
  Enabled: true
178
173
 
179
174
  Style/Documentation:
@@ -185,12 +180,12 @@ Style/Documentation:
185
180
 
186
181
  Style/DotPosition:
187
182
  Description: 'Checks the position of the dot in multi-line method calls.'
188
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
183
+ StyleGuide: '#consistent-multi-line-chains'
189
184
  Enabled: true
190
185
 
191
186
  Style/DoubleNegation:
192
187
  Description: 'Checks for uses of double negation (!!).'
193
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-bang-bang'
188
+ StyleGuide: '#no-bang-bang'
194
189
  Enabled: true
195
190
 
196
191
  Style/EachForSimpleLoop:
@@ -217,7 +212,7 @@ Style/EmptyCaseCondition:
217
212
 
218
213
  Style/EmptyLineBetweenDefs:
219
214
  Description: 'Use empty lines between defs.'
220
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#empty-lines-between-methods'
215
+ StyleGuide: '#empty-lines-between-methods'
221
216
  Enabled: true
222
217
 
223
218
  Style/EmptyLines:
@@ -246,22 +241,27 @@ Style/EmptyLinesAroundMethodBody:
246
241
 
247
242
  Style/EmptyLiteral:
248
243
  Description: 'Prefer literals to Array.new/Hash.new/String.new.'
249
- 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'
250
250
  Enabled: true
251
251
 
252
252
  Style/EndBlock:
253
253
  Description: 'Avoid the use of END blocks.'
254
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-END-blocks'
254
+ StyleGuide: '#no-END-blocks'
255
255
  Enabled: true
256
256
 
257
257
  Style/EndOfLine:
258
258
  Description: 'Use Unix-style line endings.'
259
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#crlf'
259
+ StyleGuide: '#crlf'
260
260
  Enabled: true
261
261
 
262
262
  Style/EvenOdd:
263
- Description: 'Favor the use of Fixnum#even? && Fixnum#odd?'
264
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
263
+ Description: 'Favor the use of Integer#even? && Integer#odd?'
264
+ StyleGuide: '#predicate-methods'
265
265
  Enabled: true
266
266
 
267
267
  Style/ExtraSpacing:
@@ -270,7 +270,7 @@ Style/ExtraSpacing:
270
270
 
271
271
  Style/FileName:
272
272
  Description: 'Use snake_case for source file names.'
273
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
273
+ StyleGuide: '#snake-case-files'
274
274
  Enabled: true
275
275
 
276
276
  Style/FrozenStringLiteralComment:
@@ -290,35 +290,35 @@ Style/FirstParameterIndentation:
290
290
 
291
291
  Style/FlipFlop:
292
292
  Description: 'Checks for flip flops'
293
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-flip-flops'
293
+ StyleGuide: '#no-flip-flops'
294
294
  Enabled: true
295
295
 
296
296
  Style/For:
297
297
  Description: 'Checks use of for or each in multiline loops.'
298
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-for-loops'
298
+ StyleGuide: '#no-for-loops'
299
299
  Enabled: true
300
300
 
301
301
  Style/FormatString:
302
302
  Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
303
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#sprintf'
303
+ StyleGuide: '#sprintf'
304
304
  Enabled: true
305
305
 
306
306
  Style/GlobalVars:
307
307
  Description: 'Do not introduce global variables.'
308
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#instance-vars'
308
+ StyleGuide: '#instance-vars'
309
309
  Reference: 'http://www.zenspider.com/Languages/Ruby/QuickRef.html'
310
310
  Enabled: true
311
311
 
312
312
  Style/GuardClause:
313
313
  Description: 'Check for conditionals that can be replaced with guard clauses'
314
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
314
+ StyleGuide: '#no-nested-conditionals'
315
315
  Enabled: true
316
316
 
317
317
  Style/HashSyntax:
318
318
  Description: >-
319
319
  Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
320
320
  { :a => 1, :b => 2 }.
321
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-literals'
321
+ StyleGuide: '#hash-literals'
322
322
  Enabled: true
323
323
 
324
324
  Style/IfInsideElse:
@@ -329,7 +329,7 @@ Style/IfUnlessModifier:
329
329
  Description: >-
330
330
  Favor modifier if/unless usage when you have a
331
331
  single-line body.
332
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
332
+ StyleGuide: '#if-as-a-modifier'
333
333
  Enabled: true
334
334
 
335
335
  Style/IfUnlessModifierOfIfUnless:
@@ -339,7 +339,7 @@ Style/IfUnlessModifierOfIfUnless:
339
339
 
340
340
  Style/IfWithSemicolon:
341
341
  Description: 'Do not use if x; .... Use the ternary operator instead.'
342
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs'
342
+ StyleGuide: '#no-semicolon-ifs'
343
343
  Enabled: true
344
344
 
345
345
  Style/IndentationConsistency:
@@ -348,7 +348,7 @@ Style/IndentationConsistency:
348
348
 
349
349
  Style/IndentationWidth:
350
350
  Description: 'Use 2 spaces for indentation.'
351
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation'
351
+ StyleGuide: '#spaces-indentation'
352
352
  Enabled: true
353
353
 
354
354
  Style/IdenticalConditionalBranches:
@@ -376,22 +376,26 @@ Style/IndentHash:
376
376
 
377
377
  Style/InfiniteLoop:
378
378
  Description: 'Use Kernel#loop for infinite loops.'
379
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#infinite-loop'
379
+ StyleGuide: '#infinite-loop'
380
380
  Enabled: true
381
381
 
382
382
  Style/Lambda:
383
383
  Description: 'Use the new lambda literal syntax for single-line blocks.'
384
- 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.'
385
389
  Enabled: true
386
390
 
387
391
  Style/LambdaCall:
388
392
  Description: 'Use lambda.call(...) instead of lambda.(...).'
389
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc-call'
393
+ StyleGuide: '#proc-call'
390
394
  Enabled: true
391
395
 
392
396
  Style/LeadingCommentSpace:
393
397
  Description: 'Comments should start with a space.'
394
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-space'
398
+ StyleGuide: '#hash-space'
395
399
  Enabled: true
396
400
 
397
401
  Style/LineEndConcatenation:
@@ -400,31 +404,31 @@ Style/LineEndConcatenation:
400
404
  line end.
401
405
  Enabled: true
402
406
 
403
- Style/MethodCallParentheses:
407
+ Style/MethodCallWithoutArgsParentheses:
404
408
  Description: 'Do not use parentheses for method calls with no arguments.'
405
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-args-no-parens'
409
+ StyleGuide: '#method-invocation-parens'
406
410
  Enabled: true
407
411
 
408
412
  Style/MethodDefParentheses:
409
413
  Description: >-
410
414
  Checks if the method definitions have or don't have
411
415
  parentheses.
412
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens'
416
+ StyleGuide: '#method-parens'
413
417
  Enabled: true
414
418
 
415
419
  Style/MethodName:
416
420
  Description: 'Use the configured style when naming methods.'
417
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars'
421
+ StyleGuide: '#snake-case-symbols-methods-vars'
418
422
  Enabled: true
419
423
 
420
424
  Style/MethodMissing:
421
425
  Description: 'Avoid using `method_missing`.'
422
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-method-missing'
426
+ StyleGuide: '#no-method-missing'
423
427
  Enabled: true
424
428
 
425
429
  Style/ModuleFunction:
426
430
  Description: 'Checks for usage of `extend self` in modules.'
427
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#module-function'
431
+ StyleGuide: '#module-function'
428
432
  Enabled: true
429
433
 
430
434
  Style/MultilineArrayBraceLayout:
@@ -436,7 +440,7 @@ Style/MultilineArrayBraceLayout:
436
440
 
437
441
  Style/MultilineBlockChain:
438
442
  Description: 'Avoid multi-line chains of blocks.'
439
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
443
+ StyleGuide: '#single-line-blocks'
440
444
  Enabled: true
441
445
 
442
446
  Style/MultilineBlockLayout:
@@ -452,7 +456,16 @@ Style/MultilineHashBraceLayout:
452
456
 
453
457
  Style/MultilineIfThen:
454
458
  Description: 'Do not use then for multi-line if/unless.'
455
- 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.'
456
469
  Enabled: true
457
470
 
458
471
  Style/MultilineMethodCallBraceLayout:
@@ -485,7 +498,7 @@ Style/MultilineTernaryOperator:
485
498
  Description: >-
486
499
  Avoid multi-line ?: (the ternary operator);
487
500
  use if/unless instead.
488
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-multiline-ternary'
501
+ StyleGuide: '#no-multiline-ternary'
489
502
  Enabled: true
490
503
 
491
504
  Style/MutableConstant:
@@ -496,17 +509,17 @@ Style/NegatedIf:
496
509
  Description: >-
497
510
  Favor unless over if for negative conditions
498
511
  (or control flow or).
499
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives'
512
+ StyleGuide: '#unless-for-negatives'
500
513
  Enabled: true
501
514
 
502
515
  Style/NegatedWhile:
503
516
  Description: 'Favor until over while for negative conditions.'
504
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#until-for-negatives'
517
+ StyleGuide: '#until-for-negatives'
505
518
  Enabled: true
506
519
 
507
520
  Style/NestedModifier:
508
521
  Description: 'Avoid using nested modifiers.'
509
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-modifiers'
522
+ StyleGuide: '#no-nested-modifiers'
510
523
  Enabled: true
511
524
 
512
525
  Style/NestedParenthesizedCalls:
@@ -517,64 +530,69 @@ Style/NestedParenthesizedCalls:
517
530
 
518
531
  Style/NestedTernaryOperator:
519
532
  Description: 'Use one expression per branch in a ternary operator.'
520
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-ternary'
533
+ StyleGuide: '#no-nested-ternary'
521
534
  Enabled: true
522
535
 
523
536
  Style/Next:
524
537
  Description: 'Use `next` to skip iteration instead of a condition at the end.'
525
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
538
+ StyleGuide: '#no-nested-conditionals'
526
539
  Enabled: true
527
540
 
528
541
  Style/NilComparison:
529
542
  Description: 'Prefer x.nil? to x == nil.'
530
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
543
+ StyleGuide: '#predicate-methods'
531
544
  Enabled: true
532
545
 
533
546
  Style/NonNilCheck:
534
547
  Description: 'Checks for redundant nil checks.'
535
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-non-nil-checks'
548
+ StyleGuide: '#no-non-nil-checks'
536
549
  Enabled: true
537
550
 
538
551
  Style/Not:
539
552
  Description: 'Use ! instead of not.'
540
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bang-not-not'
553
+ StyleGuide: '#bang-not-not'
541
554
  Enabled: true
542
555
 
543
556
  Style/NumericLiterals:
544
557
  Description: >-
545
558
  Add underscores to large numeric literals to improve their
546
559
  readability.
547
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics'
560
+ StyleGuide: '#underscores-in-numerics'
548
561
  Enabled: true
549
562
 
550
563
  Style/NumericLiteralPrefix:
551
564
  Description: 'Use smallcase prefixes for numeric literals.'
552
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#numeric-literal-prefixes'
565
+ StyleGuide: '#numeric-literal-prefixes'
553
566
  Enabled: true
554
567
 
555
568
  Style/NumericPredicate:
556
569
  Description: >-
557
570
  Checks for the use of predicate- or comparison methods for
558
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
559
577
  Enabled: true
560
578
 
561
579
  Style/OneLineConditional:
562
580
  Description: >-
563
581
  Favor the ternary operator(?:) over
564
582
  if/then/else/end constructs.
565
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator'
583
+ StyleGuide: '#ternary-operator'
566
584
  Enabled: true
567
585
 
568
586
  Style/OpMethod:
569
587
  Description: 'When defining binary operators, name the argument other.'
570
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
588
+ StyleGuide: '#other-arg'
571
589
  Enabled: true
572
590
 
573
591
  Style/OptionalArguments:
574
592
  Description: >-
575
593
  Checks for optional arguments that do not appear at the end
576
594
  of the argument list
577
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#optional-arguments'
595
+ StyleGuide: '#optional-arguments'
578
596
  Enabled: true
579
597
 
580
598
  Style/ParallelAssignment:
@@ -582,19 +600,19 @@ Style/ParallelAssignment:
582
600
  Check for simple usages of parallel assignment.
583
601
  It will only warn when the number of variables
584
602
  matches on both sides of the assignment.
585
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parallel-assignment'
603
+ StyleGuide: '#parallel-assignment'
586
604
  Enabled: true
587
605
 
588
606
  Style/ParenthesesAroundCondition:
589
607
  Description: >-
590
608
  Don't use parentheses around the condition of an
591
609
  if/unless/while.
592
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-parens-if'
610
+ StyleGuide: '#no-parens-around-condition'
593
611
  Enabled: true
594
612
 
595
613
  Style/PercentLiteralDelimiters:
596
614
  Description: 'Use `%`-literal delimiters consistently'
597
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-literal-braces'
615
+ StyleGuide: '#percent-literal-braces'
598
616
  Enabled: true
599
617
 
600
618
  Style/PercentQLiterals:
@@ -603,32 +621,37 @@ Style/PercentQLiterals:
603
621
 
604
622
  Style/PerlBackrefs:
605
623
  Description: 'Avoid Perl-style regex back references.'
606
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
624
+ StyleGuide: '#no-perl-regexp-last-matchers'
607
625
  Enabled: true
608
626
 
609
627
  Style/PredicateName:
610
628
  Description: 'Check the names of predicate methods.'
611
- 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'
612
635
  Enabled: true
613
636
 
614
637
  Style/Proc:
615
638
  Description: 'Use proc instead of Proc.new.'
616
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc'
639
+ StyleGuide: '#proc'
617
640
  Enabled: true
618
641
 
619
642
  Style/RaiseArgs:
620
643
  Description: 'Checks the arguments passed to raise/fail.'
621
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#exception-class-messages'
644
+ StyleGuide: '#exception-class-messages'
622
645
  Enabled: true
623
646
 
624
647
  Style/RedundantBegin:
625
648
  Description: "Don't use begin blocks when they are not needed."
626
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#begin-implicit'
649
+ StyleGuide: '#begin-implicit'
627
650
  Enabled: true
628
651
 
629
652
  Style/RedundantException:
630
653
  Description: "Checks for an obsolete RuntimeException argument in raise/fail."
631
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-runtimeerror'
654
+ StyleGuide: '#no-explicit-runtimeerror'
632
655
  Enabled: true
633
656
 
634
657
  Style/RedundantFreeze:
@@ -641,17 +664,17 @@ Style/RedundantParentheses:
641
664
 
642
665
  Style/RedundantReturn:
643
666
  Description: "Don't use return where it's not required."
644
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-return'
667
+ StyleGuide: '#no-explicit-return'
645
668
  Enabled: true
646
669
 
647
670
  Style/RedundantSelf:
648
671
  Description: "Don't use self where it's not needed."
649
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-self-unless-required'
672
+ StyleGuide: '#no-self-unless-required'
650
673
  Enabled: true
651
674
 
652
675
  Style/RegexpLiteral:
653
676
  Description: 'Use / or %r around regular expressions.'
654
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r'
677
+ StyleGuide: '#percent-r'
655
678
  Enabled: true
656
679
 
657
680
  Style/RescueEnsureAlignment:
@@ -660,34 +683,36 @@ Style/RescueEnsureAlignment:
660
683
 
661
684
  Style/RescueModifier:
662
685
  Description: 'Avoid using rescue in its modifier form.'
663
- 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 (`&.`).
664
694
  Enabled: true
665
695
 
666
696
  Style/SelfAssignment:
667
697
  Description: >-
668
698
  Checks for places where self-assignment shorthand should have
669
699
  been used.
670
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment'
700
+ StyleGuide: '#self-assignment'
671
701
  Enabled: true
672
702
 
673
703
  Style/Semicolon:
674
704
  Description: "Don't use semicolons to terminate expressions."
675
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon'
705
+ StyleGuide: '#no-semicolon'
676
706
  Enabled: true
677
707
 
678
708
  Style/SignalException:
679
709
  Description: 'Checks for proper usage of fail and raise.'
680
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#prefer-raise-over-fail'
681
- Enabled: true
682
-
683
- Style/SingleLineBlockParams:
684
- Description: 'Enforces the names of some block params.'
685
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#reduce-blocks'
710
+ StyleGuide: '#prefer-raise-over-fail'
686
711
  Enabled: true
687
712
 
688
713
  Style/SingleLineMethods:
689
714
  Description: 'Avoid single-line methods.'
690
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-single-line-methods'
715
+ StyleGuide: '#no-single-line-methods'
691
716
  Enabled: true
692
717
 
693
718
  Style/SpaceBeforeFirstArg:
@@ -698,29 +723,29 @@ Style/SpaceBeforeFirstArg:
698
723
 
699
724
  Style/SpaceAfterColon:
700
725
  Description: 'Use spaces after colons.'
701
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
726
+ StyleGuide: '#spaces-operators'
702
727
  Enabled: true
703
728
 
704
729
  Style/SpaceAfterComma:
705
730
  Description: 'Use spaces after commas.'
706
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
731
+ StyleGuide: '#spaces-operators'
707
732
  Enabled: true
708
733
 
709
734
  Style/SpaceAfterMethodName:
710
735
  Description: >-
711
736
  Do not put a space between a method name and the opening
712
737
  parenthesis in a method definition.
713
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
738
+ StyleGuide: '#parens-no-spaces'
714
739
  Enabled: true
715
740
 
716
741
  Style/SpaceAfterNot:
717
742
  Description: Tracks redundant space after the ! operator.
718
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-space-bang'
743
+ StyleGuide: '#no-space-bang'
719
744
  Enabled: true
720
745
 
721
746
  Style/SpaceAfterSemicolon:
722
747
  Description: 'Use spaces after semicolons.'
723
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
748
+ StyleGuide: '#spaces-operators'
724
749
  Enabled: true
725
750
 
726
751
  Style/SpaceBeforeBlockBraces:
@@ -759,7 +784,7 @@ Style/SpaceAroundEqualsInParameterDefault:
759
784
  Checks that the equals signs in parameter default assignments
760
785
  have or don't have surrounding space depending on
761
786
  configuration.
762
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-around-equals'
787
+ StyleGuide: '#spaces-around-equals'
763
788
  Enabled: true
764
789
 
765
790
  Style/SpaceAroundKeyword:
@@ -768,7 +793,7 @@ Style/SpaceAroundKeyword:
768
793
 
769
794
  Style/SpaceAroundOperators:
770
795
  Description: 'Use a single space around operators.'
771
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
796
+ StyleGuide: '#spaces-operators'
772
797
  Enabled: true
773
798
 
774
799
  Style/SpaceInsideArrayPercentLiteral:
@@ -781,42 +806,42 @@ Style/SpaceInsidePercentLiteralDelimiters:
781
806
 
782
807
  Style/SpaceInsideBrackets:
783
808
  Description: 'No spaces after [ or before ].'
784
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
809
+ StyleGuide: '#no-spaces-braces'
785
810
  Enabled: true
786
811
 
787
812
  Style/SpaceInsideHashLiteralBraces:
788
813
  Description: "Use spaces inside hash literal braces - or don't."
789
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
814
+ StyleGuide: '#spaces-operators'
790
815
  Enabled: true
791
816
 
792
817
  Style/SpaceInsideParens:
793
818
  Description: 'No spaces after ( or before ).'
794
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
819
+ StyleGuide: '#no-spaces-braces'
795
820
  Enabled: true
796
821
 
797
822
  Style/SpaceInsideRangeLiteral:
798
823
  Description: 'No spaces inside range literals.'
799
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-space-inside-range-literals'
824
+ StyleGuide: '#no-space-inside-range-literals'
800
825
  Enabled: true
801
826
 
802
827
  Style/SpaceInsideStringInterpolation:
803
828
  Description: 'Checks for padding/surrounding spaces inside string interpolation.'
804
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#string-interpolation'
829
+ StyleGuide: '#string-interpolation'
805
830
  Enabled: true
806
831
 
807
832
  Style/SpecialGlobalVars:
808
833
  Description: 'Avoid Perl-style global variables.'
809
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms'
834
+ StyleGuide: '#no-cryptic-perlisms'
810
835
  Enabled: true
811
836
 
812
837
  Style/StabbyLambdaParentheses:
813
838
  Description: 'Check for the usage of parentheses around stabby lambda arguments.'
814
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#stabby-lambda-with-args'
839
+ StyleGuide: '#stabby-lambda-with-args'
815
840
  Enabled: true
816
841
 
817
842
  Style/StringLiterals:
818
843
  Description: 'Checks if uses of quotes match the configured preference.'
819
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals'
844
+ StyleGuide: '#consistent-string-literals'
820
845
  Enabled: true
821
846
 
822
847
  Style/StringLiteralsInInterpolation:
@@ -827,7 +852,7 @@ Style/StringLiteralsInInterpolation:
827
852
 
828
853
  Style/StructInheritance:
829
854
  Description: 'Checks for inheritance from Struct.new.'
830
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-extend-struct-new'
855
+ StyleGuide: '#no-extend-struct-new'
831
856
  Enabled: true
832
857
 
833
858
  Style/SymbolLiteral:
@@ -840,7 +865,7 @@ Style/SymbolProc:
840
865
 
841
866
  Style/Tab:
842
867
  Description: 'No hard tabs.'
843
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation'
868
+ StyleGuide: '#spaces-indentation'
844
869
  Enabled: true
845
870
 
846
871
  Style/TernaryParentheses:
@@ -849,34 +874,34 @@ Style/TernaryParentheses:
849
874
 
850
875
  Style/TrailingBlankLines:
851
876
  Description: 'Checks trailing blank lines and final newline.'
852
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#newline-eof'
877
+ StyleGuide: '#newline-eof'
853
878
  Enabled: true
854
879
 
855
880
  Style/TrailingCommaInArguments:
856
881
  Description: 'Checks for trailing comma in argument lists.'
857
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-params-comma'
882
+ StyleGuide: '#no-trailing-params-comma'
858
883
  Enabled: true
859
884
 
860
885
  Style/TrailingCommaInLiteral:
861
886
  Description: 'Checks for trailing comma in array and hash literals.'
862
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
887
+ StyleGuide: '#no-trailing-array-commas'
863
888
  Enabled: true
864
889
 
865
890
  Style/TrailingWhitespace:
866
891
  Description: 'Avoid trailing whitespace.'
867
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace'
892
+ StyleGuide: '#no-trailing-whitespace'
868
893
  Enabled: true
869
894
 
870
895
  Style/TrivialAccessors:
871
896
  Description: 'Prefer attr_* methods to trivial readers/writers.'
872
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family'
897
+ StyleGuide: '#attr_family'
873
898
  Enabled: true
874
899
 
875
900
  Style/UnlessElse:
876
901
  Description: >-
877
902
  Do not use unless with else. Rewrite these with the positive
878
903
  case first.
879
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-else-with-unless'
904
+ StyleGuide: '#no-else-with-unless'
880
905
  Enabled: true
881
906
 
882
907
  Style/UnneededCapitalW:
@@ -889,7 +914,7 @@ Style/UnneededInterpolation:
889
914
 
890
915
  Style/UnneededPercentQ:
891
916
  Description: 'Checks for %q/%Q when single quotes or double quotes would do.'
892
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-q'
917
+ StyleGuide: '#percent-q'
893
918
  Enabled: true
894
919
 
895
920
  Style/TrailingUnderscoreVariable:
@@ -903,34 +928,38 @@ Style/VariableInterpolation:
903
928
  Description: >-
904
929
  Don't interpolate global, instance and class variables
905
930
  directly in strings.
906
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#curlies-interpolate'
931
+ StyleGuide: '#curlies-interpolate'
907
932
  Enabled: true
908
933
 
909
934
  Style/VariableName:
910
935
  Description: 'Use the configured style when naming variables.'
911
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars'
936
+ StyleGuide: '#snake-case-symbols-methods-vars'
937
+ Enabled: true
938
+
939
+ Style/VariableNumber:
940
+ Description: 'Use the configured style when numbering variables.'
912
941
  Enabled: true
913
942
 
914
943
  Style/WhenThen:
915
944
  Description: 'Use when x then ... for one-line cases.'
916
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#one-line-cases'
945
+ StyleGuide: '#one-line-cases'
917
946
  Enabled: true
918
947
 
919
948
  Style/WhileUntilDo:
920
949
  Description: 'Checks for redundant do after while or until.'
921
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-multiline-while-do'
950
+ StyleGuide: '#no-multiline-while-do'
922
951
  Enabled: true
923
952
 
924
953
  Style/WhileUntilModifier:
925
954
  Description: >-
926
955
  Favor modifier while/until usage when you have a
927
956
  single-line body.
928
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier'
957
+ StyleGuide: '#while-as-a-modifier'
929
958
  Enabled: true
930
959
 
931
960
  Style/WordArray:
932
961
  Description: 'Use %w or %W for arrays of words.'
933
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w'
962
+ StyleGuide: '#percent-w'
934
963
  Enabled: true
935
964
 
936
965
  Style/ZeroLengthPredicate:
@@ -948,7 +977,7 @@ Metrics/AbcSize:
948
977
 
949
978
  Metrics/BlockNesting:
950
979
  Description: 'Avoid excessive block nesting'
951
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count'
980
+ StyleGuide: '#three-is-the-number-thou-shalt-count'
952
981
  Enabled: true
953
982
 
954
983
  Metrics/ClassLength:
@@ -967,17 +996,21 @@ Metrics/CyclomaticComplexity:
967
996
 
968
997
  Metrics/LineLength:
969
998
  Description: 'Limit lines to 80 characters.'
970
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
999
+ StyleGuide: '#80-character-limits'
971
1000
  Enabled: true
972
1001
 
973
1002
  Metrics/MethodLength:
974
1003
  Description: 'Avoid methods longer than 10 lines of code.'
975
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
1004
+ StyleGuide: '#short-methods'
1005
+ Enabled: true
1006
+
1007
+ Metrics/BlockLength:
1008
+ Description: 'Avoid long blocks with many lines.'
976
1009
  Enabled: true
977
1010
 
978
1011
  Metrics/ParameterLists:
979
1012
  Description: 'Avoid parameter lists longer than three or four parameters.'
980
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params'
1013
+ StyleGuide: '#too-many-params'
981
1014
  Enabled: true
982
1015
 
983
1016
  Metrics/PerceivedComplexity:
@@ -993,7 +1026,7 @@ Lint/AmbiguousOperator:
993
1026
  Description: >-
994
1027
  Checks for ambiguous operators in the first argument of a
995
1028
  method invocation without parentheses.
996
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-as-args'
1029
+ StyleGuide: '#method-invocation-parens'
997
1030
  Enabled: true
998
1031
 
999
1032
  Lint/AmbiguousRegexpLiteral:
@@ -1004,7 +1037,7 @@ Lint/AmbiguousRegexpLiteral:
1004
1037
 
1005
1038
  Lint/AssignmentInCondition:
1006
1039
  Description: "Don't use assignment in conditions."
1007
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition'
1040
+ StyleGuide: '#safe-assignment-in-condition'
1008
1041
  Enabled: true
1009
1042
 
1010
1043
  Lint/BlockAlignment:
@@ -1019,7 +1052,7 @@ Lint/ConditionPosition:
1019
1052
  Description: >-
1020
1053
  Checks for condition placed in a confusing position relative to
1021
1054
  the keyword.
1022
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
1055
+ StyleGuide: '#same-line-condition'
1023
1056
  Enabled: true
1024
1057
 
1025
1058
  Lint/Debugger:
@@ -1034,6 +1067,10 @@ Lint/DeprecatedClassMethods:
1034
1067
  Description: 'Check for deprecated class method calls.'
1035
1068
  Enabled: true
1036
1069
 
1070
+ Lint/DuplicateCaseCondition:
1071
+ Description: 'Do not repeat values in case conditionals.'
1072
+ Enabled: true
1073
+
1037
1074
  Lint/DuplicateMethods:
1038
1075
  Description: 'Check for duplicate method definitions.'
1039
1076
  Enabled: true
@@ -1054,10 +1091,18 @@ Lint/EmptyEnsure:
1054
1091
  Description: 'Checks for empty ensure block.'
1055
1092
  Enabled: true
1056
1093
 
1094
+ Lint/EmptyExpression:
1095
+ Description: 'Checks for empty expressions.'
1096
+ Enabled: true
1097
+
1057
1098
  Lint/EmptyInterpolation:
1058
1099
  Description: 'Checks for empty string interpolation.'
1059
1100
  Enabled: true
1060
1101
 
1102
+ Lint/EmptyWhen:
1103
+ Description: 'Checks for `when` branches with empty bodies.'
1104
+ Enabled: true
1105
+
1061
1106
  Lint/EndAlignment:
1062
1107
  Description: 'Align ends correctly.'
1063
1108
  Enabled: true
@@ -1068,11 +1113,7 @@ Lint/EndInMethod:
1068
1113
 
1069
1114
  Lint/EnsureReturn:
1070
1115
  Description: 'Do not use return in an ensure block.'
1071
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-return-ensure'
1072
- Enabled: true
1073
-
1074
- Lint/Eval:
1075
- Description: 'The use of eval represents a serious security risk.'
1116
+ StyleGuide: '#no-return-ensure'
1076
1117
  Enabled: true
1077
1118
 
1078
1119
  Lint/FloatOutOfRange:
@@ -1087,7 +1128,7 @@ Lint/FormatParameterMismatch:
1087
1128
 
1088
1129
  Lint/HandleExceptions:
1089
1130
  Description: "Don't suppress exception."
1090
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions'
1131
+ StyleGuide: '#dont-hide-exceptions'
1091
1132
  Enabled: true
1092
1133
 
1093
1134
  Lint/ImplicitStringConcatenation:
@@ -1124,12 +1165,16 @@ Lint/Loop:
1124
1165
  Description: >-
1125
1166
  Use Kernel#loop with break rather than begin/end/until or
1126
1167
  begin/end/while for post-loop tests.
1127
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#loop-with-break'
1168
+ StyleGuide: '#loop-with-break'
1169
+ Enabled: true
1170
+
1171
+ Lint/MultipleCompare:
1172
+ Description: "Use `&&` operator to compare multiple value."
1128
1173
  Enabled: true
1129
1174
 
1130
1175
  Lint/NestedMethodDefinition:
1131
1176
  Description: 'Do not use nested method definitions.'
1132
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-methods'
1177
+ StyleGuide: '#no-nested-methods'
1133
1178
  Enabled: true
1134
1179
 
1135
1180
  Lint/NextWithoutAccumulator:
@@ -1146,7 +1191,7 @@ Lint/ParenthesesAsGroupedExpression:
1146
1191
  Description: >-
1147
1192
  Checks for method calls with a space before the opening
1148
1193
  parenthesis.
1149
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
1194
+ StyleGuide: '#parens-no-spaces'
1150
1195
  Enabled: true
1151
1196
 
1152
1197
  Lint/PercentStringArray:
@@ -1173,7 +1218,11 @@ Lint/RequireParentheses:
1173
1218
 
1174
1219
  Lint/RescueException:
1175
1220
  Description: 'Avoid rescuing the Exception class.'
1176
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-blind-rescues'
1221
+ StyleGuide: '#no-blind-rescues'
1222
+ Enabled: true
1223
+
1224
+ Lint/SafeNavigationChain:
1225
+ Description: 'Do not chain ordinary method call after safe navigation operator.'
1177
1226
  Enabled: true
1178
1227
 
1179
1228
  Lint/ShadowedException:
@@ -1190,13 +1239,17 @@ Lint/ShadowingOuterLocalVariable:
1190
1239
 
1191
1240
  Lint/StringConversionInInterpolation:
1192
1241
  Description: 'Checks for Object#to_s usage in string interpolation.'
1193
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-to-s'
1242
+ StyleGuide: '#no-to-s'
1194
1243
  Enabled: true
1195
1244
 
1196
1245
  Lint/UnderscorePrefixedVariableName:
1197
1246
  Description: 'Do not use prefix `_` for a variable that is used.'
1198
1247
  Enabled: true
1199
1248
 
1249
+ Lint/UnifiedInteger:
1250
+ Description: 'Use Integer instead of Fixnum or Bignum'
1251
+ Enabled: true
1252
+
1200
1253
  Lint/UnneededDisable:
1201
1254
  Description: >-
1202
1255
  Checks for rubocop:disable comments that can be removed.
@@ -1204,14 +1257,18 @@ Lint/UnneededDisable:
1204
1257
  It must be explicitly disabled.
1205
1258
  Enabled: true
1206
1259
 
1260
+ Lint/UnneededSplatExpansion:
1261
+ Description: 'Checks for splat unnecessarily being called on literals'
1262
+ Enabled: true
1263
+
1207
1264
  Lint/UnusedBlockArgument:
1208
1265
  Description: 'Checks for unused block arguments.'
1209
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
1266
+ StyleGuide: '#underscore-unused-vars'
1210
1267
  Enabled: true
1211
1268
 
1212
1269
  Lint/UnusedMethodArgument:
1213
1270
  Description: 'Checks for unused method arguments.'
1214
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
1271
+ StyleGuide: '#underscore-unused-vars'
1215
1272
  Enabled: true
1216
1273
 
1217
1274
  Lint/UnreachableCode:
@@ -1222,14 +1279,11 @@ Lint/UselessAccessModifier:
1222
1279
  Description: 'Checks for useless access modifiers.'
1223
1280
  Enabled: true
1224
1281
  ContextCreatingMethods: []
1225
-
1226
- Lint/UselessArraySplat:
1227
- Description: 'Checks for useless array splats.'
1228
- Enabled: true
1282
+ MethodCreatingMethods: []
1229
1283
 
1230
1284
  Lint/UselessAssignment:
1231
1285
  Description: 'Checks for useless assignment to a local variable.'
1232
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
1286
+ StyleGuide: '#underscore-unused-vars'
1233
1287
  Enabled: true
1234
1288
 
1235
1289
  Lint/UselessComparison:
@@ -1295,6 +1349,10 @@ Performance/DoubleStartEndWith:
1295
1349
  Performance/EndWith:
1296
1350
  Description: 'Use `end_with?` instead of a regex match anchored to the end of a string.'
1297
1351
  Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end'
1352
+ # This will change to a new method call which isn't guaranteed to be on the
1353
+ # object. Switching these methods has to be done with knowledge of the types
1354
+ # of the variables which rubocop doesn't have.
1355
+ AutoCorrect: false
1298
1356
  Enabled: true
1299
1357
 
1300
1358
  Performance/FixedSize:
@@ -1318,7 +1376,7 @@ Performance/HashEachMethods:
1318
1376
  Description: >-
1319
1377
  Use `Hash#each_key` and `Hash#each_value` instead of
1320
1378
  `Hash#keys.each` and `Hash#values.each`.
1321
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-each'
1379
+ StyleGuide: '#hash-each'
1322
1380
  Enabled: true
1323
1381
  AutoCorrect: false
1324
1382
 
@@ -1326,10 +1384,6 @@ Performance/LstripRstrip:
1326
1384
  Description: 'Use `strip` instead of `lstrip.rstrip`.'
1327
1385
  Enabled: true
1328
1386
 
1329
- Performance/PushSplat:
1330
- Description: 'Use `concat` instead of `push(*)`.'
1331
- Enabled: true
1332
-
1333
1387
  Performance/RangeInclude:
1334
1388
  Description: 'Use `Range#cover?` instead of `Range#include?`.'
1335
1389
  Reference: 'https://github.com/JuanitoFatas/fast-ruby#cover-vs-include-code'
@@ -1355,6 +1409,10 @@ Performance/RedundantSortBy:
1355
1409
  Description: 'Use `sort` instead of `sort_by { |x| x }`.'
1356
1410
  Enabled: true
1357
1411
 
1412
+ Performance/RegexpMatch:
1413
+ Description: 'Use `match?` instead of `Regexp#match`, `String#match`, `Symbol#match`, `Regexp#===` or `=~` when `MatchData` is not used.'
1414
+ Enabled: true
1415
+
1358
1416
  Performance/ReverseEach:
1359
1417
  Description: 'Use `reverse_each` instead of `reverse.each`.'
1360
1418
  Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code'
@@ -1363,7 +1421,7 @@ Performance/ReverseEach:
1363
1421
  Performance/Sample:
1364
1422
  Description: >-
1365
1423
  Use `sample` instead of `shuffle.first`,
1366
- `shuffle.last`, and `shuffle[Fixnum]`.
1424
+ `shuffle.last`, and `shuffle[Integer]`.
1367
1425
  Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
1368
1426
  Enabled: true
1369
1427
 
@@ -1374,9 +1432,17 @@ Performance/Size:
1374
1432
  Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code'
1375
1433
  Enabled: true
1376
1434
 
1435
+ Performance/CompareWithBlock:
1436
+ Description: 'Use `sort_by(&:foo)` instead of `sort_by { |a, b| a.foo <=> b.foo }`.'
1437
+ Enabled: true
1438
+
1377
1439
  Performance/StartWith:
1378
1440
  Description: 'Use `start_with?` instead of a regex match anchored to the beginning of a string.'
1379
1441
  Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end'
1442
+ # This will change to a new method call which isn't guaranteed to be on the
1443
+ # object. Switching these methods has to be done with knowledge of the types
1444
+ # of the variables which rubocop doesn't have.
1445
+ AutoCorrect: false
1380
1446
  Enabled: true
1381
1447
 
1382
1448
  Performance/StringReplacement:
@@ -1407,6 +1473,19 @@ Rails/Delegate:
1407
1473
  Description: 'Prefer delegate method for delegations.'
1408
1474
  Enabled: true
1409
1475
 
1476
+ Rails/DelegateAllowBlank:
1477
+ Description: 'Do not use allow_blank as an option to delegate.'
1478
+ Enabled: true
1479
+
1480
+ Rails/DynamicFindBy:
1481
+ Description: 'Use `find_by` instead of dynamic `find_by_*`.'
1482
+ StyleGuide: 'https://github.com/bbatsov/rails-style-guide#find_by'
1483
+ Enabled: true
1484
+
1485
+ Rails/EnumUniqueness:
1486
+ Description: 'Avoid duplicate integers in hash-syntax `enum` declaration.'
1487
+ Enabled: true
1488
+
1410
1489
  Rails/Exit:
1411
1490
  Description: >-
1412
1491
  Favor `fail`, `break`, `return`, etc. over `exit` in
@@ -1414,6 +1493,10 @@ Rails/Exit:
1414
1493
  exits during unit testing or running in production.
1415
1494
  Enabled: true
1416
1495
 
1496
+ Rails/FilePath:
1497
+ Description: 'Use `Rails.root.join` for file path joining.'
1498
+ Enabled: true
1499
+
1417
1500
  Rails/FindBy:
1418
1501
  Description: 'Prefer find_by over where.first.'
1419
1502
  StyleGuide: 'https://github.com/bbatsov/rails-style-guide#find_by'
@@ -1429,6 +1512,17 @@ Rails/HasAndBelongsToMany:
1429
1512
  StyleGuide: 'https://github.com/bbatsov/rails-style-guide#has-many-through'
1430
1513
  Enabled: true
1431
1514
 
1515
+ Rails/HttpPositionalArguments:
1516
+ Description: 'Use keyword arguments instead of positional arguments in http method calls.'
1517
+ Enabled: true
1518
+ Include:
1519
+ - 'spec/**/*'
1520
+ - 'test/**/*'
1521
+
1522
+ Rails/NotNullColumn:
1523
+ Description: 'Do not add a NOT NULL column without a default value'
1524
+ Enabled: true
1525
+
1432
1526
  Rails/Output:
1433
1527
  Description: 'Checks for calls to puts, print, etc.'
1434
1528
  Enabled: true
@@ -1452,6 +1546,16 @@ Rails/RequestReferer:
1452
1546
  Description: 'Use consistent syntax for request.referer.'
1453
1547
  Enabled: true
1454
1548
 
1549
+ Rails/ReversibleMigration:
1550
+ Description: 'Checks whether the change method of the migration file is reversible.'
1551
+ StyleGuide: 'https://github.com/bbatsov/rails-style-guide#reversible-migration'
1552
+ Reference: 'http://api.rubyonrails.org/classes/ActiveRecord/Migration/CommandRecorder.html'
1553
+ Enabled: true
1554
+
1555
+ Rails/SafeNavigation:
1556
+ Description: "Use Ruby's safe navigation operator (`&.`) instead of `try!`"
1557
+ Enabled: true
1558
+
1455
1559
  Rails/ScopeArgs:
1456
1560
  Description: 'Checks the arguments of ActiveRecord scopes.'
1457
1561
  Enabled: true
@@ -1466,6 +1570,59 @@ Rails/UniqBeforePluck:
1466
1570
  Description: 'Prefer the use of uniq or distinct before pluck.'
1467
1571
  Enabled: true
1468
1572
 
1573
+ Rails/SkipsModelValidations:
1574
+ Description: >-
1575
+ Use methods that skips model validations with caution.
1576
+ See reference for more information.
1577
+ Reference: 'http://guides.rubyonrails.org/active_record_validations.html#skipping-validations'
1578
+ Enabled: true
1579
+
1469
1580
  Rails/Validation:
1470
1581
  Description: 'Use validates :attribute, hash of validations.'
1471
1582
  Enabled: true
1583
+
1584
+ Security/Eval:
1585
+ Description: 'The use of eval represents a serious security risk.'
1586
+ Enabled: true
1587
+
1588
+ Security/JSONLoad:
1589
+ Description: >-
1590
+ Prefer usage of `JSON.parse` over `JSON.load` due to potential
1591
+ security issues. See reference for more information.
1592
+ Reference: 'http://ruby-doc.org/stdlib-2.3.0/libdoc/json/rdoc/JSON.html#method-i-load'
1593
+ Enabled: true
1594
+ # Autocorrect here will change to a method that may cause crashes depending
1595
+ # on the value of the argument.
1596
+ AutoCorrect: false
1597
+
1598
+ Security/MarshalLoad:
1599
+ Description: >-
1600
+ Avoid using of `Marshal.load` or `Marshal.restore` due to potential
1601
+ security issues. See reference for more information.
1602
+ Reference: 'http://ruby-doc.org/core-2.3.3/Marshal.html#module-Marshal-label-Security+considerations'
1603
+ Enabled: true
1604
+
1605
+ Security/YAMLLoad:
1606
+ Description: >-
1607
+ Prefer usage of `YAML.safe_load` over `YAML.load` due to potential
1608
+ security issues. See reference for more information.
1609
+ Reference: 'https://ruby-doc.org/stdlib-2.3.3/libdoc/yaml/rdoc/YAML.html#module-YAML-label-Security'
1610
+ Enabled: true
1611
+
1612
+ ##################### Bundler #############################
1613
+
1614
+ Bundler/DuplicatedGem:
1615
+ Description: 'Checks for duplicate gem entries in Gemfile.'
1616
+ Enabled: true
1617
+ Include:
1618
+ - '**/Gemfile'
1619
+ - '**/gems.rb'
1620
+
1621
+ Bundler/OrderedGems:
1622
+ Description: >-
1623
+ Sort alphabetically gems appearing within a contiguous set
1624
+ of lines in the Gemfile
1625
+ Enabled: true
1626
+ Include:
1627
+ - '**/Gemfile'
1628
+ - '**/gems.rb'