multi_range 0.0.2 → 1.2.0

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