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