ga4-rails 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/.rubocop.yml ADDED
@@ -0,0 +1,1590 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.6.0
3
+ Exclude:
4
+ - 'bin/*'
5
+ - 'db/**/*'
6
+ - 'Rakefile'
7
+ - 'app/controllers/exception_handler/*'
8
+ - 'vendor/**/*'
9
+ - 'tmp/**/*'
10
+ - 'log/**/*'
11
+ - 'spec/spec_helper.rb'
12
+ - 'spec/databases/*'
13
+ # Default formatter will be used if no `-f/--format` option is given.
14
+ DefaultFormatter: progress
15
+ # Cop names are displayed in offense messages by default. Change behavior
16
+ # by overriding DisplayCopNames, or by giving the `--no-display-cop-names`
17
+ # option.
18
+ DisplayCopNames: true
19
+ # Style guide URLs are not displayed in offense messages by default. Change
20
+ # behavior by overriding `DisplayStyleGuide`, or by giving the
21
+ # `-S/--display-style-guide` option.
22
+ DisplayStyleGuide: false
23
+ # When specifying style guide URLs, any paths and/or fragments will be
24
+ # evaluated relative to the base URL.
25
+ StyleGuideBaseURL: https://github.com/bbatsov/ruby-style-guide
26
+ # Extra details are not displayed in offense messages by default. Change
27
+ # behavior by overriding ExtraDetails, or by giving the
28
+ # `-E/--extra-details` option.
29
+ ExtraDetails: false
30
+ # Additional cops that do not reference a style guide rule may be enabled by
31
+ # default. Change behavior by overriding `StyleGuideCopsOnly`, or by giving
32
+ # the `--only-guide-cops` option.
33
+ StyleGuideCopsOnly: false
34
+ # All cops except the ones in disabled.yml are enabled by default. Change
35
+ # this behavior by overriding either `DisabledByDefault` or `EnabledByDefault`.
36
+ # When `DisabledByDefault` is `true`, all cops in the default configuration
37
+ # are disabled, and only cops in user configuration are enabled. This makes
38
+ # cops opt-in instead of opt-out. Note that when `DisabledByDefault` is `true`,
39
+ # cops in user configuration will be enabled even if they don't set the
40
+ # Enabled parameter.
41
+ # When `EnabledByDefault` is `true`, all cops, even those in disabled.yml,
42
+ # are enabled by default. Cops can still be disabled in user configuration.
43
+ # Note that it is invalid to set both EnabledByDefault and DisabledByDefault
44
+ # to true in the same configuration.
45
+ EnabledByDefault: false
46
+ DisabledByDefault: false
47
+ # Enables the result cache if `true`. Can be overridden by the `--cache` command
48
+ # line option.
49
+ UseCache: true
50
+ # Threshold for how many files can be stored in the result cache before some
51
+ # of the files are automatically removed.
52
+ MaxFilesInCache: 20000
53
+ # The cache will be stored in "rubocop_cache" under this directory. If
54
+ # CacheRootDirectory is ~ (nil), which it is by default, the root will be
55
+ # taken from the environment variable `$XDG_CACHE_HOME` if it is set, or if
56
+ # `$XDG_CACHE_HOME` is not set, it will be `$HOME/.cache/`.
57
+ CacheRootDirectory: ~
58
+ # It is possible for a malicious user to know the location of RuboCop's cache
59
+ # directory by looking at CacheRootDirectory, and create a symlink in its
60
+ # place that could cause RuboCop to overwrite unintended files, or read
61
+ # malicious input. If you are certain that your cache location is secure from
62
+ # this kind of attack, and wish to use a symlinked cache location, set this
63
+ # value to "true".
64
+ AllowSymlinksInCacheRootDirectory: false
65
+ # What MRI version of the Ruby interpreter is the inspected code intended to
66
+ # run on? (If there is more than one, set this to the lowest version.)
67
+ # If a value is specified for TargetRubyVersion then it is used.
68
+ # Else if .ruby-version exists and it contains an MRI version it is used.
69
+ # Otherwise we fallback to the oldest officially supported Ruby version (2.1).
70
+
71
+ #################### Layout ###########################
72
+
73
+ # Indent private/protected/public as deep as method definitions
74
+ Layout/AccessModifierIndentation:
75
+ EnforcedStyle: indent
76
+ SupportedStyles:
77
+ - outdent
78
+ - indent
79
+ # By default, the indentation width from Layout/IndentationWidth is used
80
+ # But it can be overridden by setting this parameter
81
+ # IndentationWidth: ~
82
+
83
+ # Align the elements of a array literal if they span more than one line.
84
+ Layout/ArrayAlignment:
85
+ Enabled: false
86
+
87
+ # Align the elements of a hash literal if they span more than one line.
88
+ Layout/HashAlignment:
89
+ Enabled: false
90
+ # Alignment of entries using hash rocket as separator. Valid values are:
91
+ #
92
+ # key - left alignment of keys
93
+ # 'a' => 2
94
+ # 'bb' => 3
95
+ # separator - alignment of hash rockets, keys are right aligned
96
+ # 'a' => 2
97
+ # 'bb' => 3
98
+ # table - left alignment of keys, hash rockets, and values
99
+ # 'a' => 2
100
+ # 'bb' => 3
101
+ EnforcedHashRocketStyle: key
102
+ SupportedHashRocketStyles:
103
+ - key
104
+ - separator
105
+ - table
106
+ # Alignment of entries using colon as separator. Valid values are:
107
+ #
108
+ # key - left alignment of keys
109
+ # a: 0
110
+ # bb: 1
111
+ # separator - alignment of colons, keys are right aligned
112
+ # a: 0
113
+ # bb: 1
114
+ # table - left alignment of keys and values
115
+ # a: 0
116
+ # bb: 1
117
+ EnforcedColonStyle: key
118
+ SupportedColonStyles:
119
+ - key
120
+ - separator
121
+ - table
122
+ # Select whether hashes that are the last argument in a method call should be
123
+ # inspected? Valid values are:
124
+ #
125
+ # always_inspect - Inspect both implicit and explicit hashes.
126
+ # Registers an offense for:
127
+ # function(a: 1,
128
+ # b: 2)
129
+ # Registers an offense for:
130
+ # function({a: 1,
131
+ # b: 2})
132
+ # always_ignore - Ignore both implicit and explicit hashes.
133
+ # Accepts:
134
+ # function(a: 1,
135
+ # b: 2)
136
+ # Accepts:
137
+ # function({a: 1,
138
+ # b: 2})
139
+ # ignore_implicit - Ignore only implicit hashes.
140
+ # Accepts:
141
+ # function(a: 1,
142
+ # b: 2)
143
+ # Registers an offense for:
144
+ # function({a: 1,
145
+ # b: 2})
146
+ # ignore_explicit - Ignore only explicit hashes.
147
+ # Accepts:
148
+ # function({a: 1,
149
+ # b: 2})
150
+ # Registers an offense for:
151
+ # function(a: 1,
152
+ # b: 2)
153
+ EnforcedLastArgumentHashStyle: always_inspect
154
+ SupportedLastArgumentHashStyles:
155
+ - always_inspect
156
+ - always_ignore
157
+ - ignore_implicit
158
+ - ignore_explicit
159
+
160
+ Layout/ParameterAlignment:
161
+ # Alignment of parameters in multi-line method calls.
162
+ #
163
+ # The `with_first_parameter` style aligns the following lines along the same
164
+ # column as the first parameter.
165
+ #
166
+ # method_call(a,
167
+ # b)
168
+ #
169
+ # The `with_fixed_indentation` style aligns the following lines with one
170
+ # level of indentation relative to the start of the line with the method call.
171
+ #
172
+ # method_call(a,
173
+ # b)
174
+ EnforcedStyle: with_fixed_indentation
175
+ SupportedStyles:
176
+ - with_first_parameter
177
+ - with_fixed_indentation
178
+ # By default, the indentation width from Layout/IndentationWidth is used
179
+ # But it can be overridden by setting this parameter
180
+ IndentationWidth: ~
181
+
182
+ Layout/ArgumentAlignment:
183
+ EnforcedStyle: with_fixed_indentation
184
+ SupportedStyles:
185
+ - with_first_argument
186
+ - with_fixed_indentation
187
+
188
+ # Indentation of `when`.
189
+ Layout/CaseIndentation:
190
+ EnforcedStyle: case
191
+ SupportedStyles:
192
+ - case
193
+ - end
194
+ IndentOneStep: false
195
+ # By default, the indentation width from `Layout/IndentationWidth` is used.
196
+ # But it can be overridden by setting this parameter.
197
+ # This only matters if `IndentOneStep` is `true`
198
+ IndentationWidth: ~
199
+
200
+ # Multi-line method chaining should be done with leading dots.
201
+ Layout/DotPosition:
202
+ EnforcedStyle: trailing
203
+ SupportedStyles:
204
+ - leading
205
+ - trailing
206
+
207
+ # Use empty lines between defs.
208
+ Layout/EmptyLineBetweenDefs:
209
+ # If `true`, this parameter means that single line method definitions don't
210
+ # need an empty line between them.
211
+ AllowAdjacentOneLineDefs: false
212
+ # Can be array to specify minimum and maximum number of empty lines, e.g. [1, 2]
213
+ NumberOfEmptyLines: 1
214
+
215
+ Layout/EmptyLinesAroundBlockBody:
216
+ EnforcedStyle: no_empty_lines
217
+ SupportedStyles:
218
+ - empty_lines
219
+ - no_empty_lines
220
+
221
+ Layout/EmptyLinesAroundClassBody:
222
+ EnforcedStyle: no_empty_lines
223
+ SupportedStyles:
224
+ - empty_lines
225
+ - empty_lines_except_namespace
226
+ - empty_lines_special
227
+ - no_empty_lines
228
+
229
+ Layout/EmptyLinesAroundModuleBody:
230
+ EnforcedStyle: no_empty_lines
231
+ SupportedStyles:
232
+ - empty_lines
233
+ - empty_lines_except_namespace
234
+ - empty_lines_special
235
+ - no_empty_lines
236
+
237
+ Layout/EndOfLine:
238
+ # The `native` style means that CR+LF (Carriage Return + Line Feed) is
239
+ # enforced on Windows, and LF is enforced on other platforms. The other styles
240
+ # mean LF and CR+LF, respectively.
241
+ EnforcedStyle: native
242
+ SupportedStyles:
243
+ - native
244
+ - lf
245
+ - crlf
246
+
247
+ Layout/ExtraSpacing:
248
+ # When true, allows most uses of extra spacing if the intent is to align
249
+ # things with the previous or next line, not counting empty lines or comment
250
+ # lines.
251
+ AllowForAlignment: true
252
+ # When true, forces the alignment of `=` in assignments on consecutive lines.
253
+ ForceEqualSignAlignment: false
254
+
255
+ Layout/FirstParameterIndentation:
256
+ EnforcedStyle: consistent
257
+ SupportedStyles:
258
+ - consistent
259
+ - align_parentheses
260
+ IndentationWidth: ~
261
+
262
+ Layout/IndentationConsistency:
263
+ # The difference between `rails` and `normal` is that the `rails` style
264
+ # prescribes that in classes and modules the `protected` and `private`
265
+ # modifier keywords shall be indented the same as public methods and that
266
+ # protected and private members shall be indented one step more than the
267
+ # modifiers. Other than that, both styles mean that entities on the same
268
+ # logical depth shall have the same indentation.
269
+ EnforcedStyle: normal
270
+ SupportedStyles:
271
+ - normal
272
+ - rails
273
+
274
+ Layout/IndentationWidth:
275
+ # Number of spaces for each indentation level.
276
+ Width: 2
277
+ IgnoredPatterns: []
278
+
279
+ # Checks the indentation of the first element in an array literal.
280
+ Layout/FirstArrayElementIndentation:
281
+ # The value `special_inside_parentheses` means that array literals with
282
+ # brackets that have their opening bracket on the same line as a surrounding
283
+ # opening round parenthesis, shall have their first element indented relative
284
+ # to the first position inside the parenthesis.
285
+ #
286
+ # The value `consistent` means that the indentation of the first element shall
287
+ # always be relative to the first position of the line where the opening
288
+ # bracket is.
289
+ #
290
+ # The value `align_brackets` means that the indentation of the first element
291
+ # shall always be relative to the position of the opening bracket.
292
+ EnforcedStyle: special_inside_parentheses
293
+ SupportedStyles:
294
+ - special_inside_parentheses
295
+ - consistent
296
+ - align_brackets
297
+ # By default, the indentation width from `Layout/IndentationWidth` is used
298
+ # But it can be overridden by setting this parameter
299
+ IndentationWidth: ~
300
+
301
+ # Checks the indentation of assignment RHS, when on a different line from LHS
302
+ Layout/AssignmentIndentation:
303
+ # By default, the indentation width from `Layout/IndentationWidth` is used
304
+ # But it can be overridden by setting this parameter
305
+ IndentationWidth: ~
306
+
307
+ # Checks the indentation of the first key in a hash literal.
308
+ Layout/FirstHashElementIndentation:
309
+ # The value `special_inside_parentheses` means that hash literals with braces
310
+ # that have their opening brace on the same line as a surrounding opening
311
+ # round parenthesis, shall have their first key indented relative to the
312
+ # first position inside the parenthesis.
313
+ #
314
+ # The value `consistent` means that the indentation of the first key shall
315
+ # always be relative to the first position of the line where the opening
316
+ # brace is.
317
+ #
318
+ # The value `align_braces` means that the indentation of the first key shall
319
+ # always be relative to the position of the opening brace.
320
+ EnforcedStyle: special_inside_parentheses
321
+ SupportedStyles:
322
+ - special_inside_parentheses
323
+ - consistent
324
+ - align_braces
325
+ # By default, the indentation width from `Layout/IndentationWidth` is used
326
+ # But it can be overridden by setting this parameter
327
+ IndentationWidth: ~
328
+
329
+ # Layout/HeredocIndentation:
330
+ # EnforcedStyle: squiggly
331
+ # SupportedStyles:
332
+ # - squiggly
333
+ # - active_support
334
+ # - powerpack
335
+ # - unindent
336
+
337
+ Layout/SpaceInLambdaLiteral:
338
+ EnforcedStyle: require_no_space
339
+ SupportedStyles:
340
+ - require_no_space
341
+ - require_space
342
+
343
+ Layout/MultilineArrayBraceLayout:
344
+ EnforcedStyle: symmetrical
345
+ SupportedStyles:
346
+ # symmetrical: closing brace is positioned in same way as opening brace
347
+ # new_line: closing brace is always on a new line
348
+ # same_line: closing brace is always on the same line as last element
349
+ - symmetrical
350
+ - new_line
351
+ - same_line
352
+
353
+ Layout/MultilineAssignmentLayout:
354
+ # The types of assignments which are subject to this rule.
355
+ SupportedTypes:
356
+ - block
357
+ - case
358
+ - class
359
+ - if
360
+ - kwbegin
361
+ - module
362
+ EnforcedStyle: new_line
363
+ SupportedStyles:
364
+ # Ensures that the assignment operator and the rhs are on the same line for
365
+ # the set of supported types.
366
+ - same_line
367
+ # Ensures that the assignment operator and the rhs are on separate lines
368
+ # for the set of supported types.
369
+ - new_line
370
+
371
+ Layout/MultilineHashBraceLayout:
372
+ EnforcedStyle: symmetrical
373
+ SupportedStyles:
374
+ # symmetrical: closing brace is positioned in same way as opening brace
375
+ # new_line: closing brace is always on a new line
376
+ # same_line: closing brace is always on same line as last element
377
+ - symmetrical
378
+ - new_line
379
+ - same_line
380
+
381
+ Layout/MultilineMethodCallBraceLayout:
382
+ EnforcedStyle: symmetrical
383
+ SupportedStyles:
384
+ # symmetrical: closing brace is positioned in same way as opening brace
385
+ # new_line: closing brace is always on a new line
386
+ # same_line: closing brace is always on the same line as last argument
387
+ - symmetrical
388
+ - new_line
389
+ - same_line
390
+
391
+ Layout/MultilineMethodCallIndentation:
392
+ EnforcedStyle: indented
393
+ SupportedStyles:
394
+ - aligned
395
+ - indented
396
+ - indented_relative_to_receiver
397
+ # By default, the indentation width from Layout/IndentationWidth is used
398
+ # But it can be overridden by setting this parameter
399
+ IndentationWidth: ~
400
+
401
+ Layout/MultilineMethodDefinitionBraceLayout:
402
+ EnforcedStyle: symmetrical
403
+ SupportedStyles:
404
+ # symmetrical: closing brace is positioned in same way as opening brace
405
+ # new_line: closing brace is always on a new line
406
+ # same_line: closing brace is always on the same line as last parameter
407
+ - symmetrical
408
+ - new_line
409
+ - same_line
410
+
411
+ Layout/MultilineOperationIndentation:
412
+ EnforcedStyle: indented
413
+ SupportedStyles:
414
+ - aligned
415
+ - indented
416
+ # By default, the indentation width from `Layout/IndentationWidth` is used
417
+ # But it can be overridden by setting this parameter
418
+ IndentationWidth: ~
419
+
420
+ Layout/SpaceAroundBlockParameters:
421
+ EnforcedStyleInsidePipes: no_space
422
+ SupportedStylesInsidePipes:
423
+ - space
424
+ - no_space
425
+
426
+ Layout/SpaceAroundEqualsInParameterDefault:
427
+ EnforcedStyle: space
428
+ SupportedStyles:
429
+ - space
430
+ - no_space
431
+
432
+ Layout/SpaceAroundOperators:
433
+ # When `true`, allows most uses of extra spacing if the intent is to align
434
+ # with an operator on the previous or next line, not counting empty lines
435
+ # or comment lines.
436
+ AllowForAlignment: true
437
+
438
+ Layout/SpaceBeforeFirstArg:
439
+ # When `true`, allows most uses of extra spacing if the intent is to align
440
+ # things with the previous or next line, not counting empty lines or comment
441
+ # lines.
442
+ AllowForAlignment: true
443
+
444
+ Layout/SpaceInsideBlockBraces:
445
+ EnforcedStyle: space
446
+ SupportedStyles:
447
+ - space
448
+ - no_space
449
+ EnforcedStyleForEmptyBraces: no_space
450
+ SupportedStylesForEmptyBraces:
451
+ - space
452
+ - no_space
453
+ # Space between `{` and `|`. Overrides `EnforcedStyle` if there is a conflict.
454
+ SpaceBeforeBlockParameters: true
455
+
456
+ Layout/SpaceInsideHashLiteralBraces:
457
+ EnforcedStyle: space
458
+ SupportedStyles:
459
+ - space
460
+ - no_space
461
+ # 'compact' normally requires a space inside hash braces, with the exception
462
+ # that successive left braces or right braces are collapsed together
463
+ - compact
464
+ EnforcedStyleForEmptyBraces: no_space
465
+ SupportedStylesForEmptyBraces:
466
+ - space
467
+ - no_space
468
+
469
+ Layout/SpaceInsideStringInterpolation:
470
+ EnforcedStyle: no_space
471
+ SupportedStyles:
472
+ - space
473
+ - no_space
474
+
475
+ Layout/IndentationStyle:
476
+ # By default, the indentation width from Layout/IndentationWidth is used
477
+ # But it can be overridden by setting this parameter
478
+ # It is used during auto-correction to determine how many spaces should
479
+ # replace each tab.
480
+ IndentationWidth: ~
481
+
482
+ Layout/TrailingEmptyLines:
483
+ EnforcedStyle: final_newline
484
+ SupportedStyles:
485
+ - final_newline
486
+ - final_blank_line
487
+
488
+ #################### Naming ##########################
489
+
490
+
491
+ Naming/FileName:
492
+ # File names listed in `AllCops:Include` are excluded by default. Add extra
493
+ # excludes here.
494
+ Exclude: []
495
+ # When `true`, requires that each source file should define a class or module
496
+ # with a name which matches the file name (converted to ... case).
497
+ # It further expects it to be nested inside modules which match the names
498
+ # of subdirectories in its path.
499
+ ExpectMatchingDefinition: false
500
+ # If non-`nil`, expect all source file names to match the following regex.
501
+ # Only the file name itself is matched, not the entire file path.
502
+ # Use anchors as necessary if you want to match the entire name rather than
503
+ # just a part of it.
504
+ Regex: ~
505
+ # With `IgnoreExecutableScripts` set to `true`, this cop does not
506
+ # report offending filenames for executable scripts (i.e. source
507
+ # files with a shebang in the first line).
508
+ IgnoreExecutableScripts: true
509
+ AllowedAcronyms:
510
+ - CLI
511
+ - DSL
512
+ - ACL
513
+ - API
514
+ - ASCII
515
+ - CPU
516
+ - CSS
517
+ - DNS
518
+ - EOF
519
+ - GUID
520
+ - HTML
521
+ - HTTP
522
+ - HTTPS
523
+ - ID
524
+ - IP
525
+ - JSON
526
+ - LHS
527
+ - QPS
528
+ - RAM
529
+ - RHS
530
+ - RPC
531
+ - SLA
532
+ - SMTP
533
+ - SQL
534
+ - SSH
535
+ - TCP
536
+ - TLS
537
+ - TTL
538
+ - UDP
539
+ - UI
540
+ - UID
541
+ - UUID
542
+ - URI
543
+ - URL
544
+ - UTF8
545
+ - VM
546
+ - XML
547
+ - XMPP
548
+ - XSRF
549
+ - XSS
550
+
551
+ Naming/HeredocDelimiterNaming:
552
+ ForbiddenDelimiters:
553
+ - !ruby/regexp '/(^|\s)(EO[A-Z]{1}|END)(\s|$)/'
554
+
555
+ Naming/HeredocDelimiterCase:
556
+ EnforcedStyle: uppercase
557
+ SupportedStyles:
558
+ - lowercase
559
+ - uppercase
560
+
561
+ Naming/MemoizedInstanceVariableName:
562
+ Enabled: false
563
+
564
+ Naming/MethodName:
565
+ EnforcedStyle: snake_case
566
+ SupportedStyles:
567
+ - snake_case
568
+ - camelCase
569
+
570
+ Naming/PredicateName:
571
+ Enabled: false
572
+ # Predicate name prefixes.
573
+ NamePrefix:
574
+ - is_
575
+ - has_
576
+ - have_
577
+ # Predicate name prefixes that should be removed.
578
+ ForbiddenPrefixes:
579
+ - is_
580
+ - has_
581
+ - have_
582
+ # Predicate names which, despite having a blacklisted prefix, or no `?`,
583
+ # should still be accepted
584
+ AllowedMethods:
585
+ - is_a?
586
+ # Method definition macros for dynamically generated methods.
587
+ MethodDefinitionMacros:
588
+ - define_method
589
+ - define_singleton_method
590
+ # Exclude Rspec specs because there is a strong convention to write spec
591
+ # helpers in the form of `have_something` or `be_something`.
592
+ Exclude:
593
+ - 'spec/**/*'
594
+
595
+ Naming/BlockParameterName:
596
+ # Parameter names may be equal to or greater than this value
597
+ MinNameLength: 1
598
+ AllowNamesEndingInNumbers: true
599
+ # Whitelisted names that will not register an offense
600
+ AllowedNames: []
601
+ # Blacklisted names that will register an offense
602
+ ForbiddenNames: []
603
+
604
+ Naming/MethodParameterName:
605
+ # Parameter names may be equal to or greater than this value
606
+ MinNameLength: 3
607
+ AllowNamesEndingInNumbers: true
608
+ # Whitelisted names that will not register an offense
609
+ AllowedNames:
610
+ - io
611
+ - id
612
+ - to
613
+ - by
614
+ - 'on'
615
+ - in
616
+ - at
617
+ - f
618
+ # Blacklisted names that will register an offense
619
+ ForbiddenNames: []
620
+
621
+ Naming/VariableName:
622
+ EnforcedStyle: snake_case
623
+ SupportedStyles:
624
+ - snake_case
625
+ - camelCase
626
+
627
+ Naming/VariableNumber:
628
+ EnforcedStyle: normalcase
629
+ SupportedStyles:
630
+ - snake_case
631
+ - normalcase
632
+ - non_integer
633
+
634
+ #################### Style ###########################
635
+
636
+ Style/DateTime:
637
+ Enabled: false
638
+
639
+ Style/AccessModifierDeclarations:
640
+ Enabled: false
641
+ EnforcedStyle: group
642
+ SupportedStyles:
643
+ - inline
644
+ - group
645
+
646
+ Style/Alias:
647
+ EnforcedStyle: prefer_alias
648
+ SupportedStyles:
649
+ - prefer_alias
650
+ - prefer_alias_method
651
+
652
+ Style/AndOr:
653
+ # Whether `and` and `or` are banned only in conditionals (conditionals)
654
+ # or completely (always).
655
+ EnforcedStyle: always
656
+ SupportedStyles:
657
+ - always
658
+ - conditionals
659
+
660
+ # Checks if usage of `%()` or `%Q()` matches configuration.
661
+ Style/BarePercentLiterals:
662
+ EnforcedStyle: bare_percent
663
+ SupportedStyles:
664
+ - percent_q
665
+ - bare_percent
666
+
667
+ Style/BlockDelimiters:
668
+ EnforcedStyle: line_count_based
669
+ SupportedStyles:
670
+ # The `line_count_based` style enforces braces around single line blocks and
671
+ # do..end around multi-line blocks.
672
+ - line_count_based
673
+ # The `semantic` style enforces braces around functional blocks, where the
674
+ # primary purpose of the block is to return a value and do..end for
675
+ # procedural blocks, where the primary purpose of the block is its
676
+ # side-effects.
677
+ #
678
+ # This looks at the usage of a block's method to determine its type (e.g. is
679
+ # the result of a `map` assigned to a variable or passed to another
680
+ # method) but exceptions are permitted in the `ProceduralMethods`,
681
+ # `FunctionalMethods` and `IgnoredMethods` sections below.
682
+ - semantic
683
+ # The `braces_for_chaining` style enforces braces around single line blocks
684
+ # and do..end around multi-line blocks, except for multi-line blocks whose
685
+ # return value is being chained with another method (in which case braces
686
+ # are enforced).
687
+ - braces_for_chaining
688
+ ProceduralMethods:
689
+ # Methods that are known to be procedural in nature but look functional from
690
+ # their usage, e.g.
691
+ #
692
+ # time = Benchmark.realtime do
693
+ # foo.bar
694
+ # end
695
+ #
696
+ # Here, the return value of the block is discarded but the return value of
697
+ # `Benchmark.realtime` is used.
698
+ - benchmark
699
+ - bm
700
+ - bmbm
701
+ - create
702
+ - each_with_object
703
+ - measure
704
+ - new
705
+ - realtime
706
+ - tap
707
+ - with_object
708
+ FunctionalMethods:
709
+ # Methods that are known to be functional in nature but look procedural from
710
+ # their usage, e.g.
711
+ #
712
+ # let(:foo) { Foo.new }
713
+ #
714
+ # Here, the return value of `Foo.new` is used to define a `foo` helper but
715
+ # doesn't appear to be used from the return value of `let`.
716
+ - let
717
+ - let!
718
+ - subject
719
+ - watch
720
+ IgnoredMethods:
721
+ # Methods that can be either procedural or functional and cannot be
722
+ # categorised from their usage alone, e.g.
723
+ #
724
+ # foo = lambda do |x|
725
+ # puts "Hello, #{x}"
726
+ # end
727
+ #
728
+ # foo = lambda do |x|
729
+ # x * 100
730
+ # end
731
+ #
732
+ # Here, it is impossible to tell from the return value of `lambda` whether
733
+ # the inner block's return value is significant.
734
+ - lambda
735
+ - proc
736
+ - it
737
+
738
+ Style/ClassAndModuleChildren:
739
+ # Checks the style of children definitions at classes and modules.
740
+ #
741
+ # Basically there are two different styles:
742
+ #
743
+ # `nested` - have each child on a separate line
744
+ # class Foo
745
+ # class Bar
746
+ # end
747
+ # end
748
+ #
749
+ # `compact` - combine definitions as much as possible
750
+ # class Foo::Bar
751
+ # end
752
+ #
753
+ # The compact style is only forced, for classes or modules with one child.
754
+ Enabled: false
755
+ EnforcedStyle: nested
756
+ SupportedStyles:
757
+ - nested
758
+ - compact
759
+
760
+ Style/ClassCheck:
761
+ EnforcedStyle: is_a?
762
+ SupportedStyles:
763
+ - is_a?
764
+ - kind_of?
765
+
766
+ # Align with the style guide.
767
+ Style/CollectionMethods:
768
+ # Mapping from undesired method to desired_method
769
+ # e.g. to use `detect` over `find`:
770
+ #
771
+ # CollectionMethods:
772
+ # PreferredMethods:
773
+ # find: detect
774
+ PreferredMethods:
775
+ collect: 'map'
776
+ collect!: 'map!'
777
+ inject: 'reduce'
778
+ detect: 'find'
779
+ find_all: 'select'
780
+
781
+ # Use '`' or '%x' around command literals.
782
+ Style/CommandLiteral:
783
+ EnforcedStyle: backticks
784
+ # backticks: Always use backticks.
785
+ # percent_x: Always use `%x`.
786
+ # mixed: Use backticks on single-line commands, and `%x` on multi-line commands.
787
+ SupportedStyles:
788
+ - backticks
789
+ - percent_x
790
+ - mixed
791
+ # If `false`, the cop will always recommend using `%x` if one or more backticks
792
+ # are found in the command string.
793
+ AllowInnerBackticks: false
794
+
795
+ # Checks formatting of special comments
796
+ Style/CommentAnnotation:
797
+ Keywords:
798
+ - TODO
799
+ - FIXME
800
+ - OPTIMIZE
801
+ - HACK
802
+ - REVIEW
803
+
804
+ Style/ConditionalAssignment:
805
+ EnforcedStyle: assign_inside_condition
806
+ SupportedStyles:
807
+ - assign_to_condition
808
+ - assign_inside_condition
809
+ # When configured to `assign_to_condition`, `SingleLineConditionsOnly`
810
+ # will only register an offense when all branches of a condition are
811
+ # a single line.
812
+ # When configured to `assign_inside_condition`, `SingleLineConditionsOnly`
813
+ # will only register an offense for assignment to a condition that has
814
+ # at least one multiline branch.
815
+ SingleLineConditionsOnly: true
816
+ IncludeTernaryExpressions: false
817
+
818
+ # Checks that you have put a copyright in a comment before any code.
819
+ #
820
+ # You can override the default Notice in your .rubocop.yml file.
821
+ #
822
+ # In order to use autocorrect, you must supply a value for the
823
+ # `AutocorrectNotice` key that matches the regexp Notice. A blank
824
+ # `AutocorrectNotice` will cause an error during autocorrect.
825
+ #
826
+ # Autocorrect will add a copyright notice in a comment at the top
827
+ # of the file immediately after any shebang or encoding comments.
828
+ #
829
+ # Example rubocop.yml:
830
+ #
831
+ # Style/Copyright:
832
+ # Enabled: true
833
+ # Notice: 'Copyright (\(c\) )?2015 Yahoo! Inc'
834
+ # AutocorrectNotice: '# Copyright (c) 2015 Yahoo! Inc.'
835
+ #
836
+ Style/Copyright:
837
+ Notice: '^Copyright (\(c\) )?2[0-9]{3} .+'
838
+ AutocorrectNotice: ''
839
+
840
+ Style/Documentation:
841
+ Enabled: false
842
+
843
+ Style/DocumentationMethod:
844
+ RequireForNonPublicMethods: false
845
+
846
+ # Warn on empty else statements
847
+ # empty - warn only on empty `else`
848
+ # nil - warn on `else` with nil in it
849
+ # both - warn on empty `else` and `else` with `nil` in it
850
+ Style/EmptyElse:
851
+ EnforcedStyle: both
852
+ SupportedStyles:
853
+ - empty
854
+ - nil
855
+ - both
856
+
857
+ Style/EmptyMethod:
858
+ EnforcedStyle: expanded
859
+ SupportedStyles:
860
+ - compact
861
+ - expanded
862
+
863
+ # Checks use of for or each in multiline loops.
864
+ Style/For:
865
+ EnforcedStyle: each
866
+ SupportedStyles:
867
+ - for
868
+ - each
869
+
870
+ # Enforce the method used for string formatting.
871
+ Style/FormatString:
872
+ EnforcedStyle: format
873
+ SupportedStyles:
874
+ - format
875
+ - sprintf
876
+ - percent
877
+
878
+ Style/FrozenStringLiteralComment:
879
+ EnforcedStyle: never
880
+ SupportedStyles:
881
+ # `when_needed` will add the frozen string literal comment to files
882
+ # only when the `TargetRubyVersion` is set to 2.3+.
883
+ - when_needed
884
+ # `always` will always add the frozen string literal comment to a file
885
+ # regardless of the Ruby version or if `freeze` or `<<` are called on a
886
+ # string literal. If you run code against multiple versions of Ruby, it is
887
+ # possible that this will create errors in Ruby 2.3.0+.
888
+ - always
889
+ # `never` will enforce that the frozen string literal comment does not
890
+ # exist in a file.
891
+ - never
892
+
893
+ # Built-in global variables are allowed by default.
894
+ Style/GlobalVars:
895
+ AllowedVariables: []
896
+
897
+ # `MinBodyLength` defines the number of lines of the a body of an `if` or `unless`
898
+ # needs to have to trigger this cop
899
+ Style/GuardClause:
900
+ Enabled: false
901
+ MinBodyLength: 1
902
+
903
+ Style/HashSyntax:
904
+ EnforcedStyle: ruby19
905
+ SupportedStyles:
906
+ # checks for 1.9 syntax (e.g. {a: 1}) for all symbol keys
907
+ - ruby19
908
+ # checks for hash rocket syntax for all hashes
909
+ - hash_rockets
910
+ # forbids mixed key syntaxes (e.g. {a: 1, :b => 2})
911
+ - no_mixed_keys
912
+ # enforces both ruby19 and no_mixed_keys styles
913
+ - ruby19_no_mixed_keys
914
+ # Force hashes that have a symbol value to use hash rockets
915
+ UseHashRocketsWithSymbolValues: false
916
+ # Do not suggest { a?: 1 } over { :a? => 1 } in ruby19 style
917
+ PreferHashRocketsForNonAlnumEndingSymbols: false
918
+
919
+ Style/InverseMethods:
920
+ Enabled: true
921
+ # `InverseMethods` are methods that can be inverted by a not (`not` or `!`)
922
+ # The relationship of inverse methods only needs to be defined in one direction.
923
+ # Keys and values both need to be defined as symbols.
924
+ InverseMethods:
925
+ :any?: :none?
926
+ :even?: :odd?
927
+ :==: :!=
928
+ :=~: :!~
929
+ :<: :>=
930
+ :>: :<=
931
+ # `ActiveSupport` defines some common inverse methods. They are listed below,
932
+ # and not enabled by default.
933
+ #:present?: :blank?,
934
+ #:include?: :exclude?
935
+ # `InverseBlocks` are methods that are inverted by inverting the return
936
+ # of the block that is passed to the method
937
+ InverseBlocks:
938
+ :select: :reject
939
+ :select!: :reject!
940
+
941
+ Style/Lambda:
942
+ EnforcedStyle: line_count_dependent
943
+ SupportedStyles:
944
+ - line_count_dependent
945
+ - lambda
946
+ - literal
947
+
948
+ Style/LambdaCall:
949
+ EnforcedStyle: call
950
+ SupportedStyles:
951
+ - call
952
+ - braces
953
+
954
+ Style/MethodCallWithArgsParentheses:
955
+ IgnoreMacros: true
956
+ IgnoredMethods: []
957
+
958
+ Style/MethodDefParentheses:
959
+ EnforcedStyle: require_parentheses
960
+ SupportedStyles:
961
+ - require_parentheses
962
+ - require_no_parentheses
963
+ - require_no_parentheses_except_multiline
964
+
965
+ # Checks the grouping of mixins (`include`, `extend`, `prepend`) in `class` and
966
+ # `module` bodies.
967
+ Style/MixinGrouping:
968
+ EnforcedStyle: separated
969
+ SupportedStyles:
970
+ # separated: each mixed in module goes in a separate statement.
971
+ # grouped: mixed in modules are grouped into a single statement.
972
+ - separated
973
+ - grouped
974
+
975
+ Style/ModuleFunction:
976
+ EnforcedStyle: module_function
977
+ SupportedStyles:
978
+ - module_function
979
+ - extend_self
980
+
981
+ Style/MultilineMemoization:
982
+ EnforcedStyle: keyword
983
+ SupportedStyles:
984
+ - keyword
985
+ - braces
986
+
987
+ Style/NegatedIf:
988
+ EnforcedStyle: both
989
+ SupportedStyles:
990
+ # both: prefix and postfix negated `if` should both use `unless`
991
+ # prefix: only use `unless` for negated `if` statements positioned before the body of the statement
992
+ # postfix: only use `unless` for negated `if` statements positioned after the body of the statement
993
+ - both
994
+ - prefix
995
+ - postfix
996
+
997
+ Style/NestedParenthesizedCalls:
998
+ AllowedMethods:
999
+ - be
1000
+ - be_a
1001
+ - be_an
1002
+ - be_between
1003
+ - be_falsey
1004
+ - be_kind_of
1005
+ - be_instance_of
1006
+ - be_truthy
1007
+ - be_within
1008
+ - eq
1009
+ - eql
1010
+ - end_with
1011
+ - include
1012
+ - match
1013
+ - raise_error
1014
+ - respond_to
1015
+ - start_with
1016
+
1017
+ Style/Next:
1018
+ Exclude:
1019
+ - 'app/controllers/concerns/legal_documents_helpers.rb'
1020
+
1021
+ # With `always` all conditions at the end of an iteration needs to be
1022
+ # replaced by next - with `skip_modifier_ifs` the modifier if like this one
1023
+ # are ignored: [1, 2].each { |a| return 'yes' if a == 1 }
1024
+ EnforcedStyle: skip_modifier_ifs
1025
+ # `MinBodyLength` defines the number of lines of the a body of an `if` or `unless`
1026
+ # needs to have to trigger this cop
1027
+ MinBodyLength: 3
1028
+ SupportedStyles:
1029
+ - skip_modifier_ifs
1030
+ - always
1031
+
1032
+ Style/NonNilCheck:
1033
+ # With `IncludeSemanticChanges` set to `true`, this cop reports offenses for
1034
+ # `!x.nil?` and autocorrects that and `x != nil` to solely `x`, which is
1035
+ # **usually** OK, but might change behavior.
1036
+ #
1037
+ # With `IncludeSemanticChanges` set to `false`, this cop does not report
1038
+ # offenses for `!x.nil?` and does no changes that might change behavior.
1039
+ IncludeSemanticChanges: false
1040
+
1041
+ Style/NumericLiterals:
1042
+ MinDigits: 5
1043
+ Strict: false
1044
+
1045
+ Style/NumericLiteralPrefix:
1046
+ EnforcedOctalStyle: zero_with_o
1047
+ SupportedOctalStyles:
1048
+ - zero_with_o
1049
+ - zero_only
1050
+
1051
+ Style/NumericPredicate:
1052
+ EnforcedStyle: predicate
1053
+ SupportedStyles:
1054
+ - predicate
1055
+ - comparison
1056
+ # Exclude RSpec specs because assertions like `expect(1).to be > 0` cause
1057
+ # false positives.
1058
+ Exclude:
1059
+ - 'spec/**/*'
1060
+
1061
+ Style/OptionHash:
1062
+ # A list of parameter names that will be flagged by this cop.
1063
+ SuspiciousParamNames:
1064
+ - options
1065
+ - opts
1066
+ - args
1067
+ - params
1068
+ - parameters
1069
+
1070
+ # Allow safe assignment in conditions.
1071
+ Style/ParenthesesAroundCondition:
1072
+ AllowSafeAssignment: true
1073
+
1074
+ Style/PercentLiteralDelimiters:
1075
+ # Specify the default preferred delimiter for all types with the 'default' key
1076
+ # Override individual delimiters (even with default specified) by specifying
1077
+ # an individual key
1078
+ PreferredDelimiters:
1079
+ default: ()
1080
+ '%i': '()'
1081
+ '%I': '()'
1082
+ '%r': '{}'
1083
+ '%w': '()'
1084
+ '%W': '()'
1085
+
1086
+ Style/PercentQLiterals:
1087
+ EnforcedStyle: lower_case_q
1088
+ SupportedStyles:
1089
+ - lower_case_q # Use `%q` when possible, `%Q` when necessary
1090
+ - upper_case_q # Always use `%Q`
1091
+
1092
+ Style/PreferredHashMethods:
1093
+ EnforcedStyle: short
1094
+ SupportedStyles:
1095
+ - short
1096
+ - verbose
1097
+
1098
+ Style/RaiseArgs:
1099
+ EnforcedStyle: compact
1100
+ SupportedStyles:
1101
+ - compact # raise Exception.new(msg)
1102
+ - exploded # raise Exception, msg
1103
+
1104
+ Style/RedundantReturn:
1105
+ # When `true` allows code like `return x, y`.
1106
+ AllowMultipleReturnValues: false
1107
+
1108
+ # Use `/` or `%r` around regular expressions.
1109
+ Style/RegexpLiteral:
1110
+ Enabled: false
1111
+ EnforcedStyle: slashes
1112
+ # slashes: Always use slashes.
1113
+ # percent_r: Always use `%r`.
1114
+ # mixed: Use slashes on single-line regexes, and `%r` on multi-line regexes.
1115
+ SupportedStyles:
1116
+ - slashes
1117
+ - percent_r
1118
+ - mixed
1119
+ # If `false`, the cop will always recommend using `%r` if one or more slashes
1120
+ # are found in the regexp string.
1121
+ AllowInnerSlashes: false
1122
+
1123
+ Style/ReturnNil:
1124
+ EnforcedStyle: return
1125
+ SupportedStyles:
1126
+ - return
1127
+ - return_nil
1128
+
1129
+ Style/SafeNavigation:
1130
+ # Safe navigation may cause a statement to start returning `nil` in addition
1131
+ # to whatever it used to return.
1132
+ ConvertCodeThatCanStartToReturnNil: false
1133
+
1134
+ Style/Semicolon:
1135
+ # Allow `;` to separate several expressions on the same line.
1136
+ AllowAsExpressionSeparator: false
1137
+
1138
+ Style/SignalException:
1139
+ EnforcedStyle: only_raise
1140
+ SupportedStyles:
1141
+ - only_raise
1142
+ - only_fail
1143
+ - semantic
1144
+
1145
+ Style/SingleLineBlockParams:
1146
+ Methods:
1147
+ - reduce:
1148
+ - acc
1149
+ - elem
1150
+ - inject:
1151
+ - acc
1152
+ - elem
1153
+
1154
+ Style/SingleLineMethods:
1155
+ AllowIfMethodIsEmpty: true
1156
+
1157
+ Style/SpecialGlobalVars:
1158
+ EnforcedStyle: use_english_names
1159
+ SupportedStyles:
1160
+ - use_perl_names
1161
+ - use_english_names
1162
+
1163
+ Style/StabbyLambdaParentheses:
1164
+ EnforcedStyle: require_parentheses
1165
+ SupportedStyles:
1166
+ - require_parentheses
1167
+ - require_no_parentheses
1168
+
1169
+ Style/StringLiterals:
1170
+ Enabled: false
1171
+
1172
+ Style/StringLiteralsInInterpolation:
1173
+ EnforcedStyle: single_quotes
1174
+ SupportedStyles:
1175
+ - single_quotes
1176
+ - double_quotes
1177
+
1178
+ Style/StringMethods:
1179
+ # Mapping from undesired method to desired_method
1180
+ # e.g. to use `to_sym` over `intern`:
1181
+ #
1182
+ # StringMethods:
1183
+ # PreferredMethods:
1184
+ # intern: to_sym
1185
+ PreferredMethods:
1186
+ intern: to_sym
1187
+
1188
+ Style/SymbolArray:
1189
+ EnforcedStyle: percent
1190
+ MinSize: 0
1191
+ SupportedStyles:
1192
+ - percent
1193
+ - brackets
1194
+
1195
+ Style/SymbolProc:
1196
+ # A list of method names to be ignored by the check.
1197
+ # The names should be fairly unique, otherwise you'll end up ignoring lots of code.
1198
+ IgnoredMethods:
1199
+ - respond_to
1200
+ - define_method
1201
+
1202
+ Style/TernaryParentheses:
1203
+ EnforcedStyle: require_no_parentheses
1204
+ SupportedStyles:
1205
+ - require_parentheses
1206
+ - require_no_parentheses
1207
+ - require_parentheses_when_complex
1208
+ AllowSafeAssignment: true
1209
+
1210
+ Style/TrailingCommaInArguments:
1211
+ # If `comma`, the cop requires a comma after the last argument, but only for
1212
+ # parenthesized method calls where each argument is on its own line.
1213
+ # If `consistent_comma`, the cop requires a comma after the last argument,
1214
+ # for all parenthesized method calls with arguments.
1215
+ EnforcedStyleForMultiline: no_comma
1216
+ SupportedStylesForMultiline:
1217
+ - comma
1218
+ - consistent_comma
1219
+ - no_comma
1220
+
1221
+ Style/TrailingCommaInArrayLiteral:
1222
+ # If `comma`, the cop requires a comma after the last item in an array,
1223
+ # but only when each item is on its own line.
1224
+ # If `consistent_comma`, the cop requires a comma after the last item of all
1225
+ # non-empty array literals.
1226
+ EnforcedStyleForMultiline: no_comma
1227
+ SupportedStylesForMultiline:
1228
+ - comma
1229
+ - consistent_comma
1230
+ - no_comma
1231
+
1232
+ # `TrivialAccessors` requires exact name matches and doesn't allow
1233
+ # predicated methods by default.
1234
+ Style/TrivialAccessors:
1235
+ # When set to `false` the cop will suggest the use of accessor methods
1236
+ # in situations like:
1237
+ #
1238
+ # def name
1239
+ # @other_name
1240
+ # end
1241
+ #
1242
+ # This way you can uncover "hidden" attributes in your code.
1243
+ ExactNameMatch: true
1244
+ AllowPredicates: true
1245
+ # Allows trivial writers that don't end in an equal sign. e.g.
1246
+ #
1247
+ # def on_exception(action)
1248
+ # @on_exception=action
1249
+ # end
1250
+ # on_exception :restart
1251
+ #
1252
+ # Commonly used in DSLs
1253
+ AllowDSLWriters: false
1254
+ IgnoreClassMethods: false
1255
+ AllowedMethods:
1256
+ - to_ary
1257
+ - to_a
1258
+ - to_c
1259
+ - to_enum
1260
+ - to_h
1261
+ - to_hash
1262
+ - to_i
1263
+ - to_int
1264
+ - to_io
1265
+ - to_open
1266
+ - to_path
1267
+ - to_proc
1268
+ - to_r
1269
+ - to_regexp
1270
+ - to_str
1271
+ - to_s
1272
+ - to_sym
1273
+
1274
+ # `WordArray` enforces how array literals of word-like strings should be expressed.
1275
+ Style/WordArray:
1276
+ EnforcedStyle: percent
1277
+ SupportedStyles:
1278
+ # percent style: %w(word1 word2)
1279
+ - percent
1280
+ # bracket style: ['word1', 'word2']
1281
+ - brackets
1282
+ # The `MinSize` option causes the `WordArray` rule to be ignored for arrays
1283
+ # smaller than a certain size. The rule is only applied to arrays
1284
+ # whose element count is greater than or equal to `MinSize`.
1285
+ MinSize: 0
1286
+ # The regular expression `WordRegex` decides what is considered a word.
1287
+ WordRegex: !ruby/regexp '/\A[\p{Word}\n\t]+\z/'
1288
+
1289
+ Style/YodaCondition:
1290
+ EnforcedStyle: forbid_for_all_comparison_operators
1291
+ SupportedStyles:
1292
+ - forbid_for_all_comparison_operators
1293
+ - forbid_for_equality_operators_only
1294
+ - require_for_all_comparison_operators
1295
+ - require_for_equality_operators_only
1296
+
1297
+ Style/IfInsideElse:
1298
+ Enabled: false
1299
+
1300
+ #################### Metrics ###############################
1301
+
1302
+ Metrics/AbcSize:
1303
+ # The ABC size is a calculated magnitude, so this number can be an Integer or
1304
+ # a Float.
1305
+ Max: 90
1306
+
1307
+ Metrics/BlockLength:
1308
+ Enabled: false
1309
+ Exclude:
1310
+ - 'Rakefile'
1311
+ - '**/*.rake'
1312
+ - 'spec/**/*.rb'
1313
+ CountComments: false # count full line comments?
1314
+ Max: 50
1315
+ ExcludedMethods: []
1316
+
1317
+ Metrics/BlockNesting:
1318
+ CountBlocks: false
1319
+ Max: 3
1320
+
1321
+ Metrics/ClassLength:
1322
+ CountComments: false # count full line comments?
1323
+ Max: 310
1324
+ Enabled: false
1325
+
1326
+ # Avoid complex methods.
1327
+ Metrics/CyclomaticComplexity:
1328
+ Max: 15
1329
+
1330
+ Layout/LineLength:
1331
+ Max: 95
1332
+ # To make it possible to copy or click on URIs in the code, we allow lines
1333
+ # containing a URI to be longer than Max.
1334
+ AllowHeredoc: true
1335
+ AllowURI: true
1336
+ URISchemes:
1337
+ - http
1338
+ - https
1339
+ # The IgnoreCopDirectives option causes the LineLength rule to ignore cop
1340
+ # directives like '# rubocop: enable ...' when calculating a line's length.
1341
+ IgnoreCopDirectives: false
1342
+ # The IgnoredPatterns option is a list of !ruby/regexp and/or string
1343
+ # elements. Strings will be converted to Regexp objects. A line that matches
1344
+ # any regular expression listed in this option will be ignored by LineLength.
1345
+ IgnoredPatterns: []
1346
+
1347
+ Metrics/MethodLength:
1348
+ CountComments: false # count full line comments?
1349
+ Max: 65
1350
+
1351
+ Metrics/ModuleLength:
1352
+ CountComments: false # count full line comments?
1353
+ Max: 200
1354
+
1355
+ Metrics/ParameterLists:
1356
+ Max: 7
1357
+ CountKeywordArgs: true
1358
+
1359
+ Metrics/PerceivedComplexity:
1360
+ Max: 20
1361
+
1362
+ #################### Lint ##################################
1363
+
1364
+ # Allow safe assignment in conditions.
1365
+ Lint/AssignmentInCondition:
1366
+ AllowSafeAssignment: true
1367
+
1368
+ # checks whether the end keywords are aligned properly for `do` `end` blocks.
1369
+ Layout/BlockAlignment:
1370
+ # The value `start_of_block` means that the `end` should be aligned with line
1371
+ # where the `do` keyword appears.
1372
+ # The value `start_of_line` means it should be aligned with the whole
1373
+ # expression's starting line.
1374
+ # The value `either` means both are allowed.
1375
+ EnforcedStyleAlignWith: either
1376
+ SupportedStylesAlignWith:
1377
+ - either
1378
+ - start_of_block
1379
+ - start_of_line
1380
+
1381
+ Layout/DefEndAlignment:
1382
+ # The value `def` means that `end` should be aligned with the def keyword.
1383
+ # The value `start_of_line` means that `end` should be aligned with method
1384
+ # calls like `private`, `public`, etc, if present in front of the `def`
1385
+ # keyword on the same line.
1386
+ EnforcedStyleAlignWith: start_of_line
1387
+ SupportedStylesAlignWith:
1388
+ - start_of_line
1389
+ - def
1390
+ AutoCorrect: false
1391
+
1392
+ # Align ends correctly.
1393
+ Layout/EndAlignment:
1394
+ # The value `keyword` means that `end` should be aligned with the matching
1395
+ # keyword (`if`, `while`, etc.).
1396
+ # The value `variable` means that in assignments, `end` should be aligned
1397
+ # with the start of the variable on the left hand side of `=`. In all other
1398
+ # situations, `end` should still be aligned with the keyword.
1399
+ # The value `start_of_line` means that `end` should be aligned with the start
1400
+ # of the line which the matching keyword appears on.
1401
+ EnforcedStyleAlignWith: keyword
1402
+ SupportedStylesAlignWith:
1403
+ - keyword
1404
+ - variable
1405
+ - start_of_line
1406
+ AutoCorrect: false
1407
+
1408
+ Lint/InheritException:
1409
+ # The default base class in favour of `Exception`.
1410
+ EnforcedStyle: runtime_error
1411
+ SupportedStyles:
1412
+ - runtime_error
1413
+ - standard_error
1414
+
1415
+ Lint/SafeNavigationChain:
1416
+ AllowedMethods:
1417
+ - present?
1418
+ - blank?
1419
+ - presence
1420
+ - try
1421
+
1422
+ # Checks for unused block arguments
1423
+ Lint/UnusedBlockArgument:
1424
+ IgnoreEmptyBlocks: true
1425
+ AllowUnusedKeywordArguments: false
1426
+
1427
+ # Checks for unused method arguments.
1428
+ Lint/UnusedMethodArgument:
1429
+ AllowUnusedKeywordArguments: false
1430
+ IgnoreEmptyMethods: true
1431
+
1432
+ #################### Performance ###########################
1433
+
1434
+ # Performance/DoubleStartEndWith:
1435
+ # # Used to check for `starts_with?` and `ends_with?`.
1436
+ # # These methods are defined by `ActiveSupport`.
1437
+ # IncludeActiveSupportAliases: false
1438
+
1439
+ # Performance/RedundantMerge:
1440
+ # # Max number of key-value pairs to consider an offense
1441
+ # MaxKeyValuePairs: 2
1442
+
1443
+ #################### Rails #################################
1444
+
1445
+ # TargetRailsVersion: 5.0
1446
+
1447
+ # Rails/ActionFilter:
1448
+ # EnforcedStyle: action
1449
+ # SupportedStyles:
1450
+ # - action
1451
+ # - filter
1452
+ # Include:
1453
+ # - app/controllers/**/*.rb
1454
+
1455
+ # Rails/Date:
1456
+ # # The value `strict` disallows usage of `Date.today`, `Date.current`,
1457
+ # # `Date#to_time` etc.
1458
+ # # The value `flexible` allows usage of `Date.current`, `Date.yesterday`, etc
1459
+ # # (but not `Date.today`) which are overridden by ActiveSupport to handle current
1460
+ # # time zone.
1461
+ # EnforcedStyle: flexible
1462
+ # SupportedStyles:
1463
+ # - strict
1464
+ # - flexible
1465
+
1466
+ # Rails/Delegate:
1467
+ # # When set to true, using the target object as a prefix of the
1468
+ # # method name without using the `delegate` method will be a
1469
+ # # violation. When set to false, this case is legal.
1470
+ # EnforceForPrefixed: true
1471
+
1472
+ # Rails/DynamicFindBy:
1473
+ # AllowedMethods:
1474
+ # - find_by_sql
1475
+
1476
+ # Rails/EnumUniqueness:
1477
+ # Include:
1478
+ # - app/models/**/*.rb
1479
+
1480
+ # Rails/Exit:
1481
+ # Include:
1482
+ # - app/**/*.rb
1483
+ # - config/**/*.rb
1484
+ # - lib/**/*.rb
1485
+ # Exclude:
1486
+ # - lib/**/*.rake
1487
+
1488
+ # Rails/FindBy:
1489
+ # Include:
1490
+ # - app/models/**/*.rb
1491
+
1492
+ # Rails/FindEach:
1493
+ # Include:
1494
+ # - app/models/**/*.rb
1495
+
1496
+ # Rails/HasAndBelongsToMany:
1497
+ # Include:
1498
+ # - app/models/**/*.rb
1499
+
1500
+ # Rails/HasManyOrHasOneDependent:
1501
+ # Include:
1502
+ # - app/models/**/*.rb
1503
+
1504
+ # Rails/NotNullColumn:
1505
+ # Include:
1506
+ # - db/migrate/*.rb
1507
+
1508
+ # Rails/Output:
1509
+ # Include:
1510
+ # - app/**/*.rb
1511
+ # - config/**/*.rb
1512
+ # - db/**/*.rb
1513
+ # - lib/**/*.rb
1514
+
1515
+ # Rails/ReadWriteAttribute:
1516
+ # Include:
1517
+ # - app/models/**/*.rb
1518
+
1519
+ # Rails/RequestReferer:
1520
+ # EnforcedStyle: referer
1521
+ # SupportedStyles:
1522
+ # - referer
1523
+ # - referrer
1524
+
1525
+ # Rails/ReversibleMigration:
1526
+ # Include:
1527
+ # - db/migrate/*.rb
1528
+
1529
+ # Rails/SafeNavigation:
1530
+ # # This will convert usages of `try` to use safe navigation as well as `try!`.
1531
+ # # `try` and `try!` work slightly differently. `try!` and safe navigation will
1532
+ # # both raise a `NoMethodError` if the receiver of the method call does not
1533
+ # # implement the intended method. `try` will not raise an exception for this.
1534
+ # ConvertTry: false
1535
+
1536
+ # Rails/ScopeArgs:
1537
+ # Include:
1538
+ # - app/models/**/*.rb
1539
+
1540
+ # Rails/TimeZone:
1541
+ # # The value `strict` means that `Time` should be used with `zone`.
1542
+ # # The value `flexible` allows usage of `in_time_zone` instead of `zone`.
1543
+ # EnforcedStyle: flexible
1544
+ # SupportedStyles:
1545
+ # - strict
1546
+ # - flexible
1547
+
1548
+ # Rails/UniqBeforePluck:
1549
+ # EnforcedStyle: conservative
1550
+ # SupportedStyles:
1551
+ # - conservative
1552
+ # - aggressive
1553
+ # AutoCorrect: false
1554
+
1555
+ # Rails/UnknownEnv:
1556
+ # Environments:
1557
+ # - development
1558
+ # - test
1559
+ # - production
1560
+
1561
+ # Rails/SkipsModelValidations:
1562
+ # ForbiddenDelimiters:
1563
+ # - decrement!
1564
+ # - decrement_counter
1565
+ # - increment!
1566
+ # - increment_counter
1567
+ # - toggle!
1568
+ # - touch
1569
+ # - update_all
1570
+ # - update_attribute
1571
+ # - update_column
1572
+ # - update_columns
1573
+ # - update_counters
1574
+
1575
+ # Rails/Validation:
1576
+ # Include:
1577
+ # - app/models/**/*.rb
1578
+
1579
+ Security/YAMLLoad:
1580
+ Exclude:
1581
+ - spec/supports/db_helpers.rb
1582
+
1583
+ Bundler/OrderedGems:
1584
+ TreatCommentsAsGroupSeparators: true
1585
+
1586
+ Gemspec/OrderedDependencies:
1587
+ TreatCommentsAsGroupSeparators: true
1588
+
1589
+ Security/Open:
1590
+ Enabled: false