ikusei_linters 0.1.0

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