reivt 1.1.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.
data/.rubocop.yml ADDED
@@ -0,0 +1,1168 @@
1
+ AllCops:
2
+ # Include common Ruby source files.
3
+ Include:
4
+ - '**/*.gemspec'
5
+ - '**/*.rake'
6
+ - '**/Gemfile'
7
+ - '**/Rakefile'
8
+ - '**/Thorfile'
9
+ Exclude:
10
+ - 'vendor/**/*'
11
+ - 'spec/spec_resources/**/*'
12
+ # Default formatter will be used if no -f/--format option is given.
13
+ DefaultFormatter: progress
14
+ # Cop names are not displayed in offense messages by default. Change behavior
15
+ # by overriding DisplayCopNames, or by giving the -D/--display-cop-names
16
+ # option.
17
+ DisplayCopNames: false
18
+ # Style guide URLs are not displayed in offense messages by default. Change
19
+ # behavior by overriding DisplayStyleGuide, or by giving the
20
+ # -S/--display-style-guide option.
21
+ DisplayStyleGuide: false
22
+ # Extra details are not displayed in offense messages by default. Change
23
+ # behavior by overriding ExtraDetails, or by giving the
24
+ # -E/--extra-details option.
25
+ ExtraDetails: true
26
+ # Additional cops that do not reference a style guide rule may be enabled by
27
+ # default. Change behavior by overriding StyleGuideCopsOnly, or by giving
28
+ # the --only-guide-cops option.
29
+ StyleGuideCopsOnly: false
30
+ # All cops except the ones in disabled.yml are enabled by default. Change
31
+ # this behavior by overriding DisabledByDefault. When DisabledByDefault is
32
+ # true, all cops in the default configuration are disabled, and and only cops
33
+ # in user configuration are enabled. This makes cops opt-in instead of
34
+ # opt-out. Note that when DisabledByDefault is true, cops in user
35
+ # configuration will be enabled even if they don't set the Enabled parameter.
36
+ DisabledByDefault: false
37
+ # Enables the result cache if true. Can be overridden by the --cache command
38
+ # line option.
39
+ UseCache: true
40
+ # Threshold for how many files can be stored in the result cache before some
41
+ # of the files are automatically removed.
42
+ MaxFilesInCache: 20000
43
+ # The cache will be stored in "rubocop_cache" under this directory. The name
44
+ # "/tmp" is special and will be converted to the system temporary directory,
45
+ # which is "/tmp" on Unix-like systems, but could be something else on other
46
+ # systems.
47
+ CacheRootDirectory: /tmp
48
+ # The default cache root directory is /tmp, which on most systems is
49
+ # writable by any system user. This means that it is possible for a
50
+ # malicious user to anticipate the location of Rubocop's cache directory,
51
+ # and create a symlink in its place that could cause Rubocop to overwrite
52
+ # unintended files, or read malicious input. If you are certain that your
53
+ # cache location is secure from this kind of attack, and wish to use a
54
+ # symlinked cache location, set this value to "true".
55
+ AllowSymlinksInCacheRootDirectory: false
56
+ # What MRI version of the Ruby interpreter is the inspected code intended to
57
+ # run on? (If there is more than one, set this to the lowest version.)
58
+ # If a value is specified for TargetRubyVersion then it is used.
59
+ # Else if .ruby-version exists and it contains an MRI version it is used.
60
+ # Otherwise we fallback to the oldest officially supported Ruby version (2.0).
61
+ TargetRubyVersion: 2.3
62
+
63
+ # Indent private/protected/public as deep as method definitions
64
+ Style/AccessModifierIndentation:
65
+ EnforcedStyle: indent
66
+ SupportedStyles:
67
+ - outdent
68
+ - indent
69
+ # By default, the indentation width from Style/IndentationWidth is used
70
+ # But it can be overridden by setting this parameter
71
+ IndentationWidth: ~
72
+
73
+ Style/Alias:
74
+ EnforcedStyle: prefer_alias
75
+ SupportedStyles:
76
+ - prefer_alias
77
+ - prefer_alias_method
78
+
79
+ # Align the elements of a hash literal if they span more than one line.
80
+ Style/AlignHash:
81
+ # Alignment of entries using hash rocket as separator. Valid values are:
82
+ #
83
+ # key - left alignment of keys
84
+ # 'a' => 2
85
+ # 'bb' => 3
86
+ # separator - alignment of hash rockets, keys are right aligned
87
+ # 'a' => 2
88
+ # 'bb' => 3
89
+ # table - left alignment of keys, hash rockets, and values
90
+ # 'a' => 2
91
+ # 'bb' => 3
92
+ EnforcedHashRocketStyle: key
93
+ # Alignment of entries using colon as separator. Valid values are:
94
+ #
95
+ # key - left alignment of keys
96
+ # a: 0
97
+ # bb: 1
98
+ # separator - alignment of colons, keys are right aligned
99
+ # a: 0
100
+ # bb: 1
101
+ # table - left alignment of keys and values
102
+ # a: 0
103
+ # bb: 1
104
+ EnforcedColonStyle: key
105
+ # Select whether hashes that are the last argument in a method call should be
106
+ # inspected? Valid values are:
107
+ #
108
+ # always_inspect - Inspect both implicit and explicit hashes.
109
+ # Registers an offense for:
110
+ # function(a: 1,
111
+ # b: 2)
112
+ # Registers an offense for:
113
+ # function({a: 1,
114
+ # b: 2})
115
+ # always_ignore - Ignore both implicit and explicit hashes.
116
+ # Accepts:
117
+ # function(a: 1,
118
+ # b: 2)
119
+ # Accepts:
120
+ # function({a: 1,
121
+ # b: 2})
122
+ # ignore_implicit - Ignore only implicit hashes.
123
+ # Accepts:
124
+ # function(a: 1,
125
+ # b: 2)
126
+ # Registers an offense for:
127
+ # function({a: 1,
128
+ # b: 2})
129
+ # ignore_explicit - Ignore only explicit hashes.
130
+ # Accepts:
131
+ # function({a: 1,
132
+ # b: 2})
133
+ # Registers an offense for:
134
+ # function(a: 1,
135
+ # b: 2)
136
+ EnforcedLastArgumentHashStyle: always_inspect
137
+ SupportedLastArgumentHashStyles:
138
+ - always_inspect
139
+ - always_ignore
140
+ - ignore_implicit
141
+ - ignore_explicit
142
+
143
+ Style/AlignParameters:
144
+ # Alignment of parameters in multi-line method calls.
145
+ #
146
+ # The `with_first_parameter` style aligns the following lines along the same
147
+ # column as the first parameter.
148
+ #
149
+ # method_call(a,
150
+ # b)
151
+ #
152
+ # The `with_fixed_indentation` style aligns the following lines with one
153
+ # level of indentation relative to the start of the line with the method call.
154
+ #
155
+ # method_call(a,
156
+ # b)
157
+ EnforcedStyle: with_first_parameter
158
+ SupportedStyles:
159
+ - with_first_parameter
160
+ - with_fixed_indentation
161
+ # By default, the indentation width from Style/IndentationWidth is used
162
+ # But it can be overridden by setting this parameter
163
+ IndentationWidth: ~
164
+
165
+ Style/AndOr:
166
+ # Whether `and` and `or` are banned only in conditionals (conditionals)
167
+ # or completely (always).
168
+ EnforcedStyle: always
169
+ SupportedStyles:
170
+ - always
171
+ - conditionals
172
+
173
+
174
+ # Checks if usage of %() or %Q() matches configuration.
175
+ Style/BarePercentLiterals:
176
+ EnforcedStyle: bare_percent
177
+ SupportedStyles:
178
+ - percent_q
179
+ - bare_percent
180
+
181
+ Style/BlockDelimiters:
182
+ EnforcedStyle: line_count_based
183
+ SupportedStyles:
184
+ # The `line_count_based` style enforces braces around single line blocks and
185
+ # do..end around multi-line blocks.
186
+ - line_count_based
187
+ # The `semantic` style enforces braces around functional blocks, where the
188
+ # primary purpose of the block is to return a value and do..end for
189
+ # procedural blocks, where the primary purpose of the block is its
190
+ # side-effects.
191
+ #
192
+ # This looks at the usage of a block's method to determine its type (e.g. is
193
+ # the result of a `map` assigned to a variable or passed to another
194
+ # method) but exceptions are permitted in the `ProceduralMethods`,
195
+ # `FunctionalMethods` and `IgnoredMethods` sections below.
196
+ - semantic
197
+ # The `braces_for_chaining` style enforces braces around single line blocks
198
+ # and do..end around multi-line blocks, except for multi-line blocks whose
199
+ # return value is being chained with another method (in which case braces
200
+ # are enforced).
201
+ - braces_for_chaining
202
+ ProceduralMethods:
203
+ # Methods that are known to be procedural in nature but look functional from
204
+ # their usage, e.g.
205
+ #
206
+ # time = Benchmark.realtime do
207
+ # foo.bar
208
+ # end
209
+ #
210
+ # Here, the return value of the block is discarded but the return value of
211
+ # `Benchmark.realtime` is used.
212
+ - benchmark
213
+ - bm
214
+ - bmbm
215
+ - create
216
+ - each_with_object
217
+ - measure
218
+ - new
219
+ - realtime
220
+ - tap
221
+ - with_object
222
+ FunctionalMethods:
223
+ # Methods that are known to be functional in nature but look procedural from
224
+ # their usage, e.g.
225
+ #
226
+ # let(:foo) { Foo.new }
227
+ #
228
+ # Here, the return value of `Foo.new` is used to define a `foo` helper but
229
+ # doesn't appear to be used from the return value of `let`.
230
+ - let
231
+ - let!
232
+ - subject
233
+ - watch
234
+ IgnoredMethods:
235
+ # Methods that can be either procedural or functional and cannot be
236
+ # categorised from their usage alone, e.g.
237
+ #
238
+ # foo = lambda do |x|
239
+ # puts "Hello, #{x}"
240
+ # end
241
+ #
242
+ # foo = lambda do |x|
243
+ # x * 100
244
+ # end
245
+ #
246
+ # Here, it is impossible to tell from the return value of `lambda` whether
247
+ # the inner block's return value is significant.
248
+ - lambda
249
+ - proc
250
+ - it
251
+
252
+ Style/BracesAroundHashParameters:
253
+ EnforcedStyle: no_braces
254
+ SupportedStyles:
255
+ # The `braces` style enforces braces around all method parameters that are
256
+ # hashes.
257
+ - braces
258
+ # The `no_braces` style checks that the last parameter doesn't have braces
259
+ # around it.
260
+ - no_braces
261
+ # The `context_dependent` style checks that the last parameter doesn't have
262
+ # braces around it, but requires braces if the second to last parameter is
263
+ # also a hash literal.
264
+ - context_dependent
265
+
266
+ # Indentation of `when`.
267
+ Style/CaseIndentation:
268
+ EnforcedStyle: case
269
+ SupportedStyles:
270
+ - case
271
+ - end
272
+ IndentOneStep: false
273
+ # By default, the indentation width from Style/IndentationWidth is used
274
+ # But it can be overridden by setting this parameter
275
+ # This only matters if IndentOneStep is true
276
+ IndentationWidth: ~
277
+
278
+ Style/ClassAndModuleChildren:
279
+ # Checks the style of children definitions at classes and modules.
280
+ #
281
+ # Basically there are two different styles:
282
+ #
283
+ # `nested` - have each child on a separate line
284
+ # class Foo
285
+ # class Bar
286
+ # end
287
+ # end
288
+ #
289
+ # `compact` - combine definitions as much as possible
290
+ # class Foo::Bar
291
+ # end
292
+ #
293
+ # The compact style is only forced, for classes / modules with one child.
294
+ EnforcedStyle: nested
295
+ SupportedStyles:
296
+ - nested
297
+ - compact
298
+
299
+ Style/ClassCheck:
300
+ EnforcedStyle: is_a?
301
+ SupportedStyles:
302
+ - is_a?
303
+ - kind_of?
304
+
305
+ # Align with the style guide.
306
+ Style/CollectionMethods:
307
+ # Mapping from undesired method to desired_method
308
+ # e.g. to use `detect` over `find`:
309
+ #
310
+ # CollectionMethods:
311
+ # PreferredMethods:
312
+ # find: detect
313
+ PreferredMethods:
314
+ collect: 'map'
315
+ collect!: 'map!'
316
+ inject: 'reduce'
317
+ detect: 'find'
318
+ find_all: 'select'
319
+
320
+ # Use ` or %x around command literals.
321
+ Style/CommandLiteral:
322
+ EnforcedStyle: backticks
323
+ # backticks: Always use backticks.
324
+ # percent_x: Always use %x.
325
+ # mixed: Use backticks on single-line commands, and %x on multi-line commands.
326
+ SupportedStyles:
327
+ - backticks
328
+ - percent_x
329
+ - mixed
330
+ # If false, the cop will always recommend using %x if one or more backticks
331
+ # are found in the command string.
332
+ AllowInnerBackticks: false
333
+
334
+ # Checks formatting of special comments
335
+ Style/CommentAnnotation:
336
+ Keywords:
337
+ - TODO
338
+ - FIXME
339
+ - OPTIMIZE
340
+ - HACK
341
+ - REVIEW
342
+
343
+ Style/ConditionalAssignment:
344
+ EnforcedStyle: assign_to_condition
345
+ SupportedStyles:
346
+ - assign_to_condition
347
+ - assign_inside_condition
348
+ # When configured to `assign_to_condition`, `SingleLineConditionsOnly`
349
+ # will only register an offense when all branches of a condition are
350
+ # a single line.
351
+ # When configured to `assign_inside_condition`, `SingleLineConditionsOnly`
352
+ # will only register an offense for assignment to a condition that has
353
+ # at least one multiline branch.
354
+ SingleLineConditionsOnly: true
355
+
356
+ # Checks that you have put a copyright in a comment before any code.
357
+ #
358
+ # You can override the default Notice in your .rubocop.yml file.
359
+ #
360
+ # In order to use autocorrect, you must supply a value for the
361
+ # AutocorrectNotice key that matches the regexp Notice. A blank
362
+ # AutocorrectNotice will cause an error during autocorrect.
363
+ #
364
+ # Autocorrect will add a copyright notice in a comment at the top
365
+ # of the file immediately after any shebang or encoding comments.
366
+ #
367
+ # Example rubocop.yml:
368
+ #
369
+ # Style/Copyright:
370
+ # Enabled: true
371
+ # Notice: 'Copyright (\(c\) )?2015 Yahoo! Inc'
372
+ # AutocorrectNotice: '# Copyright (c) 2015 Yahoo! Inc.'
373
+ #
374
+ Style/Copyright:
375
+ Notice: '^Copyright (\(c\) )?2[0-9]{3} .+'
376
+ AutocorrectNotice: ''
377
+
378
+ Style/DocumentationMethod:
379
+ RequireForNonPublicMethods: false
380
+
381
+ # Multi-line method chaining should be done with leading dots.
382
+ Style/DotPosition:
383
+ EnforcedStyle: leading
384
+ SupportedStyles:
385
+ - leading
386
+ - trailing
387
+
388
+ # Warn on empty else statements
389
+ # empty - warn only on empty else
390
+ # nil - warn on else with nil in it
391
+ # both - warn on empty else and else with nil in it
392
+ Style/EmptyElse:
393
+ EnforcedStyle: both
394
+ SupportedStyles:
395
+ - empty
396
+ - nil
397
+ - both
398
+
399
+ # Use empty lines between defs.
400
+ Style/EmptyLineBetweenDefs:
401
+ # If true, this parameter means that single line method definitions don't
402
+ # need an empty line between them.
403
+ AllowAdjacentOneLineDefs: false
404
+
405
+ Style/EmptyLinesAroundBlockBody:
406
+ EnforcedStyle: no_empty_lines
407
+ SupportedStyles:
408
+ - empty_lines
409
+ - no_empty_lines
410
+
411
+ Style/EmptyLinesAroundClassBody:
412
+ EnforcedStyle: no_empty_lines
413
+ SupportedStyles:
414
+ - empty_lines
415
+ - no_empty_lines
416
+
417
+ Style/EmptyLinesAroundModuleBody:
418
+ EnforcedStyle: no_empty_lines
419
+ SupportedStyles:
420
+ - empty_lines
421
+ - no_empty_lines
422
+
423
+ # Checks whether the source file has a utf-8 encoding comment or not
424
+ # AutoCorrectEncodingComment must match the regex
425
+ # /#.*coding\s?[:=]\s?(?:UTF|utf)-8/
426
+ Style/Encoding:
427
+ EnforcedStyle: never
428
+ SupportedStyles:
429
+ - when_needed
430
+ - always
431
+ - never
432
+ AutoCorrectEncodingComment: '# encoding: utf-8'
433
+
434
+ Style/ExtraSpacing:
435
+ # When true, allows most uses of extra spacing if the intent is to align
436
+ # things with the previous or next line, not counting empty lines or comment
437
+ # lines.
438
+ AllowForAlignment: true
439
+ # When true, forces the alignment of = in assignments on consecutive lines.
440
+ ForceEqualSignAlignment: false
441
+
442
+ Style/FileName:
443
+ # File names listed in AllCops:Include are excluded by default. Add extra
444
+ # excludes here.
445
+ Exclude: []
446
+ # When true, requires that each source file should define a class or module
447
+ # with a name which matches the file name (converted to ... case).
448
+ # It further expects it to be nested inside modules which match the names
449
+ # of subdirectories in its path.
450
+ ExpectMatchingDefinition: false
451
+ # If non-nil, expect all source file names to match the following regex.
452
+ # Only the file name itself is matched, not the entire file path.
453
+ # Use anchors as necessary if you want to match the entire name rather than
454
+ # just a part of it.
455
+ Regex: ~
456
+ # With `IgnoreExecutableScripts` set to `true`, this cop does not
457
+ # report offending filenames for executable scripts (i.e. source
458
+ # files with a shebang in the first line).
459
+ IgnoreExecutableScripts: true
460
+
461
+ Style/FirstParameterIndentation:
462
+ EnforcedStyle: special_for_inner_method_call_in_parentheses
463
+ SupportedStyles:
464
+ # The first parameter should always be indented one step more than the
465
+ # preceding line.
466
+ - consistent
467
+ # The first parameter should normally be indented one step more than the
468
+ # preceding line, but if it's a parameter for a method call that is itself
469
+ # a parameter in a method call, then the inner parameter should be indented
470
+ # relative to the inner method.
471
+ - special_for_inner_method_call
472
+ # Same as special_for_inner_method_call except that the special rule only
473
+ # applies if the outer method call encloses its arguments in parentheses.
474
+ - special_for_inner_method_call_in_parentheses
475
+ # By default, the indentation width from Style/IndentationWidth is used
476
+ # But it can be overridden by setting this parameter
477
+ IndentationWidth: ~
478
+
479
+ # Checks use of for or each in multiline loops.
480
+ Style/For:
481
+ EnforcedStyle: each
482
+ SupportedStyles:
483
+ - for
484
+ - each
485
+
486
+ # Enforce the method used for string formatting.
487
+ Style/FormatString:
488
+ EnforcedStyle: format
489
+ SupportedStyles:
490
+ - format
491
+ - sprintf
492
+ - percent
493
+
494
+ Style/FrozenStringLiteralComment:
495
+ Enabled: false
496
+
497
+ # Built-in global variables are allowed by default.
498
+ Style/GlobalVars:
499
+ AllowedVariables: []
500
+
501
+ # `MinBodyLength` defines the number of lines of the a body of an if / unless
502
+ # needs to have to trigger this cop
503
+ Style/GuardClause:
504
+ MinBodyLength: 1
505
+
506
+ Style/HashSyntax:
507
+ EnforcedStyle: ruby19
508
+ SupportedStyles:
509
+ # checks for 1.9 syntax (e.g. {a: 1}) for all symbol keys
510
+ - ruby19
511
+ # checks for hash rocket syntax for all hashes
512
+ - hash_rockets
513
+ # forbids mixed key syntaxes (e.g. {a: 1, :b => 2})
514
+ - no_mixed_keys
515
+ # enforces both ruby19 and no_mixed_keys styles
516
+ - ruby19_no_mixed_keys
517
+ # Force hashes that have a symbol value to use hash rockets
518
+ UseHashRocketsWithSymbolValues: false
519
+ # Do not suggest { a?: 1 } over { :a? => 1 } in ruby19 style
520
+ PreferHashRocketsForNonAlnumEndingSymbols: false
521
+
522
+ Style/IfUnlessModifier:
523
+ MaxLineLength: 80
524
+
525
+ Style/IndentationConsistency:
526
+ # The difference between `rails` and `normal` is that the `rails` style
527
+ # prescribes that in classes and modules the `protected` and `private`
528
+ # modifier keywords shall be indented the same as public methods and that
529
+ # protected and private members shall be indented one step more than the
530
+ # modifiers. Other than that, both styles mean that entities on the same
531
+ # logical depth shall have the same indentation.
532
+ EnforcedStyle: normal
533
+ SupportedStyles:
534
+ - normal
535
+ - rails
536
+
537
+ Style/IndentationWidth:
538
+ # Number of spaces for each indentation level.
539
+ Width: 2
540
+
541
+ # Checks the indentation of the first element in an array literal.
542
+ Style/IndentArray:
543
+ # The value `special_inside_parentheses` means that array literals with
544
+ # brackets that have their opening bracket on the same line as a surrounding
545
+ # opening round parenthesis, shall have their first element indented relative
546
+ # to the first position inside the parenthesis.
547
+ #
548
+ # The value `consistent` means that the indentation of the first element shall
549
+ # always be relative to the first position of the line where the opening
550
+ # bracket is.
551
+ #
552
+ # The value `align_brackets` means that the indentation of the first element
553
+ # shall always be relative to the position of the opening bracket.
554
+ EnforcedStyle: special_inside_parentheses
555
+ SupportedStyles:
556
+ - special_inside_parentheses
557
+ - consistent
558
+ - align_brackets
559
+ # By default, the indentation width from Style/IndentationWidth is used
560
+ # But it can be overridden by setting this parameter
561
+ IndentationWidth: ~
562
+
563
+ # Checks the indentation of assignment RHS, when on a different line from LHS
564
+ Style/IndentAssignment:
565
+ # By default, the indentation width from Style/IndentationWidth is used
566
+ # But it can be overridden by setting this parameter
567
+ IndentationWidth: ~
568
+
569
+ # Checks the indentation of the first key in a hash literal.
570
+ Style/IndentHash:
571
+ # The value `special_inside_parentheses` means that hash literals with braces
572
+ # that have their opening brace on the same line as a surrounding opening
573
+ # round parenthesis, shall have their first key indented relative to the
574
+ # first position inside the parenthesis.
575
+ #
576
+ # The value `consistent` means that the indentation of the first key shall
577
+ # always be relative to the first position of the line where the opening
578
+ # brace is.
579
+ #
580
+ # The value `align_braces` means that the indentation of the first key shall
581
+ # always be relative to the position of the opening brace.
582
+ EnforcedStyle: special_inside_parentheses
583
+ SupportedStyles:
584
+ - special_inside_parentheses
585
+ - consistent
586
+ - align_braces
587
+ # By default, the indentation width from Style/IndentationWidth is used
588
+ # But it can be overridden by setting this parameter
589
+ IndentationWidth: ~
590
+
591
+ Style/Lambda:
592
+ EnforcedStyle: line_count_dependent
593
+ SupportedStyles:
594
+ - line_count_dependent
595
+ - lambda
596
+ - literal
597
+
598
+ Style/LambdaCall:
599
+ EnforcedStyle: call
600
+ SupportedStyles:
601
+ - call
602
+ - braces
603
+
604
+ Style/Next:
605
+ # With `always` all conditions at the end of an iteration needs to be
606
+ # replaced by next - with `skip_modifier_ifs` the modifier if like this one
607
+ # are ignored: [1, 2].each { |a| return 'yes' if a == 1 }
608
+ EnforcedStyle: skip_modifier_ifs
609
+ # `MinBodyLength` defines the number of lines of the a body of an if / unless
610
+ # needs to have to trigger this cop
611
+ MinBodyLength: 3
612
+ SupportedStyles:
613
+ - skip_modifier_ifs
614
+ - always
615
+
616
+ Style/NonNilCheck:
617
+ # With `IncludeSemanticChanges` set to `true`, this cop reports offenses for
618
+ # `!x.nil?` and autocorrects that and `x != nil` to solely `x`, which is
619
+ # **usually** OK, but might change behavior.
620
+ #
621
+ # With `IncludeSemanticChanges` set to `false`, this cop does not report
622
+ # offenses for `!x.nil?` and does no changes that might change behavior.
623
+ IncludeSemanticChanges: false
624
+
625
+ Style/NumericPredicate:
626
+ EnforcedStyle: predicate
627
+ SupportedStyles:
628
+ - predicate
629
+ - comparison
630
+ # Exclude RSpec specs because assertions like `expect(1).to be > 0` cause
631
+ # false positives.
632
+ Exclude:
633
+ - 'spec/**/*'
634
+
635
+ Style/MethodDefParentheses:
636
+ EnforcedStyle: require_parentheses
637
+ SupportedStyles:
638
+ - require_parentheses
639
+ - require_no_parentheses
640
+ - require_no_parentheses_except_multiline
641
+
642
+ Style/MethodName:
643
+ EnforcedStyle: snake_case
644
+ SupportedStyles:
645
+ - snake_case
646
+ - camelCase
647
+
648
+ Style/ModuleFunction:
649
+ EnforcedStyle: module_function
650
+ SupportedStyles:
651
+ - module_function
652
+ - extend_self
653
+
654
+ Style/MultilineArrayBraceLayout:
655
+ EnforcedStyle: symmetrical
656
+ SupportedStyles:
657
+ # symmetrical: closing brace is positioned in same way as opening brace
658
+ # new_line: closing brace is always on a new line
659
+ # same_line: closing brace is always on the same line as last element
660
+ - symmetrical
661
+ - new_line
662
+ - same_line
663
+
664
+ Style/MultilineAssignmentLayout:
665
+ # The types of assignments which are subject to this rule.
666
+ SupportedTypes:
667
+ - block
668
+ - case
669
+ - class
670
+ - if
671
+ - kwbegin
672
+ - module
673
+ EnforcedStyle: new_line
674
+ SupportedStyles:
675
+ # Ensures that the assignment operator and the rhs are on the same line for
676
+ # the set of supported types.
677
+ - same_line
678
+ # Ensures that the assignment operator and the rhs are on separate lines
679
+ # for the set of supported types.
680
+ - new_line
681
+
682
+ Style/MultilineHashBraceLayout:
683
+ EnforcedStyle: symmetrical
684
+ SupportedStyles:
685
+ # symmetrical: closing brace is positioned in same way as opening brace
686
+ # new_line: closing brace is always on a new line
687
+ # same_line: closing brace is always on same line as last element
688
+ - symmetrical
689
+ - new_line
690
+ - same_line
691
+
692
+ Style/MultilineMethodCallBraceLayout:
693
+ EnforcedStyle: symmetrical
694
+ SupportedStyles:
695
+ # symmetrical: closing brace is positioned in same way as opening brace
696
+ # new_line: closing brace is always on a new line
697
+ # same_line: closing brace is always on the same line as last argument
698
+ - symmetrical
699
+ - new_line
700
+ - same_line
701
+
702
+ Style/MultilineMethodCallIndentation:
703
+ EnforcedStyle: aligned
704
+ SupportedStyles:
705
+ - aligned
706
+ - indented
707
+ - indented_relative_to_receiver
708
+ # By default, the indentation width from Style/IndentationWidth is used
709
+ # But it can be overridden by setting this parameter
710
+ IndentationWidth: ~
711
+
712
+ Style/MultilineMethodDefinitionBraceLayout:
713
+ EnforcedStyle: symmetrical
714
+ SupportedStyles:
715
+ # symmetrical: closing brace is positioned in same way as opening brace
716
+ # new_line: closing brace is always on a new line
717
+ # same_line: closing brace is always on the same line as last parameter
718
+ - symmetrical
719
+ - new_line
720
+ - same_line
721
+
722
+ Style/MultilineOperationIndentation:
723
+ EnforcedStyle: aligned
724
+ SupportedStyles:
725
+ - aligned
726
+ - indented
727
+ # By default, the indentation width from Style/IndentationWidth is used
728
+ # But it can be overridden by setting this parameter
729
+ IndentationWidth: ~
730
+
731
+ Style/NumericLiterals:
732
+ MinDigits: 5
733
+
734
+ Style/NumericLiteralPrefix:
735
+ EnforcedOctalStyle: zero_with_o
736
+ SupportedOctalStyles:
737
+ - zero_with_o
738
+ - zero_only
739
+
740
+ Style/OptionHash:
741
+ # A list of parameter names that will be flagged by this cop.
742
+ SuspiciousParamNames:
743
+ - options
744
+ - opts
745
+ - args
746
+ - params
747
+ - parameters
748
+
749
+ # Allow safe assignment in conditions.
750
+ Style/ParenthesesAroundCondition:
751
+ AllowSafeAssignment: true
752
+
753
+ Style/PercentLiteralDelimiters:
754
+ PreferredDelimiters:
755
+ '%': ()
756
+ '%i': ()
757
+ '%q': ()
758
+ '%Q': ()
759
+ '%r': '{}'
760
+ '%s': ()
761
+ '%w': ()
762
+ '%W': ()
763
+ '%x': ()
764
+
765
+ Style/PercentQLiterals:
766
+ EnforcedStyle: lower_case_q
767
+ SupportedStyles:
768
+ - lower_case_q # Use %q when possible, %Q when necessary
769
+ - upper_case_q # Always use %Q
770
+
771
+ Style/PredicateName:
772
+ # Predicate name prefixes.
773
+ NamePrefix:
774
+ - is_
775
+ - has_
776
+ - have_
777
+ # Predicate name prefixes that should be removed.
778
+ NamePrefixBlacklist:
779
+ - is_
780
+ - has_
781
+ - have_
782
+ # Predicate names which, despite having a blacklisted prefix, or no ?,
783
+ # should still be accepted
784
+ NameWhitelist:
785
+ - is_a?
786
+ # Exclude Rspec specs because there is a strong convetion to write spec
787
+ # helpers in the form of `have_something` or `be_something`.
788
+ Exclude:
789
+ - 'spec/**/*'
790
+
791
+ Style/RaiseArgs:
792
+ EnforcedStyle: exploded
793
+ SupportedStyles:
794
+ - compact # raise Exception.new(msg)
795
+ - exploded # raise Exception, msg
796
+
797
+ Style/RedundantReturn:
798
+ # When true allows code like `return x, y`.
799
+ AllowMultipleReturnValues: false
800
+
801
+ # Use / or %r around regular expressions.
802
+ Style/RegexpLiteral:
803
+ EnforcedStyle: slashes
804
+ # slashes: Always use slashes.
805
+ # percent_r: Always use %r.
806
+ # mixed: Use slashes on single-line regexes, and %r on multi-line regexes.
807
+ SupportedStyles:
808
+ - slashes
809
+ - percent_r
810
+ - mixed
811
+ # If false, the cop will always recommend using %r if one or more slashes
812
+ # are found in the regexp string.
813
+ AllowInnerSlashes: false
814
+
815
+ Style/Semicolon:
816
+ # Allow ; to separate several expressions on the same line.
817
+ AllowAsExpressionSeparator: false
818
+
819
+ Style/SignalException:
820
+ EnforcedStyle: only_raise
821
+ SupportedStyles:
822
+ - only_raise
823
+ - only_fail
824
+ - semantic
825
+
826
+ Style/SingleLineBlockParams:
827
+ Methods:
828
+ - reduce:
829
+ - a
830
+ - e
831
+ - inject:
832
+ - a
833
+ - e
834
+
835
+ Style/SingleLineMethods:
836
+ AllowIfMethodIsEmpty: true
837
+
838
+ Style/SpaceBeforeFirstArg:
839
+ # When true, allows most uses of extra spacing if the intent is to align
840
+ # things with the previous or next line, not counting empty lines or comment
841
+ # lines.
842
+ AllowForAlignment: true
843
+
844
+ Style/SpecialGlobalVars:
845
+ EnforcedStyle: use_english_names
846
+ SupportedStyles:
847
+ - use_perl_names
848
+ - use_english_names
849
+
850
+ Style/StabbyLambdaParentheses:
851
+ EnforcedStyle: require_parentheses
852
+ SupportedStyles:
853
+ - require_parentheses
854
+ - require_no_parentheses
855
+
856
+ Style/StringLiterals:
857
+ EnforcedStyle: single_quotes
858
+ SupportedStyles:
859
+ - single_quotes
860
+ - double_quotes
861
+ # If true, strings which span multiple lines using \ for continuation must
862
+ # use the same type of quotes on each line.
863
+ ConsistentQuotesInMultiline: false
864
+
865
+ Style/StringLiteralsInInterpolation:
866
+ EnforcedStyle: single_quotes
867
+ SupportedStyles:
868
+ - single_quotes
869
+ - double_quotes
870
+
871
+ Style/StringMethods:
872
+ # Mapping from undesired method to desired_method
873
+ # e.g. to use `to_sym` over `intern`:
874
+ #
875
+ # StringMethods:
876
+ # PreferredMethods:
877
+ # intern: to_sym
878
+ PreferredMethods:
879
+ intern: to_sym
880
+
881
+ Style/SpaceAroundBlockParameters:
882
+ EnforcedStyleInsidePipes: no_space
883
+ SupportedStylesInsidePipes:
884
+ - space
885
+ - no_space
886
+
887
+ Style/SpaceAroundEqualsInParameterDefault:
888
+ EnforcedStyle: space
889
+ SupportedStyles:
890
+ - space
891
+ - no_space
892
+
893
+ Style/SpaceAroundOperators:
894
+ # When true, allows most uses of extra spacing if the intent is to align
895
+ # with an operator on the previous or next line, not counting empty lines
896
+ # or comment lines.
897
+ AllowForAlignment: true
898
+
899
+ Style/SpaceBeforeBlockBraces:
900
+ EnforcedStyle: space
901
+ SupportedStyles:
902
+ - space
903
+ - no_space
904
+
905
+ Style/SpaceInsideBlockBraces:
906
+ EnforcedStyle: space
907
+ SupportedStyles:
908
+ - space
909
+ - no_space
910
+ # Valid values are: space, no_space
911
+ EnforcedStyleForEmptyBraces: no_space
912
+ # Space between { and |. Overrides EnforcedStyle if there is a conflict.
913
+ SpaceBeforeBlockParameters: true
914
+
915
+ Style/SpaceInsideHashLiteralBraces:
916
+ EnforcedStyle: space
917
+ EnforcedStyleForEmptyBraces: no_space
918
+ SupportedStyles:
919
+ - space
920
+ - no_space
921
+ # 'compact' normally requires a space inside hash braces, with the exception
922
+ # that successive left braces or right braces are collapsed together
923
+ - compact
924
+
925
+ Style/SpaceInsideStringInterpolation:
926
+ EnforcedStyle: no_space
927
+ SupportedStyles:
928
+ - space
929
+ - no_space
930
+
931
+ Style/SymbolArray:
932
+ EnforcedStyle: percent
933
+ SupportedStyles:
934
+ - percent
935
+ - brackets
936
+
937
+ Style/SymbolProc:
938
+ # A list of method names to be ignored by the check.
939
+ # The names should be fairly unique, otherwise you'll end up ignoring lots of code.
940
+ IgnoredMethods:
941
+ - respond_to
942
+ - define_method
943
+ - assert_received
944
+
945
+ Style/TernaryParentheses:
946
+ EnforcedStyle: require_no_parentheses
947
+ SupportedStyles:
948
+ - require_parentheses
949
+ - require_no_parentheses
950
+ AllowSafeAssignment: true
951
+
952
+ Style/TrailingBlankLines:
953
+ EnforcedStyle: final_newline
954
+ SupportedStyles:
955
+ - final_newline
956
+ - final_blank_line
957
+
958
+ Style/TrailingCommaInArguments:
959
+ # If `comma`, the cop requires a comma after the last argument, but only for
960
+ # parenthesized method calls where each argument is on its own line.
961
+ # If `consistent_comma`, the cop requires a comma after the last argument,
962
+ # for all parenthesized method calls with arguments.
963
+ EnforcedStyleForMultiline: no_comma
964
+ SupportedStylesForMultiline:
965
+ - comma
966
+ - consistent_comma
967
+ - no_comma
968
+
969
+ Style/TrailingCommaInLiteral:
970
+ # If `comma`, the cop requires a comma after the last item in an array or
971
+ # hash, but only when each item is on its own line.
972
+ # If `consistent_comma`, the cop requires a comma after the last item of all
973
+ # non-empty array and hash literals.
974
+ EnforcedStyleForMultiline: no_comma
975
+ SupportedStylesForMultiline:
976
+ - comma
977
+ - consistent_comma
978
+ - no_comma
979
+
980
+ # TrivialAccessors requires exact name matches and doesn't allow
981
+ # predicated methods by default.
982
+ Style/TrivialAccessors:
983
+ # When set to false the cop will suggest the use of accessor methods
984
+ # in situations like:
985
+ #
986
+ # def name
987
+ # @other_name
988
+ # end
989
+ #
990
+ # This way you can uncover "hidden" attributes in your code.
991
+ ExactNameMatch: true
992
+ AllowPredicates: true
993
+ # Allows trivial writers that don't end in an equal sign. e.g.
994
+ #
995
+ # def on_exception(action)
996
+ # @on_exception=action
997
+ # end
998
+ # on_exception :restart
999
+ #
1000
+ # Commonly used in DSLs
1001
+ AllowDSLWriters: false
1002
+ IgnoreClassMethods: false
1003
+ Whitelist:
1004
+ - to_ary
1005
+ - to_a
1006
+ - to_c
1007
+ - to_enum
1008
+ - to_h
1009
+ - to_hash
1010
+ - to_i
1011
+ - to_int
1012
+ - to_io
1013
+ - to_open
1014
+ - to_path
1015
+ - to_proc
1016
+ - to_r
1017
+ - to_regexp
1018
+ - to_str
1019
+ - to_s
1020
+ - to_sym
1021
+
1022
+ Style/VariableName:
1023
+ EnforcedStyle: snake_case
1024
+ SupportedStyles:
1025
+ - snake_case
1026
+ - camelCase
1027
+
1028
+ Style/VariableNumber:
1029
+ EnforcedStyle: normalcase
1030
+ SupportedStyles:
1031
+ - snake_case
1032
+ - normalcase
1033
+ - non_integer
1034
+
1035
+ Style/WhileUntilModifier:
1036
+ MaxLineLength: 80
1037
+
1038
+ # WordArray enforces how array literals of word-like strings should be expressed.
1039
+ Style/WordArray:
1040
+ EnforcedStyle: percent
1041
+ SupportedStyles:
1042
+ # percent style: %w(word1 word2)
1043
+ - percent
1044
+ # bracket style: ['word1', 'word2']
1045
+ - brackets
1046
+ # The MinSize option causes the WordArray rule to be ignored for arrays
1047
+ # smaller than a certain size. The rule is only applied to arrays
1048
+ # whose element count is greater than or equal to MinSize.
1049
+ MinSize: 0
1050
+ # The regular expression WordRegex decides what is considered a word.
1051
+ WordRegex: !ruby/regexp '/\A[\p{Word}\n\t]+\z/'
1052
+
1053
+ ##################### Metrics ##################################
1054
+
1055
+ Metrics/AbcSize:
1056
+ # The ABC size is a calculated magnitude, so this number can be an Integer or
1057
+ # a Float.
1058
+ Max: 25
1059
+
1060
+ Metrics/BlockNesting:
1061
+ Max: 3
1062
+
1063
+ Metrics/BlockLength:
1064
+ Exclude:
1065
+ - 'Rakefile'
1066
+ - '*.gemspec'
1067
+
1068
+ Metrics/ClassLength:
1069
+ CountComments: false # count full line comments?
1070
+ Max: 100
1071
+
1072
+ Metrics/ModuleLength:
1073
+ CountComments: false # count full line comments?
1074
+ Max: 100
1075
+
1076
+ # Avoid complex methods.
1077
+ Metrics/CyclomaticComplexity:
1078
+ Max: 10
1079
+
1080
+ Metrics/LineLength:
1081
+ Max: 80
1082
+ # To make it possible to copy or click on URIs in the code, we allow lines
1083
+ # containing a URI to be longer than Max.
1084
+ AllowHeredoc: true
1085
+ AllowURI: true
1086
+ URISchemes:
1087
+ - http
1088
+ - https
1089
+
1090
+ Metrics/MethodLength:
1091
+ CountComments: false # count full line comments?
1092
+ Max: 30
1093
+
1094
+ Metrics/ParameterLists:
1095
+ Max: 5
1096
+ CountKeywordArgs: true
1097
+
1098
+ Metrics/PerceivedComplexity:
1099
+ Max: 15
1100
+
1101
+ ##################### Lint ##################################
1102
+
1103
+ # Allow safe assignment in conditions.
1104
+ Lint/AssignmentInCondition:
1105
+ AllowSafeAssignment: true
1106
+
1107
+ # checks whether the end keywords are aligned properly for `do` `end` blocks.
1108
+ Lint/BlockAlignment:
1109
+ # The value `start_of_block` means that the `end` should be aligned with line
1110
+ # where the `do` keyword appears.
1111
+ # The value `start_of_line` means it should be aligned with the whole
1112
+ # expression's starting line.
1113
+ # The value `either` means both are allowed.
1114
+ EnforcedStyleAlignWith: either
1115
+ SupportedStylesAlignWith:
1116
+ - either
1117
+ - start_of_block
1118
+ - start_of_line
1119
+
1120
+ # Align ends correctly.
1121
+ Lint/EndAlignment:
1122
+ # The value `keyword` means that `end` should be aligned with the matching
1123
+ # keyword (if, while, etc.).
1124
+ # The value `variable` means that in assignments, `end` should be aligned
1125
+ # with the start of the variable on the left hand side of `=`. In all other
1126
+ # situations, `end` should still be aligned with the keyword.
1127
+ # The value `start_of_line` means that `end` should be aligned with the start
1128
+ # of the line which the matching keyword appears on.
1129
+ EnforcedStyleAlignWith: keyword
1130
+ SupportedStylesAlignWith:
1131
+ - keyword
1132
+ - variable
1133
+ - start_of_line
1134
+ AutoCorrect: false
1135
+
1136
+ Lint/DefEndAlignment:
1137
+ # The value `def` means that `end` should be aligned with the def keyword.
1138
+ # The value `start_of_line` means that `end` should be aligned with method
1139
+ # calls like `private`, `public`, etc, if present in front of the `def`
1140
+ # keyword on the same line.
1141
+ EnforcedStyleAlignWith: start_of_line
1142
+ SupportedStylesAlignWith:
1143
+ - start_of_line
1144
+ - def
1145
+ AutoCorrect: false
1146
+
1147
+ Lint/InheritException:
1148
+ # The default base class in favour of `Exception`.
1149
+ EnforcedStyle: runtime_error
1150
+ SupportedStyles:
1151
+ - runtime_error
1152
+ - standard_error
1153
+
1154
+ # Checks for unused block arguments
1155
+ Lint/UnusedBlockArgument:
1156
+ IgnoreEmptyBlocks: true
1157
+ AllowUnusedKeywordArguments: false
1158
+
1159
+ # Checks for unused method arguments.
1160
+ Lint/UnusedMethodArgument:
1161
+ AllowUnusedKeywordArguments: false
1162
+ IgnoreEmptyMethods: true
1163
+
1164
+ ##################### Performance ############################
1165
+
1166
+ Performance/RedundantMerge:
1167
+ # Max number of key-value pairs to consider an offense
1168
+ MaxKeyValuePairs: 2