validates_zipcode 0.0.18 → 0.0.19

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,971 @@
1
+ # This is the default configuration file. Enabling and disabling is configured
2
+ # in separate files. This file adds all other parameters apart from Enabled.
3
+
4
+ inherit_from:
5
+ # - enabled.yml
6
+ # - disabled.yml
7
+
8
+ # Common configuration.
9
+ AllCops:
10
+ TargetRubyVersion: 2.3
11
+
12
+ TargetRailsVersion: 4.2
13
+
14
+ # Include common Ruby source files.
15
+ Include:
16
+ - '**/*.gemspec'
17
+ - '**/*.podspec'
18
+ - '**/*.jbuilder'
19
+ - '**/*.rake'
20
+ - '**/*.opal'
21
+ - '**/config.ru'
22
+ - '**/Gemfile'
23
+ - '**/Rakefile'
24
+ - '**/Capfile'
25
+ - '**/Guardfile'
26
+ - '**/Podfile'
27
+ - '**/Thorfile'
28
+ - '**/Vagrantfile'
29
+ - '**/Berksfile'
30
+ - '**/Cheffile'
31
+ - '**/Vagabondfile'
32
+ - rubocop-rspec
33
+ Exclude:
34
+ - 'vendor/**/*'
35
+ - db/schema.rb
36
+ # Cop names are not displayed in offense messages by default. Change behavior
37
+ # by overriding DisplayCopNames, or by giving the -D/--display-cop-names
38
+ # option.
39
+ DisplayCopNames: false
40
+ # Style guide URLs are not displayed in offense messages by default. Change
41
+ # behavior by overriding DisplayStyleGuide, or by giving the
42
+ # -S/--display-style-guide option.
43
+ DisplayStyleGuide: false
44
+ # Additional cops that do not reference a style guide rule may be enabled by
45
+ # default. Change behavior by overriding StyleGuideCopsOnly, or by giving
46
+ # the --only-guide-cops option.
47
+ StyleGuideCopsOnly: false
48
+
49
+ Documentation:
50
+ Enabled: false
51
+
52
+ # Indent private/protected/public as deep as method definitions
53
+ Layout/AccessModifierIndentation:
54
+ EnforcedStyle: indent
55
+ SupportedStyles:
56
+ - outdent
57
+ - indent
58
+
59
+ # Align the elements of a hash literal if they span more than one line.
60
+ Layout/AlignHash:
61
+ # Alignment of entries using hash rocket as separator. Valid values are:
62
+ #
63
+ # key - left alignment of keys
64
+ # 'a' => 2
65
+ # 'bb' => 3
66
+ # separator - alignment of hash rockets, keys are right aligned
67
+ # 'a' => 2
68
+ # 'bb' => 3
69
+ # table - left alignment of keys, hash rockets, and values
70
+ # 'a' => 2
71
+ # 'bb' => 3
72
+ EnforcedHashRocketStyle: key
73
+ # Alignment of entries using colon as separator. Valid values are:
74
+ #
75
+ # key - left alignment of keys
76
+ # a: 0
77
+ # bb: 1
78
+ # separator - alignment of colons, keys are right aligned
79
+ # a: 0
80
+ # bb: 1
81
+ # table - left alignment of keys and values
82
+ # a: 0
83
+ # bb: 1
84
+ EnforcedColonStyle: key
85
+ # Select whether hashes that are the last argument in a method call should be
86
+ # inspected? Valid values are:
87
+ #
88
+ # always_inspect - Inspect both implicit and explicit hashes.
89
+ # Registers an offense for:
90
+ # function(a: 1,
91
+ # b: 2)
92
+ # Registers an offense for:
93
+ # function({a: 1,
94
+ # b: 2})
95
+ # always_ignore - Ignore both implicit and explicit hashes.
96
+ # Accepts:
97
+ # function(a: 1,
98
+ # b: 2)
99
+ # Accepts:
100
+ # function({a: 1,
101
+ # b: 2})
102
+ # ignore_implicit - Ignore only implicit hashes.
103
+ # Accepts:
104
+ # function(a: 1,
105
+ # b: 2)
106
+ # Registers an offense for:
107
+ # function({a: 1,
108
+ # b: 2})
109
+ # ignore_explicit - Ignore only explicit hashes.
110
+ # Accepts:
111
+ # function({a: 1,
112
+ # b: 2})
113
+ # Registers an offense for:
114
+ # function(a: 1,
115
+ # b: 2)
116
+ EnforcedLastArgumentHashStyle: always_inspect
117
+ SupportedLastArgumentHashStyles:
118
+ - always_inspect
119
+ - always_ignore
120
+ - ignore_implicit
121
+ - ignore_explicit
122
+
123
+ # disabled since it can give conflicting advice, specially in inheritance
124
+ # or composition cases,
125
+ Style/Alias:
126
+ Enabled: false
127
+
128
+ Layout/AlignParameters:
129
+ # Alignment of parameters in multi-line method calls.
130
+ #
131
+ # The `with_first_parameter` style aligns the following lines along the same
132
+ # column as the first parameter.
133
+ #
134
+ # method_call(a,
135
+ # b)
136
+ #
137
+ # The `with_fixed_indentation` style aligns the following lines with one
138
+ # level of indentation relative to the start of the line with the method call.
139
+ #
140
+ # method_call(a,
141
+ # b)
142
+ EnforcedStyle: with_fixed_indentation
143
+ SupportedStyles:
144
+ - with_first_parameter
145
+ - with_fixed_indentation
146
+
147
+ Style/AndOr:
148
+ # Whether `and` and `or` are banned only in conditionals (conditionals)
149
+ # or completely (always).
150
+ EnforcedStyle: always
151
+ SupportedStyles:
152
+ - always
153
+ - conditionals
154
+
155
+
156
+ # Checks if usage of %() or %Q() matches configuration.
157
+ Style/BarePercentLiterals:
158
+ EnforcedStyle: bare_percent
159
+ SupportedStyles:
160
+ - percent_q
161
+ - bare_percent
162
+
163
+ Style/BlockDelimiters:
164
+ EnforcedStyle: line_count_based
165
+ SupportedStyles:
166
+ # The `line_count_based` style enforces braces around single line blocks and
167
+ # do..end around multi-line blocks.
168
+ - line_count_based
169
+ # The `semantic` style enforces braces around functional blocks, where the
170
+ # primary purpose of the block is to return a value and do..end for
171
+ # procedural blocks, where the primary purpose of the block is its
172
+ # side-effects.
173
+ #
174
+ # This looks at the usage of a block's method to determine its type (e.g. is
175
+ # the result of a `map` assigned to a variable or passed to another
176
+ # method) but exceptions are permitted in the `ProceduralMethods`,
177
+ # `FunctionalMethods` and `IgnoredMethods` sections below.
178
+ - semantic
179
+ ProceduralMethods:
180
+ # Methods that are known to be procedural in nature but look functional from
181
+ # their usage, e.g.
182
+ #
183
+ # time = Benchmark.realtime do
184
+ # foo.bar
185
+ # end
186
+ #
187
+ # Here, the return value of the block is discarded but the return value of
188
+ # `Benchmark.realtime` is used.
189
+ - benchmark
190
+ - bm
191
+ - bmbm
192
+ - create
193
+ - each_with_object
194
+ - measure
195
+ - new
196
+ - realtime
197
+ - tap
198
+ - with_object
199
+ FunctionalMethods:
200
+ # Methods that are known to be functional in nature but look procedural from
201
+ # their usage, e.g.
202
+ #
203
+ # let(:foo) { Foo.new }
204
+ #
205
+ # Here, the return value of `Foo.new` is used to define a `foo` helper but
206
+ # doesn't appear to be used from the return value of `let`.
207
+ - let
208
+ - let!
209
+ - subject
210
+ - watch
211
+ IgnoredMethods:
212
+ # Methods that can be either procedural or functional and cannot be
213
+ # categorised from their usage alone, e.g.
214
+ #
215
+ # foo = lambda do |x|
216
+ # puts "Hello, #{x}"
217
+ # end
218
+ #
219
+ # foo = lambda do |x|
220
+ # x * 100
221
+ # end
222
+ #
223
+ # Here, it is impossible to tell from the return value of `lambda` whether
224
+ # the inner block's return value is significant.
225
+ - lambda
226
+ - proc
227
+ - it
228
+
229
+ Style/BracesAroundHashParameters:
230
+ EnforcedStyle: no_braces
231
+ SupportedStyles:
232
+ # The `braces` style enforces braces around all method parameters that are
233
+ # hashes.
234
+ - braces
235
+ # The `no_braces` style checks that the last parameter doesn't have braces
236
+ # around it.
237
+ - no_braces
238
+ # The `context_dependent` style checks that the last parameter doesn't have
239
+ # braces around it, but requires braces if the second to last parameter is
240
+ # also a hash literal.
241
+ - context_dependent
242
+
243
+ # Indentation of `when`.
244
+ Layout/CaseIndentation:
245
+ SupportedStyles:
246
+ - case
247
+ - end
248
+ IndentOneStep: false
249
+
250
+ Style/ClassAndModuleChildren:
251
+ Enabled: false
252
+ # Checks the style of children definitions at classes and modules.
253
+ #
254
+ # Basically there are two different styles:
255
+ #
256
+ # `nested` - have each child on a separate line
257
+ # class Foo
258
+ # class Bar
259
+ # end
260
+ # end
261
+ #
262
+ # `compact` - combine definitions as much as possible
263
+ # class Foo::Bar
264
+ # end
265
+ #
266
+ # The compact style is only forced, for classes / modules with one child.
267
+ EnforcedStyle: compact
268
+ SupportedStyles:
269
+ - nested
270
+ - compact
271
+
272
+ Style/ClassCheck:
273
+ EnforcedStyle: is_a?
274
+ SupportedStyles:
275
+ - is_a?
276
+ - kind_of?
277
+
278
+ # Align with the style guide.
279
+ Style/CollectionMethods:
280
+ # Mapping from undesired method to desired_method
281
+ # e.g. to use `detect` over `find`:
282
+ #
283
+ # CollectionMethods:
284
+ # PreferredMethods:
285
+ # find: detect
286
+ PreferredMethods:
287
+ collect: 'map'
288
+ collect!: 'map!'
289
+ inject: 'reduce'
290
+ detect: 'find'
291
+ find_all: 'select'
292
+
293
+ # Use ` or %x around command literals.
294
+ Style/CommandLiteral:
295
+ EnforcedStyle: backticks
296
+ # backticks: Always use backticks.
297
+ # percent_x: Always use %x.
298
+ # mixed: Use backticks on single-line commands, and %x on multi-line commands.
299
+ SupportedStyles:
300
+ - backticks
301
+ - percent_x
302
+ - mixed
303
+ # If false, the cop will always recommend using %x if one or more backticks
304
+ # are found in the command string.
305
+ AllowInnerBackticks: false
306
+
307
+ # Checks formatting of special comments
308
+ Style/CommentAnnotation:
309
+ Keywords:
310
+ - TODO
311
+ - FIXME
312
+ - OPTIMIZE
313
+ - HACK
314
+ - REVIEW
315
+
316
+ Style/AsciiComments:
317
+ Enabled: false
318
+
319
+ # Checks that you have put a copyright in a comment before any code.
320
+ #
321
+ # You can override the default Notice in your .rubocop.yml file.
322
+ #
323
+ # In order to use autocorrect, you must supply a value for the
324
+ # AutocorrectNotice key that matches the regexp Notice. A blank
325
+ # AutocorrectNotice will cause an error during autocorrect.
326
+ #
327
+ # Autocorrect will add a copyright notice in a comment at the top
328
+ # of the file immediately after any shebang or encoding comments.
329
+ #
330
+ # Example rubocop.yml:
331
+ #
332
+ # Style/Copyright:
333
+ # Enabled: true
334
+ # Notice: 'Copyright (\(c\) )?2015 Yahoo! Inc'
335
+ # AutocorrectNotice: '# Copyright (c) 2015 Yahoo! Inc.'
336
+ #
337
+ Style/Copyright:
338
+ Notice: '^Copyright (\(c\) )?2[0-9]{3} .+'
339
+ AutocorrectNotice: ''
340
+
341
+ # Multi-line method chaining should be done with leading dots.
342
+ Layout/DotPosition:
343
+ EnforcedStyle: leading
344
+ SupportedStyles:
345
+ - leading
346
+ - trailing
347
+
348
+ Style/DoubleNegation:
349
+ Enabled: false
350
+
351
+ # Warn on empty else statements
352
+ # empty - warn only on empty else
353
+ # nil - warn on else with nil in it
354
+ # both - warn on empty else and else with nil in it
355
+ Style/EmptyElse:
356
+ EnforcedStyle: both
357
+ SupportedStyles:
358
+ - empty
359
+ - nil
360
+ - both
361
+
362
+ # Use empty lines between defs.
363
+ Layout/EmptyLineBetweenDefs:
364
+ # If true, this parameter means that single line method definitions don't
365
+ # need an empty line between them.
366
+ AllowAdjacentOneLineDefs: false
367
+
368
+ Layout/EmptyLineAfterMagicComment:
369
+ Enabled: false
370
+
371
+ Layout/EmptyLinesAroundBlockBody:
372
+ EnforcedStyle: no_empty_lines
373
+ SupportedStyles:
374
+ - empty_lines
375
+ - no_empty_lines
376
+
377
+ Layout/EmptyLinesAroundClassBody:
378
+ EnforcedStyle: no_empty_lines
379
+ SupportedStyles:
380
+ - empty_lines
381
+ - no_empty_lines
382
+
383
+ Layout/EmptyLinesAroundModuleBody:
384
+ EnforcedStyle: no_empty_lines
385
+ SupportedStyles:
386
+ - empty_lines
387
+ - no_empty_lines
388
+
389
+ # Checks whether the source file has a utf-8 encoding comment or not
390
+ # AutoCorrectEncodingComment must match the regex
391
+ # /#.*coding\s?[:=]\s?(?:UTF|utf)-8/
392
+ Style/Encoding:
393
+ EnforcedStyle: when_needed
394
+ SupportedStyles:
395
+ - when_needed
396
+ - always
397
+ AutoCorrectEncodingComment: '# encoding: utf-8'
398
+
399
+ Style/FileName:
400
+ # File names listed in AllCops:Include are excluded by default. Add extra
401
+ # excludes here.
402
+ Exclude: []
403
+
404
+ Layout/FirstParameterIndentation:
405
+ EnforcedStyle: special_for_inner_method_call_in_parentheses
406
+ SupportedStyles:
407
+ # The first parameter should always be indented one step more than the
408
+ # preceding line.
409
+ - consistent
410
+ # The first parameter should normally be indented one step more than the
411
+ # preceding line, but if it's a parameter for a method call that is itself
412
+ # a parameter in a method call, then the inner parameter should be indented
413
+ # relative to the inner method.
414
+ - special_for_inner_method_call
415
+ # Same as special_for_inner_method_call except that the special rule only
416
+ # applies if the outer method call encloses its arguments in parentheses.
417
+ - special_for_inner_method_call_in_parentheses
418
+
419
+ Style/EmptyMethod:
420
+ EnforcedStyle: expanded
421
+ SupportedStyles:
422
+ - compact
423
+ - expanded
424
+
425
+ # Checks use of for or each in multiline loops.
426
+ Style/For:
427
+ EnforcedStyle: each
428
+ SupportedStyles:
429
+ - for
430
+ - each
431
+
432
+ # Enforce the method used for string formatting.
433
+ Style/FormatString:
434
+ EnforcedStyle: format
435
+ SupportedStyles:
436
+ - format
437
+ - sprintf
438
+ - percent
439
+
440
+ # Enforce using either `%<token>s` or `%{token}`
441
+ Style/FormatStringToken:
442
+ EnforcedStyle: annotated
443
+ SupportedStyles:
444
+ # Prefer tokens which contain a sprintf like type annotation like
445
+ # `%<name>s`, `%<age>d`, `%<score>f`
446
+ - annotated
447
+ # Prefer simple looking "template" style tokens like `%{name}`, `%{age}`
448
+ - template
449
+
450
+ Style/FrozenStringLiteralComment:
451
+ EnforcedStyle: when_needed
452
+ SupportedStyles:
453
+ # `when_needed` will add the frozen string literal comment to files
454
+ # only when the `TargetRubyVersion` is set to 2.3+.
455
+ - when_needed
456
+ # `always` will always add the frozen string literal comment to a file
457
+ # regardless of the Ruby version or if `freeze` or `<<` are called on a
458
+ # string literal. If you run code against multiple versions of Ruby, it is
459
+ # possible that this will create errors in Ruby 2.3.0+.
460
+ - always
461
+ # `never` will enforce that the frozen string literal comment does not
462
+ # exist in a file.
463
+ - never
464
+
465
+ # Built-in global variables are allowed by default.
466
+ Style/GlobalVars:
467
+ AllowedVariables: []
468
+
469
+ Style/HashSyntax:
470
+ EnforcedStyle: ruby19
471
+ SupportedStyles:
472
+ - ruby19
473
+ - ruby19_no_mixed_keys
474
+ - hash_rockets
475
+ # Force hashes that have a symbol value to use hash rockets
476
+ UseHashRocketsWithSymbolValues: false
477
+
478
+ Style/IfUnlessModifier:
479
+ MaxLineLength: 80
480
+
481
+ Layout/IndentationConsistency:
482
+ # The difference between `rails` and `normal` is that the `rails` style
483
+ # prescribes that in classes and modules the `protected` and `private`
484
+ # modifier keywords shall be indented the same as public methods and that
485
+ # protected and private members shall be indented one step more than the
486
+ # modifiers. Other than that, both styles mean that entities on the same
487
+ # logical depth shall have the same indentation.
488
+ EnforcedStyle: normal
489
+ SupportedStyles:
490
+ - normal
491
+ - rails
492
+
493
+ Layout/IndentationWidth:
494
+ # Number of spaces for each indentation level.
495
+ Width: 2
496
+
497
+ # Checks the indentation of the first key in a hash literal.
498
+ Layout/IndentHash:
499
+ # The value `special_inside_parentheses` means that hash literals with braces
500
+ # that have their opening brace on the same line as a surrounding opening
501
+ # round parenthesis, shall have their first key indented relative to the
502
+ # first position inside the parenthesis.
503
+ # The value `consistent` means that the indentation of the first key shall
504
+ # always be relative to the first position of the line where the opening
505
+ # brace is.
506
+ EnforcedStyle: special_inside_parentheses
507
+ SupportedStyles:
508
+ - special_inside_parentheses
509
+ - consistent
510
+
511
+ Style/Lambda:
512
+ EnforcedStyle: literal
513
+
514
+ Style/LambdaCall:
515
+ EnforcedStyle: call
516
+ SupportedStyles:
517
+ - call
518
+ - braces
519
+
520
+ Style/Next:
521
+ # With `always` all conditions at the end of an iteration needs to be
522
+ # replaced by next - with `skip_modifier_ifs` the modifier if like this one
523
+ # are ignored: [1, 2].each { |a| return 'yes' if a == 1 }
524
+ EnforcedStyle: skip_modifier_ifs
525
+ # `MinBodyLength` defines the number of lines of the a body of an if / unless
526
+ # needs to have to trigger this cop
527
+ MinBodyLength: 3
528
+ SupportedStyles:
529
+ - skip_modifier_ifs
530
+ - always
531
+
532
+ Style/NonNilCheck:
533
+ # With `IncludeSemanticChanges` set to `true`, this cop reports offenses for
534
+ # `!x.nil?` and autocorrects that and `x != nil` to solely `x`, which is
535
+ # **usually** OK, but might change behavior.
536
+ #
537
+ # With `IncludeSemanticChanges` set to `false`, this cop does not report
538
+ # offenses for `!x.nil?` and does no changes that might change behavior.
539
+ IncludeSemanticChanges: false
540
+
541
+ Style/MethodDefParentheses:
542
+ EnforcedStyle: require_parentheses
543
+ SupportedStyles:
544
+ - require_parentheses
545
+ - require_no_parentheses
546
+
547
+ Style/MethodName:
548
+ EnforcedStyle: snake_case
549
+ SupportedStyles:
550
+ - snake_case
551
+ - camelCase
552
+
553
+ Layout/MultilineOperationIndentation:
554
+ EnforcedStyle: aligned
555
+ SupportedStyles:
556
+ - aligned
557
+ - indented
558
+
559
+ Style/NumericLiterals:
560
+ MinDigits: 5
561
+
562
+ # Allow safe assignment in conditions.
563
+ Style/ParenthesesAroundCondition:
564
+ AllowSafeAssignment: true
565
+
566
+ Style/PercentLiteralDelimiters:
567
+ PreferredDelimiters:
568
+ '%': ()
569
+ '%i': '[]'
570
+ '%q': ()
571
+ '%Q': ()
572
+ '%r': '{}'
573
+ '%s': ()
574
+ '%w': '[]'
575
+ '%W': ()
576
+ '%x': ()
577
+
578
+ Style/PercentQLiterals:
579
+ EnforcedStyle: lower_case_q
580
+ SupportedStyles:
581
+ - lower_case_q # Use %q when possible, %Q when necessary
582
+ - upper_case_q # Always use %Q
583
+
584
+ Style/PredicateName:
585
+ # Predicate name prefices.
586
+ NamePrefix:
587
+ - is_
588
+ - has_
589
+ - have_
590
+ # Predicate name prefices that should be removed.
591
+ NamePrefixBlacklist:
592
+ - is_
593
+ - has_
594
+ - have_
595
+
596
+ Style/RaiseArgs:
597
+ Severity: warning
598
+ EnforcedStyle: exploded
599
+ SupportedStyles:
600
+ - compact # raise Exception.new(msg)
601
+ - exploded # raise Exception, msg
602
+
603
+ Style/RedundantReturn:
604
+ # When true allows code like `return x, y`.
605
+ AllowMultipleReturnValues: false
606
+
607
+ # Use / or %r around regular expressions.
608
+ Style/RegexpLiteral:
609
+ EnforcedStyle: slashes
610
+ # slashes: Always use slashes.
611
+ # percent_r: Always use %r.
612
+ # mixed: Use slashes on single-line regexes, and %r on multi-line regexes.
613
+ SupportedStyles:
614
+ - slashes
615
+ - percent_r
616
+ - mixed
617
+ # If false, the cop will always recommend using %r if one or more slashes
618
+ # are found in the regexp string.
619
+ AllowInnerSlashes: false
620
+
621
+ Style/SafeNavigation:
622
+ Enabled: false
623
+ # Safe navigation may cause a statement to start returning `nil` in addition
624
+ # to whatever it used to return.
625
+ ConvertCodeThatCanStartToReturnNil: false
626
+
627
+ Style/Semicolon:
628
+ # Allow ; to separate several expressions on the same line.
629
+ AllowAsExpressionSeparator: false
630
+
631
+ Style/SignalException:
632
+ EnforcedStyle: only_raise
633
+ SupportedStyles:
634
+ - only_raise
635
+ - only_fail
636
+ - semantic
637
+
638
+ Style/SingleLineBlockParams:
639
+ Methods:
640
+ - reduce:
641
+ - a
642
+ - e
643
+ - inject:
644
+ - a
645
+ - e
646
+
647
+ Style/SingleLineMethods:
648
+ AllowIfMethodIsEmpty: true
649
+
650
+ Style/StringLiterals:
651
+ EnforcedStyle: single_quotes
652
+ SupportedStyles:
653
+ - single_quotes
654
+ - double_quotes
655
+
656
+ Style/StringLiteralsInInterpolation:
657
+ EnforcedStyle: single_quotes
658
+ SupportedStyles:
659
+ - single_quotes
660
+ - double_quotes
661
+
662
+ Layout/SpaceAroundBlockParameters:
663
+ EnforcedStyleInsidePipes: no_space
664
+ SupportedStylesInsidePipes:
665
+ - space
666
+ - no_space
667
+
668
+ Layout/SpaceAroundEqualsInParameterDefault:
669
+ EnforcedStyle: space
670
+ SupportedStyles:
671
+ - space
672
+ - no_space
673
+
674
+ Layout/SpaceAroundOperators:
675
+ # When true, allows most uses of extra spacing if the intent is to align
676
+ # with an operator on the previous or next line, not counting empty lines
677
+ # or comment lines.
678
+ AllowForAlignment: true
679
+
680
+ Layout/SpaceBeforeBlockBraces:
681
+ EnforcedStyle: space
682
+ SupportedStyles:
683
+ - space
684
+ - no_space
685
+
686
+ Layout/SpaceInsideBlockBraces:
687
+ EnforcedStyle: space
688
+ SupportedStyles:
689
+ - space
690
+ - no_space
691
+ # Valid values are: space, no_space
692
+ EnforcedStyleForEmptyBraces: no_space
693
+ # Space between { and |. Overrides EnforcedStyle if there is a conflict.
694
+ SpaceBeforeBlockParameters: true
695
+
696
+ Layout/SpaceInsideHashLiteralBraces:
697
+ EnforcedStyle: space
698
+ EnforcedStyleForEmptyBraces: no_space
699
+ SupportedStyles:
700
+ - space
701
+ - no_space
702
+
703
+ Style/SymbolProc:
704
+ # A list of method names to be ignored by the check.
705
+ # The names should be fairly unique, otherwise you'll end up ignoring lots of code.
706
+ IgnoredMethods:
707
+ - respond_to
708
+
709
+ Layout/TrailingBlankLines:
710
+ EnforcedStyle: final_newline
711
+ SupportedStyles:
712
+ - final_newline
713
+ - final_blank_line
714
+
715
+ Style/TrailingCommaInLiteral:
716
+ # If EnforcedStyleForMultiline is comma, the cop requires a comma after the
717
+ # last item of a list, but only for lists where each item is on its own line.
718
+ # If EnforcedStyleForMultiline is consistent_comma, the cop requires a comma
719
+ # after the last item of a list, for all lists.
720
+ EnforcedStyleForMultiline: no_comma
721
+ SupportedStylesForMultiline:
722
+ - comma
723
+ - consistent_comma
724
+ - no_comma
725
+
726
+ Style/TrailingCommaInArguments:
727
+ # If EnforcedStyleForMultiline is comma, the cop requires a comma after the
728
+ # last item of a list, but only for lists where each item is on its own line.
729
+ # If EnforcedStyleForMultiline is consistent_comma, the cop requires a comma
730
+ # after the last item of a list, for all lists.
731
+ EnforcedStyleForMultiline: no_comma
732
+ SupportedStylesForMultiline:
733
+ - comma
734
+ - consistent_comma
735
+ - no_comma
736
+
737
+ # TrivialAccessors requires exact name matches and doesn't allow
738
+ # predicated methods by default.
739
+ Style/TrivialAccessors:
740
+ # When set to false the cop will suggest the use of accessor methods
741
+ # in situations like:
742
+ #
743
+ # def name
744
+ # @other_name
745
+ # end
746
+ #
747
+ # This way you can uncover "hidden" attributes in your code.
748
+ ExactNameMatch: true
749
+ AllowPredicates: false
750
+ # Allows trivial writers that don't end in an equal sign. e.g.
751
+ #
752
+ # def on_exception(action)
753
+ # @on_exception=action
754
+ # end
755
+ # on_exception :restart
756
+ #
757
+ # Commonly used in DSLs
758
+ AllowDSLWriters: false
759
+ IgnoreClassMethods: false
760
+ Whitelist:
761
+ - to_ary
762
+ - to_a
763
+ - to_c
764
+ - to_enum
765
+ - to_h
766
+ - to_hash
767
+ - to_i
768
+ - to_int
769
+ - to_io
770
+ - to_open
771
+ - to_path
772
+ - to_proc
773
+ - to_r
774
+ - to_regexp
775
+ - to_str
776
+ - to_s
777
+ - to_sym
778
+
779
+ Style/VariableName:
780
+ EnforcedStyle: snake_case
781
+ SupportedStyles:
782
+ - snake_case
783
+ - camelCase
784
+
785
+ Style/WhileUntilModifier:
786
+ MaxLineLength: 80
787
+
788
+ Style/WordArray:
789
+ MinSize: 0
790
+ # The regular expression WordRegex decides what is considered a word.
791
+ WordRegex: !ruby/regexp '/\A[\p{Word}]+\z/'
792
+
793
+ ##################### Metrics ##################################
794
+
795
+ Metrics/AbcSize:
796
+ Severity: warning
797
+ # The ABC size is a calculated magnitude, so this number can be a Fixnum or
798
+ # a Float.
799
+ Max: 25
800
+ Exclude:
801
+ - 'db/**/*.rb'
802
+
803
+ Metrics/BlockNesting:
804
+ Max: 3
805
+
806
+ Metrics/BlockLength:
807
+ Exclude:
808
+ - 'Rakefile'
809
+ - '**/*.rake'
810
+ - 'spec/factories/*.rb'
811
+ - 'spec/**/*_spec.rb'
812
+ - 'app/admin/**/*'
813
+ - 'app/indices/**/*.rb'
814
+
815
+ # Second-wave metric. Disabled now to prevent noise.
816
+ Metrics/ClassLength:
817
+ Enabled: false
818
+ CountComments: false # count full line comments?
819
+ Max: 100
820
+
821
+ # Second-wave metric. Disabled now to prevent noise.
822
+ Metrics/ModuleLength:
823
+ Enabled: false
824
+ CountComments: false # count full line comments?
825
+ Max: 100
826
+
827
+ # Avoid complex methods.
828
+ Metrics/CyclomaticComplexity:
829
+ Max: 6
830
+
831
+ # Second-wave metric. Disabled now to prevent noise.
832
+ Metrics/LineLength:
833
+ Enabled: false
834
+ Max: 120
835
+ # To make it possible to copy or click on URIs in the code, we allow lines
836
+ # contaning a URI to be longer than Max.
837
+ AllowURI: true
838
+ URISchemes:
839
+ - http
840
+ - https
841
+
842
+ # Second-wave metric. Disabled now to prevent noise.
843
+ Metrics/MethodLength:
844
+ Enabled: false
845
+ Severity: warning
846
+ CountComments: false # count full line comments?
847
+ Max: 20
848
+
849
+ Metrics/ParameterLists:
850
+ Max: 5
851
+ CountKeywordArgs: true
852
+
853
+ Metrics/PerceivedComplexity:
854
+ Max: 7
855
+
856
+ ##################### Lint ##################################
857
+
858
+ # Allow safe assignment in conditions.
859
+ Lint/AssignmentInCondition:
860
+ AllowSafeAssignment: true
861
+
862
+ # Align ends correctly.
863
+ Lint/EndAlignment:
864
+ # The value `keyword` means that `end` should be aligned with the matching
865
+ # keyword (if, while, etc.).
866
+ # The value `variable` means that in assignments, `end` should be aligned
867
+ # with the start of the variable on the left hand side of `=`. In all other
868
+ # situations, `end` should still be aligned with the keyword.
869
+ EnforcedStyleAlignWith: keyword
870
+ SupportedStylesAlignWith:
871
+ - keyword
872
+ - variable
873
+ - start_of_line
874
+ AutoCorrect: false
875
+
876
+ Lint/DefEndAlignment:
877
+ # The value `def` means that `end` should be aligned with the def keyword.
878
+ # The value `start_of_line` means that `end` should be aligned with method
879
+ # calls like `private`, `public`, etc, if present in front of the `def`
880
+ # keyword on the same line.
881
+ EnforcedStyleAlignWith: start_of_line
882
+ SupportedStylesAlignWith:
883
+ - start_of_line
884
+ - def
885
+ AutoCorrect: false
886
+
887
+ ##################### Rails ##################################
888
+ Rails:
889
+ Enabled: true
890
+
891
+ Rails/ActionFilter:
892
+ EnforcedStyle: action
893
+ SupportedStyles:
894
+ - action
895
+ - filter
896
+ Include:
897
+ - app/controllers/**/*.rb
898
+
899
+ Rails/Blank:
900
+ Enabled: true
901
+ # Convert checks for `nil` or `empty?` to `blank?`
902
+ NilOrEmpty: true
903
+ # Convert usages of not `present?` to `blank?`
904
+ NotPresent: true
905
+ # Convert usages of `unless` `present?` to `if` `blank?`
906
+ UnlessPresent: false
907
+
908
+ Rails/Date:
909
+ # The value `always` disallows usage of `Date.today`, `Date.current`,
910
+ # `Date#to_time` etc.
911
+ # The value `acceptable` allows usage of `Date.current`, `Date.yesterday`, etc
912
+ # (but not `Date.today`) which are overriden by ActiveSupport to handle current
913
+ # time zone.
914
+ EnforcedStyle: flexible
915
+ SupportedStyles:
916
+ - strict
917
+ - flexible
918
+
919
+ Rails/FindBy:
920
+ Enabled: false
921
+ Include:
922
+ - app/models/**/*.rb
923
+ - app/controllers/**/*.rb
924
+ - app/observers/**/*.rb
925
+ - app/services/**/*.rb
926
+ - app/mailers/**/*.rb
927
+ - app/helpers/**/*.rb
928
+ - app/policies/**/*.rb
929
+ - lib/**/*.rb
930
+
931
+ Rails/FindEach:
932
+ Include:
933
+ - app/models/**/*.rb
934
+ - app/controllers/**/*.rb
935
+ - app/observers/**/*.rb
936
+ - app/services/**/*.rb
937
+ - app/mailers/**/*.rb
938
+ - app/helpers/**/*.rb
939
+ - app/policies/**/*.rb
940
+ - lib/**/*.rb
941
+
942
+ Rails/HasAndBelongsToMany:
943
+ Include:
944
+ - app/models/**/*.rb
945
+
946
+ Rails/Output:
947
+ Include:
948
+ - app/**/*.rb
949
+ - config/**/*.rb
950
+ - db/**/*.rb
951
+ - lib/**/*.rb
952
+
953
+ Rails/ReadWriteAttribute:
954
+ Include:
955
+ - app/models/**/*.rb
956
+
957
+ Rails/ScopeArgs:
958
+ Include:
959
+ - app/models/**/*.rb
960
+
961
+ Rails/TimeZone:
962
+ # The value `always` means that `Time` should be used with `zone`.
963
+ # The value `acceptable` allows usage of `in_time_zone` instead of `zone`.
964
+ EnforcedStyle: flexible
965
+ SupportedStyles:
966
+ - strict
967
+ - flexible
968
+
969
+ Rails/Validation:
970
+ Include:
971
+ - app/models/**/*.rb