elastic-app-search 0.7.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3c263dbb3b01b9822aa74c538a14e2c46c7f227e
4
+ data.tar.gz: 0b8a9a96f0b802fd48c6fd6e0f9ed28c7bc2f738
5
+ SHA512:
6
+ metadata.gz: 6781841178891c52afee16c6ade751a0f81bf2c153df1027010efd2350ec518a703688c566f836da0c577c4382321435e419fe7cf08adfd704f23d8da2f757ff
7
+ data.tar.gz: cec6394c61716f08273aee6249e852d3467310782b0bc22c01bbf07bef8e551f52b35f408211f3f8f55dccb86c5413ae3f5011c7fb8a18de074ad4dfb34c3656
@@ -0,0 +1,56 @@
1
+ # Ruby CircleCI 2.0 configuration file
2
+ #
3
+ # Check https://circleci.com/docs/2.0/language-ruby/ for more details
4
+ #
5
+ version: 2
6
+ jobs:
7
+ build:
8
+ docker:
9
+ # specify the version you desire here
10
+ - image: circleci/ruby:2.4.1-node-browsers
11
+
12
+ # Specify service dependencies here if necessary
13
+ # CircleCI maintains a library of pre-built images
14
+ # documented at https://circleci.com/docs/2.0/circleci-images/
15
+ # - image: circleci/postgres:9.4
16
+
17
+ working_directory: ~/repo
18
+
19
+ steps:
20
+ - checkout
21
+
22
+ # Download and cache dependencies
23
+ - restore_cache:
24
+ keys:
25
+ - v1-dependencies-{{ checksum "Gemfile" }}
26
+ # fallback to using the latest cache if no exact match is found
27
+ - v1-dependencies-
28
+
29
+ - run:
30
+ name: install dependencies
31
+ command: |
32
+ bundle install --jobs=4 --retry=3 --path vendor/bundle
33
+
34
+ - save_cache:
35
+ paths:
36
+ - ./vendor/bundle
37
+ key: v1-dependencies-{{ checksum "Gemfile" }}
38
+
39
+ # run tests!
40
+ - run:
41
+ name: run tests
42
+ command: |
43
+ mkdir /tmp/test-results
44
+ TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)"
45
+
46
+ bundle exec rspec --format progress \
47
+ --out /tmp/test-results/rspec.xml \
48
+ --format progress \
49
+ $TEST_FILES
50
+
51
+ # collect reports
52
+ - store_test_results:
53
+ path: /tmp/test-results
54
+ - store_artifacts:
55
+ path: /tmp/test-results
56
+ destination: test-results
data/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
5
+ .DS_Store
6
+ .rvmrc
7
+ .ruby-version
8
+ .ruby-gemset
9
+ .yardoc
10
+ doc
data/.rspec ADDED
@@ -0,0 +1,4 @@
1
+ --format documentation
2
+ --color
3
+ --profile
4
+ -r spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,1416 @@
1
+ AllCops:
2
+ DisabledByDefault: true
3
+
4
+ ######################### Layout ###########################
5
+
6
+ Layout/AccessModifierIndentation:
7
+ Description: Check indentation of private/protected visibility modifiers.
8
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-public-private-protected'
9
+ Enabled: false
10
+
11
+ Layout/AlignArray:
12
+ Description: >-
13
+ Align the elements of an array literal if they span more than
14
+ one line.
15
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#align-multiline-arrays'
16
+ Enabled: true
17
+
18
+ Layout/AlignHash:
19
+ Description: >-
20
+ Align the elements of a hash literal if they span more than
21
+ one line.
22
+ Enabled: true
23
+
24
+ Layout/AlignParameters:
25
+ Description: >-
26
+ Align the parameters of a method call if they span more
27
+ than one line.
28
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent'
29
+ Enabled: true
30
+
31
+ Layout/BlockEndNewline:
32
+ Description: 'Put end statement of multiline block on its own line.'
33
+ Enabled: true
34
+
35
+ Layout/CaseIndentation:
36
+ Description: 'Indentation of when in a case/when/[else/]end.'
37
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-when-to-case'
38
+ EnforcedStyle: end
39
+ Enabled: true
40
+
41
+ Layout/ClosingParenthesisIndentation:
42
+ Description: 'Checks the indentation of hanging closing parentheses.'
43
+ Enabled: true
44
+
45
+ Layout/CommentIndentation:
46
+ Description: 'Indentation of comments.'
47
+ Enabled: true
48
+
49
+ Layout/DotPosition:
50
+ Description: 'Checks the position of the dot in multi-line method calls.'
51
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
52
+ EnforcedStyle: leading
53
+ Enabled: true
54
+
55
+ Layout/ElseAlignment:
56
+ Description: 'Align elses and elsifs correctly.'
57
+ Enabled: true
58
+
59
+ Layout/EmptyLineBetweenDefs:
60
+ Description: 'Use empty lines between defs.'
61
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#empty-lines-between-methods'
62
+ Enabled: true
63
+
64
+ Layout/EmptyLines:
65
+ Description: 'Do not use several empty lines in a row.'
66
+ Enabled: true
67
+
68
+ Layout/EmptyLinesAroundAccessModifier:
69
+ Description: 'Keep blank lines around access modifiers.'
70
+ Enabled: true
71
+
72
+ Layout/EmptyLinesAroundArguments:
73
+ Description: 'Checks if empty lines exist around the arguments of a method invocation.'
74
+ Enabled: true
75
+
76
+ Layout/EmptyLinesAroundBlockBody:
77
+ Description: 'Keeps track of empty lines around block bodies.'
78
+ EnforcedStyle: no_empty_lines
79
+ Enabled: true
80
+
81
+ Layout/EmptyLinesAroundClassBody:
82
+ Description: 'Keeps track of empty lines around class bodies.'
83
+ Enabled: false
84
+
85
+ Layout/EmptyLinesAroundExceptionHandlingKeywords:
86
+ Description: 'Checks if empty lines exist around the bodies of `begin` sections. Does not check empty lines at `begin` body beginning/end and around method definition body.'
87
+ Enabled: true
88
+
89
+ Layout/EmptyLinesAroundMethodBody:
90
+ Description: 'Keeps track of empty lines around method bodies.'
91
+ Enabled: true
92
+
93
+ Layout/EmptyLinesAroundModuleBody:
94
+ Description: 'Keeps track of empty lines around module bodies.'
95
+ Enabled: false
96
+
97
+ Layout/EndOfLine:
98
+ Description: 'Use Unix-style line endings.'
99
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#crlf'
100
+ Enabled: true
101
+
102
+ Layout/ExtraSpacing:
103
+ Description: 'Do not use unnecessary spacing.'
104
+ Enabled: true
105
+
106
+ Layout/FirstArrayElementLineBreak:
107
+ Description: 'Checks for a line break before the first element in a multi-line array. @ahoey: Halle-fucking-lujah.'
108
+ Enabled: true
109
+
110
+ Layout/FirstHashElementLineBreak:
111
+ Description: 'Checks for a line break before the first element in a multi-line hash.'
112
+ Enabled: true
113
+
114
+ Layout/FirstMethodArgumentLineBreak:
115
+ Description: 'Checks for a line break before the first argument in a multi-line method call.'
116
+ Enabled: true
117
+
118
+ Layout/FirstMethodParameterLineBreak:
119
+ Description: 'Checks for a line break before the first parameter in a mult-line method parameter definition.'
120
+ Enabled: true
121
+
122
+ Layout/FirstParameterIndentation:
123
+ Description: 'Checks the indentation of the first parameter in a method call.'
124
+ EnforcedStyle: consistent
125
+ Enabled: true
126
+
127
+ Layout/IndentArray:
128
+ Description: >-
129
+ Checks the indentation of the first element in an array
130
+ literal.
131
+ EnforcedStyle: consistent
132
+ Enabled: true
133
+
134
+ Layout/IndentAssignment:
135
+ Description: 'Checks the indentation of the first line of the right-hand side of a multi-line assignment.'
136
+ Enabled: true
137
+
138
+ Layout/IndentHash:
139
+ Description: 'Checks the indentation of the first key in a hash literal.'
140
+ EnforcedStyle: consistent
141
+ Enabled: true
142
+
143
+ Layout/IndentationConsistency:
144
+ Description: 'Keep indentation straight.'
145
+ Enabled: true
146
+
147
+ Layout/IndentationWidth:
148
+ Description: 'Use 2 spaces for indentation.'
149
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation'
150
+ Width: 2
151
+ Enabled: true
152
+
153
+ Layout/InitialIndentation:
154
+ Description: 'Checks the indentation of the first non-blank non-comment line in a file.'
155
+ Enabled: true
156
+
157
+ Layout/LeadingCommentSpace:
158
+ Description: 'Comments should start with a space.'
159
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-space'
160
+ Enabled: true
161
+
162
+ Layout/MultilineArrayBraceLayout:
163
+ Description: 'Checks that the closing brace in an array literal is on a new line.'
164
+ EnforcedStyle: new_line
165
+ Enabled: true
166
+
167
+ Layout/MultilineAssignmentLayout:
168
+ EnforcedStyle: same_line
169
+ Enabled: true
170
+
171
+ Layout/MultilineBlockLayout:
172
+ Description: 'Ensures newlines after multiline block do statements.'
173
+ Enabled: true
174
+
175
+ Layout/MultilineHashBraceLayout:
176
+ Description: 'Checks that the closing brace in an hash literal is on a new line.'
177
+ EnforcedStyle: new_line
178
+ Enabled: true
179
+
180
+ Layout/MultilineMethodCallBraceLayout:
181
+ Description: 'Checks that the closing brace in a multi-line method call is on a new line.'
182
+ EnforcedStyle: new_line
183
+ Enabled: true
184
+
185
+ Layout/MultilineMethodDefinitionBraceLayout:
186
+ Description: 'Checks that the closing brace in a method definition is on a new line.'
187
+ EnforcedStyle: new_line
188
+ Enabled: true
189
+
190
+ Layout/MultilineOperationIndentation:
191
+ Description: 'Checks indentation of binary operations that span more than one line.'
192
+ EnforcedStyle: indented
193
+ Enabled: true
194
+
195
+ Layout/RescueEnsureAlignment:
196
+ Description: 'Align rescues and ensures correctly.'
197
+ Enabled: true
198
+
199
+ Layout/SpaceAfterColon:
200
+ Description: 'Use spaces after colons.'
201
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
202
+ Enabled: true
203
+
204
+ Layout/SpaceAfterComma:
205
+ Description: 'Use spaces after commas.'
206
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
207
+ Enabled: true
208
+
209
+ Layout/SpaceAfterMethodName:
210
+ Description: 'Do not put a space between a method name and the opening parenthesis in a method definition.'
211
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
212
+ Enabled: true
213
+
214
+ Layout/SpaceAfterNot:
215
+ Description: 'Tracks redundant space after the ! operator.'
216
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-space-bang'
217
+ Enabled: true
218
+
219
+ Layout/SpaceAfterSemicolon:
220
+ Description: 'Use spaces after semicolons.'
221
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
222
+ Enabled: true
223
+
224
+ Layout/SpaceAroundBlockParameters:
225
+ Description: 'Checks the spacing inside and after block parameters pipes.'
226
+ Enabled: true
227
+
228
+ Layout/SpaceAroundEqualsInParameterDefault:
229
+ Description: >-
230
+ Checks that the equals signs in parameter default assignments
231
+ have or don't have surrounding space depending on
232
+ configuration.
233
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-around-equals'
234
+ EnforcedStyle: space
235
+ Enabled: true
236
+
237
+ Layout/SpaceAroundKeyword:
238
+ Description: 'Use spaces around keywords.'
239
+ Enabled: true
240
+
241
+ Layout/SpaceAroundOperators:
242
+ Description: 'Use a single space around operators.'
243
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
244
+ Enabled: true
245
+
246
+ Layout/SpaceBeforeBlockBraces:
247
+ Description: >-
248
+ Checks that the left block brace has or doesn't have space
249
+ before it.
250
+ Enabled: true
251
+
252
+ Layout/SpaceBeforeComma:
253
+ Description: 'No spaces before commas.'
254
+ Enabled: true
255
+
256
+ Layout/SpaceBeforeComment:
257
+ Description: >-
258
+ Checks for missing space between code and a comment on the
259
+ same line.
260
+ Enabled: true
261
+
262
+ Layout/SpaceBeforeFirstArg:
263
+ Description: >-
264
+ Checks that exactly one space is used between a method name
265
+ and the first argument for method calls without parentheses.
266
+ Enabled: true
267
+
268
+ Layout/SpaceBeforeSemicolon:
269
+ Description: 'No spaces before semicolons.'
270
+ Enabled: true
271
+
272
+ Layout/SpaceInLambdaLiteral:
273
+ Description: 'Require no space between stabby and arguments.'
274
+ EnforcedStyle: require_no_space
275
+ Enabled: true
276
+
277
+ Layout/SpaceInsideArrayLiteralBrackets:
278
+ Description: 'Do not space pad array literals.'
279
+ EnforcedStyle: no_space
280
+ Enabled: true
281
+
282
+ Layout/SpaceInsideArrayPercentLiteral:
283
+ Description: 'Checks for unnecessary spaces in percent literal arrays.'
284
+ Enabled: true
285
+
286
+ Layout/SpaceInsideBlockBraces:
287
+ Description: 'Checks that blocks braces are space padded.'
288
+ Enabled: true
289
+
290
+ Layout/SpaceInsideHashLiteralBraces:
291
+ Description: 'Use spaces inside hash literal braces - or do not.'
292
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
293
+ Enabled: true
294
+
295
+ Layout/SpaceInsideParens:
296
+ Description: 'No spaces after ( or before ).'
297
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
298
+ Enabled: true
299
+
300
+ Layout/SpaceInsidePercentLiteralDelimiters:
301
+ Description: 'Checks for unnecessary spaces inside %i%w%x literals.'
302
+ Enabled: true
303
+
304
+ Layout/SpaceInsideRangeLiteral:
305
+ Description: 'No spaces inside range literals.'
306
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-space-inside-range-literals'
307
+ Enabled: true
308
+
309
+ Layout/SpaceInsideReferenceBrackets:
310
+ Description: 'No spaces in collection reference array brackets.'
311
+ Enabled: true
312
+
313
+ Layout/SpaceInsideStringInterpolation:
314
+ Description: 'Checks for padding/surrounding spaces inside string interpolation.'
315
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#string-interpolation'
316
+ Enabled: true
317
+
318
+ Layout/Tab:
319
+ Description: 'No hard tabs.'
320
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation'
321
+ Enabled: true
322
+
323
+ Layout/TrailingBlankLines:
324
+ Description: 'Checks trailing blank lines and final newline.'
325
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#newline-eof'
326
+ Enabled: true
327
+
328
+ Layout/TrailingWhitespace:
329
+ Description: 'Avoid trailing whitespace.'
330
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace'
331
+ Enabled: true
332
+
333
+ ######################### Lint #############################
334
+
335
+ Lint/AmbiguousBlockAssociation:
336
+ Description: 'Checks for ambiguous block association with method without params.'
337
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#syntax'
338
+ Enabled: true
339
+
340
+ Lint/AmbiguousOperator:
341
+ Description: >-
342
+ Checks for ambiguous operators in the first argument of a
343
+ method invocation without parentheses.
344
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-as-args'
345
+ Enabled: true
346
+
347
+ Lint/AmbiguousRegexpLiteral:
348
+ Description: >-
349
+ Checks for ambiguous regexp literals in the first argument of
350
+ a method invocation without parenthesis.
351
+ Enabled: true
352
+
353
+ Lint/AssignmentInCondition:
354
+ Description: 'Do not use assignment in conditions.'
355
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition'
356
+ Enabled: false
357
+
358
+ Lint/BlockAlignment:
359
+ Description: 'Checks whether the end keywords are aligned properly for do end blocks.'
360
+ Enabled: true
361
+
362
+ Lint/BooleanSymbol:
363
+ Description: 'Do not create :true or :false symbols'
364
+ Enabled: true
365
+
366
+ Lint/CircularArgumentReference:
367
+ Description: 'Do not refer to the keyword argument in the default value.'
368
+ Enabled: true
369
+
370
+ Lint/ConditionPosition:
371
+ Description: >-
372
+ Checks for condition placed in a confusing position relative to
373
+ the keyword.
374
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
375
+ Enabled: true
376
+
377
+ Lint/Debugger:
378
+ Description: 'Check for debugger calls.'
379
+ Enabled: true
380
+
381
+ Lint/DeprecatedClassMethods:
382
+ Description: 'Check for deprecated class method calls.'
383
+ Enabled: true
384
+
385
+ Lint/DuplicateCaseCondition:
386
+ Description: 'Check for there are no duplicate case conditions.'
387
+ Enabled: true
388
+
389
+ Lint/DuplicateMethods:
390
+ Description: 'Check for duplicate methods calls.'
391
+ Enabled: true
392
+
393
+ Lint/DuplicatedKey:
394
+ Description: 'Check for duplicate hash keys.'
395
+ Enabled: true
396
+
397
+ Lint/EachWithObjectArgument:
398
+ Description: 'Check for immutable argument given to each_with_object.'
399
+ Enabled: true
400
+
401
+ Lint/ElseLayout:
402
+ Description: 'Check for odd code arrangement in an else block.'
403
+ Enabled: true
404
+
405
+ Lint/EmptyEnsure:
406
+ Description: 'Checks for empty ensure block.'
407
+ Enabled: true
408
+
409
+ Lint/EmptyExpression:
410
+ Description: 'Checks for empty if/unless/while expressions.'
411
+ Enabled: true
412
+
413
+ Lint/EndAlignment:
414
+ Description: 'Checks whether the end keywords are aligned properly.'
415
+ EnforcedStyleAlignWith: 'variable'
416
+ Enabled: true
417
+
418
+ Lint/EmptyInterpolation:
419
+ Description: 'Checks for empty string interpolation.'
420
+ Enabled: true
421
+
422
+ Lint/EndInMethod:
423
+ Description: 'END blocks should not be placed inside method definitions.'
424
+ Enabled: true
425
+
426
+ Lint/EnsureReturn:
427
+ Description: 'Do not use return in an ensure block.'
428
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-return-ensure'
429
+ Enabled: true
430
+
431
+ Lint/FormatParameterMismatch:
432
+ Description: 'The number of parameters to format/sprint must match the fields.'
433
+ Enabled: true
434
+
435
+ Lint/HandleExceptions:
436
+ Description: 'Do not suppress exception.'
437
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions'
438
+ Enabled: true
439
+
440
+ Lint/ImplicitStringConcatenation:
441
+ Description: 'Checks for implicit string concatentation of string literals on the same line.'
442
+ Enabled: true
443
+
444
+ Lint/IneffectiveAccessModifier:
445
+ Description: 'Checks for `private` or `protected` on class methods.'
446
+ Enabled: true
447
+
448
+ Lint/InheritException:
449
+ Description: 'Do not inherit from Exception. Use RuntimeError or StandardError instead.'
450
+ EnforcedStyle: standard_error
451
+ Enabled: true
452
+
453
+ Lint/LiteralAsCondition:
454
+ Description: 'Checks of literals used in conditions.'
455
+ Enabled: true
456
+
457
+ Lint/LiteralInInterpolation:
458
+ Description: 'Checks for literals used in interpolation.'
459
+ Enabled: true
460
+
461
+ Lint/Loop:
462
+ Description: >-
463
+ Use Kernel#loop with break rather than begin/end/until or
464
+ begin/end/while for post-loop tests.
465
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#loop-with-break'
466
+ Enabled: true
467
+
468
+ Lint/NestedMethodDefinition:
469
+ Description: 'Do not use nested method definitions.'
470
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-methods'
471
+ Enabled: true
472
+
473
+ Lint/NestedPercentLiteral:
474
+ Description: 'Do not use nested percent literals.'
475
+ Enabled: true
476
+
477
+ Lint/NextWithoutAccumulator:
478
+ Description: 'Do not emit the accumulator when calling `next` in a `reduce` block'
479
+ Enabled: true
480
+
481
+ Lint/NonLocalExitFromIterator:
482
+ Description: 'Do not use return in iterator to cause non-local exit.'
483
+ Enabled: true
484
+
485
+ Lint/ParenthesesAsGroupedExpression:
486
+ Description: >-
487
+ Checks for method calls with a space before the opening
488
+ parenthesis.
489
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
490
+ Enabled: true
491
+
492
+ Lint/RequireParentheses:
493
+ Description: >-
494
+ Use parentheses in the method call to avoid confusion
495
+ about precedence.
496
+ Enabled: true
497
+
498
+ Lint/RescueException:
499
+ Description: 'Avoid rescuing the Exception class.'
500
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-blind-rescues'
501
+ Enabled: true
502
+
503
+ Lint/ShadowingOuterLocalVariable:
504
+ Description: >-
505
+ Do not use the same name as outer local variable
506
+ for block arguments or block local variables.
507
+ Enabled: true
508
+
509
+ Lint/StringConversionInInterpolation:
510
+ Description: 'Checks for Object#to_s usage in string interpolation.'
511
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-to-s'
512
+ Enabled: true
513
+
514
+ Lint/UnderscorePrefixedVariableName:
515
+ Description: 'Do not use prefix `_` for a variable that is used.'
516
+ Enabled: true
517
+
518
+ Lint/UnneededDisable:
519
+ Description: >-
520
+ Checks for rubocop:disable comments that can be removed.
521
+ Note: this cop is not disabled when disabling all cops.
522
+ It must be explicitly disabled.
523
+ Enabled: true
524
+
525
+ Lint/UnneededSplatExpansion:
526
+ Description: 'Checks for unneeded usages of splat expansion.'
527
+ Enabled: true
528
+
529
+ Lint/UnreachableCode:
530
+ Description: 'Unreachable code.'
531
+ Enabled: true
532
+
533
+ Lint/UnusedBlockArgument:
534
+ Description: 'Checks for unused block arguments.'
535
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
536
+ Enabled: true
537
+
538
+ Lint/UnusedMethodArgument:
539
+ Description: 'Checks for unused method arguments.'
540
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
541
+ Enabled: true
542
+
543
+ Lint/UselessAccessModifier:
544
+ Description: 'Checks for useless access modifiers.'
545
+ Enabled: true
546
+
547
+ Lint/UselessAssignment:
548
+ Description: 'Checks for useless assignment to a local variable.'
549
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
550
+ Enabled: true
551
+
552
+ Lint/UselessComparison:
553
+ Description: 'Checks for comparison of something with itself.'
554
+ Enabled: true
555
+
556
+ Lint/UselessElseWithoutRescue:
557
+ Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
558
+ Enabled: true
559
+
560
+ Lint/UselessSetterCall:
561
+ Description: 'Checks for useless setter call to a local variable.'
562
+ Enabled: true
563
+
564
+ Lint/Void:
565
+ Description: 'Possible use of operator/literal/variable in void context.'
566
+ Enabled: true
567
+
568
+ ######################### Metrics ##########################
569
+
570
+ Metrics/AbcSize:
571
+ Description: >-
572
+ A calculated magnitude based on number of assignments,
573
+ branches, and conditions.
574
+ Reference: 'http://c2.com/cgi/wiki?AbcMetric'
575
+ Enabled: false
576
+ Max: 20
577
+
578
+ Metrics/BlockNesting:
579
+ Description: 'Avoid excessive block nesting.'
580
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count'
581
+ Enabled: true
582
+ Max: 4
583
+
584
+ Metrics/ClassLength:
585
+ Description: 'Avoid classes longer than 1000 lines of code.'
586
+ Enabled: true
587
+ Max: 1000
588
+
589
+ Metrics/CyclomaticComplexity:
590
+ Description: >-
591
+ A complexity metric that is strongly correlated to the number
592
+ of test cases needed to validate a method.
593
+ Enabled: true
594
+ Max: 20
595
+
596
+ Metrics/LineLength:
597
+ Description: 'Limit lines to 80 characters.'
598
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
599
+ Enabled: false
600
+
601
+ Metrics/MethodLength:
602
+ Description: 'Avoid methods longer than 30 lines of code.'
603
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
604
+ Enabled: true
605
+ Exclude:
606
+ - app/views/**/*.html.rb
607
+ Max: 100
608
+
609
+ Metrics/ModuleLength:
610
+ Description: 'Avoid modules longer than 250 lines of code.'
611
+ Enabled: true
612
+ Max: 250
613
+
614
+ Metrics/ParameterLists:
615
+ Description: 'Avoid parameter lists longer than three or four parameters.'
616
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params'
617
+ Enabled: true
618
+ Max: 6
619
+
620
+ Metrics/PerceivedComplexity:
621
+ Description: >-
622
+ A complexity metric geared towards measuring complexity for a
623
+ human reader.
624
+ Enabled: false
625
+
626
+ ######################### Naming ###########################
627
+
628
+ Naming/AccessorMethodName:
629
+ Description: Check the naming of accessor methods for get_/set_.
630
+ Enabled: false
631
+
632
+ Naming/AsciiIdentifiers:
633
+ Description: 'Use only ascii symbols in identifiers.'
634
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers'
635
+ Enabled: true
636
+
637
+ Naming/BinaryOperatorParameterName:
638
+ Description: 'When defining binary operators, name the argument other.'
639
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
640
+ Enabled: false
641
+
642
+ Naming/ClassAndModuleCamelCase:
643
+ Description: 'Use CamelCase for classes and modules.'
644
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#camelcase-classes'
645
+ Enabled: true
646
+
647
+ Naming/ConstantName:
648
+ Description: 'Constants should use SCREAMING_SNAKE_CASE.'
649
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#screaming-snake-case'
650
+ Enabled: true
651
+
652
+ Naming/FileName:
653
+ Description: 'Use snake_case for source file names.'
654
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
655
+ Enabled: true
656
+
657
+ Naming/MethodName:
658
+ Description: 'Use the configured style when naming methods.'
659
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars'
660
+ EnforcedStyle: snake_case
661
+ Enabled: true
662
+
663
+ Naming/PredicateName:
664
+ Description: 'Check the names of predicate methods.'
665
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
666
+ Enabled: false
667
+
668
+ Naming/VariableName:
669
+ Description: 'Use the configured style when naming variables.'
670
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars'
671
+ EnforcedStyle: snake_case
672
+ Enabled: true
673
+
674
+ ######################### Performance #######################
675
+
676
+ Performance/CompareWithBlock:
677
+ Description: 'Identifies places where `sort { |a, b| a.foo <=> b.foo }` can be replaced by `sort_by(&:foo)`.'
678
+ Enabled: true
679
+
680
+ Performance/Count:
681
+ Description: >-
682
+ Use `count` instead of `select...size`, `reject...size`,
683
+ `select...count`, `reject...count`, `select...length`,
684
+ and `reject...length`.
685
+ Enabled: true
686
+
687
+ Performance/Detect:
688
+ Description: >-
689
+ Use `detect` instead of `select.first`, `find_all.first`,
690
+ `select.last`, and `find_all.last`.
691
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code'
692
+ Enabled: true
693
+
694
+ Performance/EndWith:
695
+ Description: 'Identifies unnecessary use of a regex where `String.end_with?` would suffice.'
696
+ Enabled: true
697
+
698
+ Performance/FlatMap:
699
+ Description: >-
700
+ Use `Enumerable#flat_map`
701
+ instead of `Enumerable#map...Array#flatten(1)`
702
+ or `Enumberable#collect..Array#flatten(1)`
703
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code'
704
+ Enabled: true
705
+ EnabledForFlattenWithoutParams: false
706
+ # If enabled, this cop will warn about usages of
707
+ # `flatten` being called without any parameters.
708
+ # This can be dangerous since `flat_map` will only flatten 1 level, and
709
+ # `flatten` without any parameters can flatten multiple levels.
710
+
711
+ Performance/RedundantBlockCall:
712
+ Description: 'Identifies the use of a `&block` parameter and `block.call`, where `yield` would be sufficient.'
713
+ Enabled: true
714
+
715
+ Performance/RedundantMatch:
716
+ Description: 'Do not use `Regexp#match` or `String#match` where =~ is sufficient.'
717
+ Enabled: true
718
+
719
+ Performance/RedundantMerge:
720
+ Description: 'Use Hash#[]= instead of Hash#merge!'
721
+ Enabled: true
722
+
723
+ Performance/RedundantSortBy:
724
+ Description: 'Use `sort` instead of `sort_by` where possible.'
725
+ Enabled: true
726
+
727
+ Performance/ReverseEach:
728
+ Description: 'Use `reverse_each` instead of `reverse.each`.'
729
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code'
730
+ Enabled: true
731
+
732
+ Performance/Sample:
733
+ Description: >-
734
+ Use `sample` instead of `shuffle.first`,
735
+ `shuffle.last`, and `shuffle[Fixnum]`.
736
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
737
+ Enabled: true
738
+
739
+ Performance/Size:
740
+ Description: >-
741
+ Use `size` instead of `count` for counting
742
+ the number of elements in `Array` and `Hash`.
743
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code'
744
+ Enabled: true
745
+
746
+ Performance/StartWith:
747
+ Description: 'Use `String#start_with?` instead of regex where possible'
748
+ Enabled: true
749
+
750
+ Performance/StringReplacement:
751
+ Description: >-
752
+ Use `tr` instead of `gsub` when you are replacing the same
753
+ number of characters. Use `delete` instead of `gsub` when
754
+ you are deleting characters.
755
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code'
756
+ Enabled: true
757
+
758
+ ######################### Rails ###########################
759
+
760
+ Rails/ActionFilter:
761
+ Description: 'Enforces consistent use of action filter methods.'
762
+ Enabled: false
763
+
764
+ Rails/Blank:
765
+ Description: 'Checks for code that can be changed to `blank?`'
766
+ Enabled: true
767
+
768
+ Rails/Date:
769
+ Description: >-
770
+ Checks the correct usage of date aware methods,
771
+ such as Date.today, Date.current etc.
772
+ Enabled: false
773
+
774
+ Rails/Delegate:
775
+ Description: 'Prefer delegate method for delegations.'
776
+ Enabled: false
777
+
778
+ Rails/FindBy:
779
+ Description: 'Prefer find_by over where.first.'
780
+ Enabled: false
781
+
782
+ Rails/FindEach:
783
+ Description: 'Prefer all.find_each over all.find.'
784
+ Enabled: false
785
+
786
+ Rails/HasAndBelongsToMany:
787
+ Description: 'Prefer has_many :through to has_and_belongs_to_many.'
788
+ Enabled: false
789
+
790
+ Rails/Output:
791
+ Description: 'Checks for calls to puts, print, etc.'
792
+ Enabled: false
793
+
794
+ Rails/ReadWriteAttribute:
795
+ Description: >-
796
+ Checks for read_attribute(:attr) and
797
+ write_attribute(:attr, val).
798
+ Enabled: false
799
+
800
+ Rails/SafeNavigation:
801
+ Description: 'Prefer safe navigation operator to try!'
802
+ Enabled: true
803
+
804
+ Rails/ScopeArgs:
805
+ Description: 'Checks the arguments of ActiveRecord scopes.'
806
+ Enabled: false
807
+
808
+ Rails/TimeZone:
809
+ Description: 'Checks the correct usage of time zone aware methods.'
810
+ StyleGuide: 'https://github.com/bbatsov/rails-style-guide#time'
811
+ Reference: 'http://danilenko.org/2012/7/6/rails_timezones'
812
+ Enabled: false
813
+
814
+ Rails/Validation:
815
+ Description: 'Use validates :attribute, hash of validations.'
816
+ Enabled: false
817
+
818
+ ######################### Security #########################
819
+
820
+ Security/Eval:
821
+ Description: 'The use of eval represents a serious security risk.'
822
+ Enabled: true
823
+
824
+ ######################### Style ############################
825
+
826
+ Style/Alias:
827
+ Description: 'Use alias_method instead of alias. The lexical scope of alias can lead to unpredicatbility.'
828
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#alias-method'
829
+ EnforcedStyle: prefer_alias_method
830
+ Enabled: true
831
+
832
+ Style/AndOr:
833
+ Description: 'Use &&/|| instead of and/or.'
834
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-and-or-or'
835
+ Enabled: true
836
+
837
+ Style/ArrayJoin:
838
+ Description: 'Use Array#join instead of Array#*.'
839
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#array-join'
840
+ Enabled: true
841
+
842
+ Style/AsciiComments:
843
+ Description: 'Use only ascii symbols in comments.'
844
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments'
845
+ Enabled: false
846
+
847
+ Style/Attr:
848
+ Description: 'Checks for uses of Module#attr.'
849
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr'
850
+ Enabled: true
851
+
852
+ Style/BarePercentLiterals:
853
+ Description: 'Checks if usage of %() or %Q() matches configuration.'
854
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-q-shorthand'
855
+ Enabled: false
856
+
857
+ Style/BeginBlock:
858
+ Description: 'Avoid the use of BEGIN blocks.'
859
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-BEGIN-blocks'
860
+ Enabled: true
861
+
862
+ Style/BlockComments:
863
+ Description: 'Do not use block comments.'
864
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-block-comments'
865
+ Enabled: true
866
+
867
+ Style/BlockDelimiters:
868
+ Description: >-
869
+ Avoid using {...} for multi-line blocks (multiline chaining is
870
+ always ugly).
871
+ Prefer {...} over do...end for single-line blocks.
872
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
873
+ Enabled: true
874
+
875
+ Style/BracesAroundHashParameters:
876
+ Description: 'Checks for braces around the last argument of method call if the last parameter is a hash.'
877
+ Enabled: true
878
+
879
+ Style/CaseEquality:
880
+ Description: 'Avoid explicit use of the case equality operator(===).'
881
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality'
882
+ Enabled: true
883
+
884
+ Style/CharacterLiteral:
885
+ Description: 'Checks for uses of character literals.'
886
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-character-literals'
887
+ Enabled: true
888
+
889
+ Style/ClassAndModuleChildren:
890
+ Description: 'Checks style of children classes and modules.'
891
+ Enabled: false
892
+
893
+ Style/ClassCheck:
894
+ Description: 'Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.'
895
+ Enabled: false
896
+
897
+ Style/ClassMethods:
898
+ Description: 'Use self when defining module/class methods.'
899
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#def-self-class-methods'
900
+ Enabled: false
901
+
902
+ Style/ClassVars:
903
+ Description: 'Avoid the use of class variables.'
904
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars'
905
+ Enabled: true
906
+
907
+ Style/ColonMethodCall:
908
+ Description: 'Do not use :: for method call.'
909
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#double-colons'
910
+ Enabled: true
911
+
912
+ Style/ColonMethodDefinition:
913
+ Description: 'Do not use :: for method definition.'
914
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#double-colons'
915
+ Enabled: true
916
+
917
+ Style/CommandLiteral:
918
+ Description: 'Use `` or %x around command literals.'
919
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-x'
920
+ Enabled: false
921
+
922
+ Style/CommentAnnotation:
923
+ Description: 'Checks formatting of annotation comments.'
924
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#annotate-keywords'
925
+ Enabled: false
926
+
927
+ Style/ConditionalAssignment:
928
+ Description: 'Checks for `if` and `case` statements where each branch assigns the same variable.'
929
+ Enabled: true
930
+
931
+ Style/DateTime:
932
+ Description: 'Checks for use of DateTime that should be replaced by `Date` or `Time`'
933
+ Enabled: true
934
+
935
+ Style/DefWithParentheses:
936
+ Description: 'Use def with parentheses when there are arguments.'
937
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens'
938
+ Enabled: true
939
+
940
+ Style/Documentation:
941
+ Description: 'Document classes and non-namespace modules.'
942
+ Enabled: false
943
+
944
+ Style/DoubleNegation:
945
+ Description: 'Checks for uses of double negation (!!).'
946
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-bang-bang'
947
+ Enabled: false
948
+
949
+ Style/EachWithObject:
950
+ Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
951
+ Enabled: true
952
+
953
+ Style/EmptyBlockParameter:
954
+ Description: 'Empty pipes in blocks are redundant.'
955
+ Enabled: true
956
+
957
+ Style/EmptyElse:
958
+ Description: 'Avoid empty else-clauses.'
959
+ EnforcedStyle: empty
960
+ Enabled: true
961
+
962
+ Style/EmptyLambdaParameter:
963
+ Description: 'Skip parentheses for empty lambda parameters.'
964
+ Enabled: true
965
+
966
+ Style/EmptyLiteral:
967
+ Description: 'Prefer literals to Array.new/Hash.new/String.new.'
968
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#literal-array-hash'
969
+ Enabled: true
970
+
971
+ Style/EndBlock:
972
+ Description: 'Avoid the use of END blocks.'
973
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-END-blocks'
974
+ Enabled: true
975
+
976
+ Style/EvenOdd:
977
+ Description: 'Favor the use of Fixnum#even? && Fixnum#odd?.'
978
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
979
+ Enabled: true
980
+
981
+ Style/FlipFlop:
982
+ Description: 'Checks for flip flops.'
983
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-flip-flops'
984
+ Enabled: false
985
+
986
+ Style/For:
987
+ Description: 'Checks use of for or each in multiline loops.'
988
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-for-loops'
989
+ Enabled: true
990
+
991
+ Style/FormatString:
992
+ Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
993
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#sprintf'
994
+ Enabled: false
995
+
996
+ Style/FrozenStringLiteralComment:
997
+ Description: 'This enforces that the `# frozen_string_literal: true` comment is at the top of every file to enable frozen string literals.'
998
+ Enabled: true
999
+
1000
+ Style/GlobalVars:
1001
+ Description: 'Do not introduce global variables.'
1002
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#instance-vars'
1003
+ Reference: 'http://www.zenspider.com/Languages/Ruby/QuickRef.html'
1004
+ Enabled: false
1005
+
1006
+ Style/GuardClause:
1007
+ Description: 'Check for conditionals that can be replaced with guard clauses.'
1008
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
1009
+ Enabled: false
1010
+
1011
+ Style/HashSyntax:
1012
+ Description: 'Prefer hash rockets.'
1013
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-literals'
1014
+ EnforcedStyle: hash_rockets
1015
+ Enabled: true
1016
+
1017
+ Style/IfUnlessModifier:
1018
+ Description: >-
1019
+ Favor modifier if/unless usage when you have a
1020
+ single-line body.
1021
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
1022
+ Enabled: false
1023
+
1024
+ Style/IfUnlessModifierOfIfUnless:
1025
+ Description: 'Do not use if and unless as modifiers of other if or unless statements.'
1026
+ Enabled: true
1027
+
1028
+ Style/IfWithSemicolon:
1029
+ Description: 'Do not use if x; .... Use the ternary operator instead.'
1030
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs'
1031
+ Enabled: true
1032
+
1033
+ Style/InfiniteLoop:
1034
+ Description: 'Use Kernel#loop for infinite loops.'
1035
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#infinite-loop'
1036
+ Enabled: true
1037
+
1038
+ Style/InverseMethods:
1039
+ Description: 'Do not use `not` or `!` when an inverse method can be used.'
1040
+ Enabled: true
1041
+
1042
+ Style/Lambda:
1043
+ Description: 'Use the new lambda literal syntax for single-line blocks.'
1044
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#lambda-multi-line'
1045
+ Enabled: false
1046
+
1047
+ Style/LambdaCall:
1048
+ Description: 'Use lambda.call(...) instead of lambda.(...).'
1049
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc-call'
1050
+ Enabled: false
1051
+
1052
+ Style/LineEndConcatenation:
1053
+ Description: >-
1054
+ Use \ instead of + or << to concatenate two string literals at
1055
+ line end.
1056
+ Enabled: false
1057
+
1058
+ Style/MethodCallWithArgsParentheses:
1059
+ Description: 'Use parentheses for method calls with arguments.'
1060
+ IgnoredMethods:
1061
+ - puts
1062
+ - raise
1063
+ - require
1064
+ - load
1065
+ - render
1066
+ - respond_to
1067
+ - widget
1068
+ - extend
1069
+ - include
1070
+ Exclude:
1071
+ - Gemfile
1072
+ - db/migrate
1073
+ - app/views/**/*.html.rb
1074
+ - spec/**/*.rb
1075
+ Enabled: true
1076
+
1077
+ Style/MethodCallWithoutArgsParentheses:
1078
+ Description: 'Do not use parentheses for method calls with no arguments.'
1079
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-args-no-parens'
1080
+ Enabled: true
1081
+
1082
+ Style/MethodDefParentheses:
1083
+ Description: >-
1084
+ Checks if the method definitions have or don't have
1085
+ parentheses.
1086
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens'
1087
+ Enabled: true
1088
+
1089
+ Style/MixinGrouping:
1090
+ Description: 'Separate include statements.'
1091
+ Enabled: true
1092
+
1093
+ Style/ModuleFunction:
1094
+ Description: 'Checks for usage of `extend self` in modules.'
1095
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#module-function'
1096
+ Enabled: false
1097
+
1098
+ Style/MultilineBlockChain:
1099
+ Description: 'Avoid multi-line chains of blocks.'
1100
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
1101
+ Enabled: false
1102
+
1103
+ Style/MultilineIfThen:
1104
+ Description: 'Do not use then for multi-line if/unless.'
1105
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-then'
1106
+ Enabled: true
1107
+
1108
+ Style/MultilineTernaryOperator:
1109
+ Description: >-
1110
+ Avoid multi-line ?: (the ternary operator);
1111
+ use if/unless instead.
1112
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-multiline-ternary'
1113
+ Enabled: true
1114
+
1115
+ Style/NegatedIf:
1116
+ Description: >-
1117
+ Favor unless over if for negative conditions
1118
+ (or control flow or).
1119
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives'
1120
+ Enabled: true
1121
+
1122
+ Style/NegatedWhile:
1123
+ Description: 'Favor until over while for negative conditions.'
1124
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#until-for-negatives'
1125
+ Enabled: true
1126
+
1127
+ Style/NestedTernaryOperator:
1128
+ Description: 'Use one expression per branch in a ternary operator.'
1129
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-ternary'
1130
+ Enabled: false
1131
+
1132
+ Style/NestedParenthesizedCalls:
1133
+ Description: 'Use parentheses for nested method calls with arguments.'
1134
+ Enabled: true
1135
+
1136
+ Style/Next:
1137
+ Description: 'Use `next` to skip iteration instead of a condition at the end.'
1138
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
1139
+ Enabled: false
1140
+
1141
+ Style/NilComparison:
1142
+ Description: 'Prefer x.nil? to x == nil.'
1143
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
1144
+ Enabled: true
1145
+
1146
+ Style/NonNilCheck:
1147
+ Description: 'Checks for redundant nil checks.'
1148
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-non-nil-checks'
1149
+ Enabled: true
1150
+
1151
+ Style/Not:
1152
+ Description: 'Use ! instead of not.'
1153
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bang-not-not'
1154
+ Enabled: true
1155
+
1156
+ Style/NumericLiterals:
1157
+ Description: >-
1158
+ Add underscores to large numeric literals to improve their
1159
+ readability.
1160
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics'
1161
+ Enabled: false
1162
+
1163
+ Style/OneLineConditional:
1164
+ Description: >-
1165
+ Favor the ternary operator(?:) over
1166
+ if/then/else/end constructs.
1167
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator'
1168
+ Enabled: true
1169
+
1170
+ Style/OptionalArguments:
1171
+ Description: >-
1172
+ Checks for optional arguments that do not appear at the end
1173
+ of the argument list
1174
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#optional-arguments'
1175
+ Enabled: true
1176
+
1177
+ Style/OrAssignment:
1178
+ Description: 'Use ||= where possible.'
1179
+ Enabled: true
1180
+
1181
+ Style/ParallelAssignment:
1182
+ Description: >-
1183
+ Check for simple usages of parallel assignment.
1184
+ It will only warn when the number of variables
1185
+ matches on both sides of the assignment.
1186
+ This also provides performance benefits
1187
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parallel-assignment'
1188
+ Enabled: false
1189
+
1190
+ Style/ParenthesesAroundCondition:
1191
+ Description: >-
1192
+ Don't use parentheses around the condition of an
1193
+ if/unless/while.
1194
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-parens-if'
1195
+ Enabled: false
1196
+
1197
+ Style/PercentLiteralDelimiters:
1198
+ Description: 'Use `%`-literal delimiters consistently.'
1199
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-literal-braces'
1200
+ Enabled: false
1201
+
1202
+ Style/PercentQLiterals:
1203
+ Description: 'Checks if uses of %Q/%q match the configured preference.'
1204
+ Enabled: true
1205
+
1206
+ Style/PerlBackrefs:
1207
+ Description: 'Avoid Perl-style regex back references.'
1208
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
1209
+ Enabled: false
1210
+
1211
+ Style/PreferredHashMethods:
1212
+ Description: 'Checks for use of deprecated Hash methods.'
1213
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-key'
1214
+ Enabled: false
1215
+
1216
+ Style/Proc:
1217
+ Description: 'Use proc instead of Proc.new.'
1218
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc'
1219
+ Enabled: false
1220
+
1221
+ Style/RaiseArgs:
1222
+ Description: 'Checks the arguments passed to raise/fail.'
1223
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#exception-class-messages'
1224
+ Enabled: false
1225
+
1226
+ Style/RandomWithOffset:
1227
+ Description: 'Do not add numbers to random numbers. Use ranges instead.'
1228
+ Enabled: true
1229
+
1230
+ Style/RedundantBegin:
1231
+ Description: 'Do not use begin blocks when they are not needed.'
1232
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#begin-implicit'
1233
+ Enabled: true
1234
+
1235
+ Style/RedundantConditional:
1236
+ Description: 'Checks for conditional returning of true/false in conditionals'
1237
+ Enabled: true
1238
+
1239
+ Style/RedundantException:
1240
+ Description: 'Checks for an obsolete RuntimeException argument in raise/fail.'
1241
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-runtimeerror'
1242
+ Enabled: false
1243
+
1244
+ Style/RedundantReturn:
1245
+ Description: 'Do not use return where it is not required.'
1246
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-return'
1247
+ Enabled: false
1248
+
1249
+ Style/RedundantSelf:
1250
+ Description: 'Do not use self where it is not needed.'
1251
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-self-unless-required'
1252
+ Enabled: true
1253
+
1254
+ Style/RegexpLiteral:
1255
+ Description: 'Use / or %r around regular expressions.'
1256
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r'
1257
+ Enabled: false
1258
+
1259
+ Style/RescueModifier:
1260
+ Description: 'Avoid using rescue in its modifier form.'
1261
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-rescue-modifiers'
1262
+ Enabled: false
1263
+
1264
+ Style/SafeNavigation:
1265
+ Description: 'Checks for places where the safe navigation operator should have been used.'
1266
+ Enabled: true
1267
+
1268
+ Style/SelfAssignment:
1269
+ Description: >-
1270
+ Checks for places where self-assignment shorthand should have
1271
+ been used.
1272
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment'
1273
+ Enabled: true
1274
+
1275
+ Style/Semicolon:
1276
+ Description: 'Do not use semicolons to terminate expressions.'
1277
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon'
1278
+ Enabled: true
1279
+
1280
+ Style/SignalException:
1281
+ Description: 'Checks for proper usage of fail and raise.'
1282
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#fail-method'
1283
+ EnforcedStyle: only_raise
1284
+ Enabled: true
1285
+
1286
+ Style/SingleLineBlockParams:
1287
+ Description: 'Enforces the names of some block params.'
1288
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#reduce-blocks'
1289
+ Enabled: false
1290
+
1291
+ Style/SingleLineMethods:
1292
+ Description: 'Avoid single-line methods.'
1293
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-single-line-methods'
1294
+ Enabled: false
1295
+
1296
+ Style/SpecialGlobalVars:
1297
+ Description: 'Avoid Perl-style global variables.'
1298
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms'
1299
+ Enabled: true
1300
+
1301
+ Style/StabbyLambdaParentheses:
1302
+ Description: 'Checks for parentheses around stabby lambda arugments.'
1303
+ EnforcedStyle: require_parentheses
1304
+ Enabled: true
1305
+
1306
+ Style/StringLiterals:
1307
+ Description: 'Checks if uses of quotes match the configured preference.'
1308
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals'
1309
+ EnforcedStyle: single_quotes
1310
+ Enabled: true
1311
+
1312
+ Style/StringLiteralsInInterpolation:
1313
+ Description: >-
1314
+ Checks if uses of quotes inside expressions in interpolated
1315
+ strings match the configured preference.
1316
+ EnforcedStyle: single_quotes
1317
+ Enabled: true
1318
+
1319
+ Style/StructInheritance:
1320
+ Description: 'Checks for inheritance from Struct.new.'
1321
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-extend-struct-new'
1322
+ Enabled: false
1323
+
1324
+ Style/SymbolLiteral:
1325
+ Description: 'Use plain symbols instead of string symbols when possible.'
1326
+ Enabled: true
1327
+
1328
+ Style/SymbolProc:
1329
+ Description: 'Use symbols as procs instead of blocks when possible.'
1330
+ Enabled: true
1331
+
1332
+ Style/TernaryParentheses:
1333
+ Description: 'Use parentheses in ternary conditions only when using complex conditions.'
1334
+ EnforcedStyle: require_parentheses_when_complex
1335
+ Enabled: true
1336
+
1337
+ Style/TrailingCommaInArguments:
1338
+ Description: 'Checks for trailing comma in parameter lists.'
1339
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-params-comma'
1340
+ EnforcedStyleForMultiline: no_comma
1341
+ Enabled: true
1342
+
1343
+ Style/TrailingCommaInLiteral:
1344
+ Description: 'Checks for trailing comma in array literals.'
1345
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
1346
+ EnforcedStyleForMultiline: consistent_comma
1347
+ Enabled: false
1348
+
1349
+ Style/TrailingMethodEndStatement:
1350
+ Description: 'Checks for trailing end after the method definition body.'
1351
+ Enabled: true
1352
+
1353
+ Style/TrailingUnderscoreVariable:
1354
+ Description: >-
1355
+ Checks for the usage of unneeded trailing underscores at the
1356
+ end of parallel variable assignment.
1357
+ Enabled: true
1358
+
1359
+ Style/TrivialAccessors:
1360
+ Description: 'Prefer attr_* methods to trivial readers/writers.'
1361
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family'
1362
+ Enabled: true
1363
+
1364
+ Style/UnlessElse:
1365
+ Description: >-
1366
+ Do not use unless with else. Rewrite these with the positive
1367
+ case first.
1368
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-else-with-unless'
1369
+ Enabled: true
1370
+
1371
+ Style/UnneededCapitalW:
1372
+ Description: 'Checks for %W when interpolation is not needed.'
1373
+ Enabled: false
1374
+
1375
+ Style/UnneededInterpolation:
1376
+ Description: 'Checks for unnecessary interpolation.'
1377
+ Enabled: true
1378
+
1379
+ Style/UnneededPercentQ:
1380
+ Description: 'Checks for %q/%Q when single quotes or double quotes would do.'
1381
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-q'
1382
+ Enabled: false
1383
+
1384
+ Style/VariableInterpolation:
1385
+ Description: >-
1386
+ Don't interpolate global, instance and class variables
1387
+ directly in strings.
1388
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#curlies-interpolate'
1389
+ Enabled: false
1390
+
1391
+ Style/WhenThen:
1392
+ Description: 'Use when x then ... for one-line cases.'
1393
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#one-line-cases'
1394
+ Enabled: false
1395
+
1396
+ Style/WhileUntilDo:
1397
+ Description: 'Checks for redundant do after while or until.'
1398
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-multiline-while-do'
1399
+ Enabled: true
1400
+
1401
+ Style/WhileUntilModifier:
1402
+ Description: >-
1403
+ Favor modifier while/until usage when you have a
1404
+ single-line body.
1405
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier'
1406
+ Enabled: true
1407
+
1408
+ Style/WordArray:
1409
+ Description: 'Use %w or %W for arrays of words.'
1410
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w'
1411
+ MinSize: 3
1412
+ Enabled: true
1413
+
1414
+ Style/ZeroLengthPredicate:
1415
+ Description: 'Checks for numeric comparisons that can be replaced by predicate method, such as `empty?`.'
1416
+ Enabled: true