bruw 0.1.1

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