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