simple_form_select2 0.1.0

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