acts_as_textcaptcha 4.5.1 → 4.5.2

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