multi_range 0.0.3 → 0.0.4

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