webhookr 0.2.0 → 0.3.0

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