deep_pluck 1.1.0 → 1.1.5

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