gatemedia_rubocop 0.3.0 → 0.4.0

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