graphql-filters 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +3 -0
  3. data/.rubocop.yml +1635 -0
  4. data/CHANGELOG.md +13 -0
  5. data/Gemfile +10 -0
  6. data/Gemfile.lock +77 -0
  7. data/LICENSE +21 -0
  8. data/README.md +265 -0
  9. data/Rakefile +10 -0
  10. data/lib/graphql/filters/activerecord_patch/arel/nodes/contained.rb +9 -0
  11. data/lib/graphql/filters/activerecord_patch/arel/predications.rb +9 -0
  12. data/lib/graphql/filters/activerecord_patch.rb +3 -0
  13. data/lib/graphql/filters/dsl/graphql/schema/enum.rb +16 -0
  14. data/lib/graphql/filters/dsl/graphql/schema/field.rb +64 -0
  15. data/lib/graphql/filters/dsl/graphql/schema/list.rb +28 -0
  16. data/lib/graphql/filters/dsl/graphql/schema/member.rb +25 -0
  17. data/lib/graphql/filters/dsl/graphql/schema/non_null.rb +15 -0
  18. data/lib/graphql/filters/dsl/graphql/schema/object.rb +16 -0
  19. data/lib/graphql/filters/dsl/graphql/schema/scalar.rb +16 -0
  20. data/lib/graphql/filters/dsl/graphql/types/numeric.rb +20 -0
  21. data/lib/graphql/filters/dsl/graphql/types/string.rb +16 -0
  22. data/lib/graphql/filters/dsl.rb +3 -0
  23. data/lib/graphql/filters/filterable.rb +42 -0
  24. data/lib/graphql/filters/input_types/base_comparison_input_type.rb +12 -0
  25. data/lib/graphql/filters/input_types/base_list_comparison_input_type.rb +23 -0
  26. data/lib/graphql/filters/input_types/base_scalar_comparison_input_type.rb +63 -0
  27. data/lib/graphql/filters/input_types/fields_comparison_input_type.rb +58 -0
  28. data/lib/graphql/filters/input_types/list_object_comparison_input_type.rb +97 -0
  29. data/lib/graphql/filters/input_types/list_scalar_comparison_input_type.rb +134 -0
  30. data/lib/graphql/filters/input_types/numeric_comparison_input_type.rb +45 -0
  31. data/lib/graphql/filters/input_types/object_comparison_input_type.rb +71 -0
  32. data/lib/graphql/filters/input_types/string_comparison_input_type.rb +64 -0
  33. data/lib/graphql/filters/utility/cached_class.rb +74 -0
  34. data/lib/graphql/filters/version.rb +5 -0
  35. data/lib/graphql/filters.rb +26 -0
  36. data/lib/graphql/models_connect/dsl/graphql/schema/object.rb +27 -0
  37. data/lib/graphql/models_connect/dsl.rb +3 -0
  38. data/lib/graphql/models_connect.rb +15 -0
  39. metadata +126 -0
data/.rubocop.yml ADDED
@@ -0,0 +1,1635 @@
1
+ AllCops:
2
+ Exclude:
3
+ - 'bin/**/*'
4
+ - 'spec/support/fixtures/**/*'
5
+
6
+ ## Bundler ##
7
+
8
+ # A Gem’s requirements should be listed only once in a Gemfile.
9
+ # Bundler/DuplicatedGem
10
+
11
+ # Each gem in the Gemfile should have a comment explaining its purpose in the project, or the reason for its version or source.
12
+ # Bundler/GemComment
13
+
14
+ # This cop verifies that a project contains Gemfile or gems.rb file and correct associated lock file based on the configuration.
15
+ # Bundler/GemFilename
16
+
17
+ # Enforce that Gem version specifications or a commit reference (branch, ref, or tag) are either required or forbidden.
18
+ # Bundler/GemVersion
19
+
20
+ # Passing symbol arguments to source (e.g. source :rubygems) is deprecated because they default to using HTTP requests. Instead, specify 'https://rubygems.org' if possible, or 'http://rubygems.org' if not.
21
+ # Bundler/InsecureProtocolSource
22
+
23
+ # Gems should be alphabetically sorted within groups.
24
+ # Bundler/OrderedGems
25
+
26
+ ##################
27
+
28
+ ## Gemspec ##
29
+
30
+ # This cop checks that date = is not used in gemspec file. It is set automatically when the gem is packaged.
31
+ Gemspec/DeprecatedAttributeAssignment:
32
+ Enabled: true
33
+
34
+ # An attribute assignment method calls should be listed only once in a gemspec.
35
+ # Gemspec/DuplicatedAssignment
36
+
37
+ # Dependencies in the gemspec should be alphabetically sorted.
38
+ # Gemspec/OrderedDependencies
39
+
40
+ # Requires a gemspec to have rubygems_mfa_required metadata set.
41
+ # Gemspec/RequireMFA
42
+
43
+ # Checks that required_ruby_version in a gemspec file is set to a valid value (non-blank) and matches TargetRubyVersion as set in RuboCop’s configuration for the gem.
44
+ # Gemspec/RequiredRubyVersion
45
+
46
+ # Checks that RUBY_VERSION constant is not used in gemspec. Using RUBY_VERSION is dangerous because value of the constant is determined by rake release. It’s possible to have dependency based on ruby version used to execute rake release and not user’s ruby version.
47
+ # Gemspec/RubyVersionGlobalsUsage
48
+
49
+ ##################
50
+
51
+ ## Layout ##
52
+
53
+ # Bare access modifiers (those not applying to specific methods) should be indented as deep as method definitions,
54
+ # or as deep as the class/module keyword, depending on configuration.
55
+ Layout/AccessModifierIndentation:
56
+ EnforcedStyle: outdent
57
+
58
+ # Here we check if the arguments on a multi-line method definition are aligned.
59
+ # Layout/ArgumentAlignment
60
+
61
+ # Here we check if the elements of a multi-line array literal are aligned.
62
+ # Layout/ArrayAlignment
63
+
64
+ # This cop checks the indentation of the first line of the right-hand-side of a multi-line assignment.
65
+ # Layout/AssignmentIndentation
66
+
67
+ # This cop checks whether the end keyword of begin is aligned properly.
68
+ Layout/BeginEndAlignment:
69
+ EnforcedStyleAlignWith: begin
70
+
71
+ # This cop checks whether the end keywords are aligned properly for do end blocks.
72
+ Layout/BlockAlignment:
73
+ EnforcedStyleAlignWith: start_of_block
74
+
75
+ # This cop checks whether the end statement of a do..end block is on its own line.
76
+ # Layout/BlockEndNewline
77
+
78
+ # This cop checks how the when and in`s of a `case expression are indented in relation to its case or end keyword.
79
+ # Layout/CaseIndentation
80
+
81
+ # Checks if the code style follows the ExpectedOrder configuration.
82
+ # Layout/ClassStructure
83
+
84
+ # Checks the indentation of here document closings.
85
+ # Layout/ClosingHeredocIndentation
86
+
87
+ # This cop checks the indentation of hanging closing parentheses in method calls,
88
+ # method definitions, and grouped expressions. A hanging closing parenthesis means ) preceded by a line break.
89
+ # Layout/ClosingParenthesisIndentation
90
+
91
+ # This cop checks the indentation of comments.
92
+ Layout/CommentIndentation:
93
+ AllowForAlignment: true
94
+
95
+ # This cop checks for conditions that are not on the same line as if/while/until.
96
+ # Layout/ConditionPosition
97
+
98
+ # This cop checks whether the end keywords of method definitions are aligned properly.
99
+ # Layout/DefEndAlignment
100
+
101
+ # This cop checks the . position in multi-line method calls.
102
+ # Layout/DotPosition
103
+
104
+ # This cop checks the alignment of else keywords.
105
+ # Layout/ElseAlignment
106
+
107
+ # This cop checks empty comment.
108
+ # Layout/EmptyComment
109
+
110
+ # This cop enforces empty line after guard clause.
111
+ # Layout/EmptyLineAfterGuardClause
112
+
113
+ # Checks for a newline after the final magic comment.
114
+ # Layout/EmptyLineAfterMagicComment
115
+
116
+ # This cop enforces empty line after multiline condition.
117
+ Layout/EmptyLineAfterMultilineCondition:
118
+ Enabled: true
119
+
120
+ # This cop checks whether class/module/method definitions are separated by one or more empty lines.
121
+ # Layout/EmptyLineBetweenDefs
122
+
123
+ # This cop checks for two or more consecutive blank lines.
124
+ # Layout/EmptyLines
125
+
126
+ # Access modifiers should be surrounded by blank lines.
127
+ # Layout/EmptyLinesAroundAccessModifier
128
+
129
+ # This cop checks if empty lines exist around the arguments of a method invocation.
130
+ # Layout/EmptyLinesAroundArguments
131
+
132
+ # Checks for a newline after an attribute accessor or a group of them.
133
+ # Layout/EmptyLinesAroundAttributeAccessor
134
+
135
+ # This cop checks if empty lines exist around the bodies of begin-end blocks.
136
+ # Layout/EmptyLinesAroundBeginBody
137
+
138
+ # This cop checks if empty lines around the bodies of blocks match the configuration.
139
+ # Layout/EmptyLinesAroundBlockBody
140
+
141
+ # This cop checks if empty lines around the bodies of classes match the configuration.
142
+ # Layout/EmptyLinesAroundClassBody
143
+
144
+ # This cop checks if empty lines exist around the bodies of begin sections.
145
+ # This checks rescue/else/ensure clauses in begin blocks.
146
+ # Layout/EmptyLinesAroundExceptionHandlingKeywords
147
+
148
+ # This cop checks if empty lines exist around the bodies of methods.
149
+ # Layout/EmptyLinesAroundMethodBody
150
+
151
+ # This cop checks if empty lines around the bodies of modules match the configuration.
152
+ # Layout/EmptyLinesAroundModuleBody
153
+
154
+ # This cop checks whether the end keywords are aligned properly.
155
+ # Layout/EndAlignment
156
+
157
+ # This cop checks for Windows-style line endings in the source code.
158
+ Layout/EndOfLine:
159
+ EnforcedStyle: lf
160
+
161
+ # This cop checks for extra/unnecessary whitespace.
162
+ Layout/ExtraSpacing:
163
+ AllowForAlignment: true
164
+ AllowBeforeTrailingComments: true
165
+
166
+ # This cop checks the indentation of the first argument in a method call.
167
+ # Layout/FirstArgumentIndentation
168
+
169
+ # This cop checks the indentation of the first element in an array literal where the opening bracket
170
+ # and the first element are on separate lines.
171
+ # Layout/FirstArrayElementIndentation
172
+
173
+ # This cop checks for a line break before the first element in a multi-line array.
174
+ # Layout/FirstArrayElementLineBreak
175
+
176
+ # This cop checks the indentation of the first key in a hash literal where the opening brace
177
+ # and the first key are on separate lines.
178
+ # Layout/FirstHashElementIndentation
179
+
180
+ # This cop checks for a line break before the first element in a multi-line hash.
181
+ # Layout/FirstHashElementLineBreak
182
+
183
+ # This cop checks for a line break before the first argument in a multi-line method call.
184
+ # Layout/FirstMethodArgumentLineBreak
185
+
186
+ # This cop checks for a line break before the first parameter in a multi-line method parameter definition.
187
+ # Layout/FirstMethodParameterLineBreak
188
+
189
+ # This cop checks the indentation of the first parameter in a method definition.
190
+ # Layout/FirstParameterIndentation
191
+
192
+ # Check that the keys, separators, and values of a multi-line hash literal are aligned according to configuration.
193
+ Layout/HashAlignment:
194
+ EnforcedHashRocketStyle: table
195
+ EnforcedColonStyle: table
196
+ EnforcedLastArgumentHashStyle: ignore_implicit
197
+
198
+ # This cop checks for the placement of the closing parenthesis in a method call that passes a HEREDOC string as an argument.
199
+ # Layout/HeredocArgumentClosingParenthesis
200
+
201
+ # This cop checks the indentation of the here document bodies.
202
+ # Layout/HeredocIndentation
203
+
204
+ # This cop checks for inconsistent indentation.
205
+ # Layout/IndentationConsistency
206
+
207
+ # This cop checks that the indentation method is consistent. Either tabs only or spaces only are used for indentation.
208
+ # Layout/IndentationStyle
209
+
210
+ # This cop checks for indentation that doesn’t use the specified number of spaces.
211
+ # Layout/IndentationWidth
212
+
213
+ # This cop checks for indentation of the first non-blank non-comment line in a file.
214
+ # Layout/InitialIndentation
215
+
216
+ # This cop checks whether comments have a leading space after # the denoting the start of the comment.
217
+ # Layout/LeadingCommentSpace
218
+
219
+ # This cop checks for unnecessary leading blank lines at the beginning of a file.
220
+ # Layout/LeadingEmptyLines
221
+
222
+ # This cop checks the indentation of the next line after a line that ends with a string literal and a backslash.
223
+ Layout/LineEndStringConcatenationIndentation:
224
+ Enabled: true
225
+
226
+ # This cop checks the length of lines in the source code.
227
+ # Layout/LineLength
228
+
229
+ # This cop checks that the closing brace in an array literal is either on the same line as the last array element or on a new line.
230
+ # Layout/MultilineArrayBraceLayout
231
+
232
+ # This cop ensures that each item in a multi-line array starts on a separate line.
233
+ Layout/MultilineArrayLineBreaks:
234
+ Enabled: true
235
+
236
+ # This cop checks whether the multiline assignments have a newline after the assignment operator.
237
+ Layout/MultilineAssignmentLayout:
238
+ Enabled: true
239
+ EnforcedStyle: same_line
240
+
241
+ # This cop checks whether the multiline do end blocks have a newline after the start of the block.
242
+ # Layout/MultilineBlockLayout
243
+
244
+ # This cop checks that the closing brace in a hash literal is either on the same line as the last hash element, or a new line.
245
+ # Layout/MultilineHashBraceLayout
246
+
247
+ # This cop ensures that each key in a multi-line hash starts on a separate line.
248
+ Layout/MultilineHashKeyLineBreaks:
249
+ Enabled: true
250
+
251
+ # This cop ensures that each argument in a multi-line method call starts on a separate line.
252
+ Layout/MultilineMethodArgumentLineBreaks:
253
+ Enabled: true
254
+
255
+ # This cop checks that the closing brace in a method call is either on the same line as the last method argument, or a new line.
256
+ # Layout/MultilineMethodCallBraceLayout
257
+
258
+ # This cop checks the indentation of the method name part in method calls that span more than one line.
259
+ Layout/MultilineMethodCallIndentation:
260
+ EnforcedStyle: indented_relative_to_receiver
261
+
262
+ # This cop checks that the closing brace in a method definition is either on the same line as the last method parameter, or a new line.
263
+ # Layout/MultilineMethodDefinitionBraceLayout
264
+
265
+ # This cop checks the indentation of the right hand side operand in binary operations that span more than one line.
266
+ # Layout/MultilineOperationIndentation
267
+
268
+ # Here we check if the parameters on a multi-line method call or definition are aligned.
269
+ # Layout/ParameterAlignment
270
+
271
+ # This cop checks whether certain expressions, e.g. method calls, that could fit completely on a single line,
272
+ # are broken up into multiple lines unnecessarily.
273
+ # Layout/RedundantLineBreak
274
+
275
+ # This cop checks whether the rescue and ensure keywords are aligned properly.
276
+ # Layout/RescueEnsureAlignment
277
+
278
+ # This cop checks if method calls are chained onto single line blocks. It considers that a line break before the dot improves the readability of the code.
279
+ Layout/SingleLineBlockChain:
280
+ Enabled: true
281
+
282
+ # Checks for colon (:) not followed by some kind of space.
283
+ # Layout/SpaceAfterColon
284
+
285
+ # Checks for comma (,) not followed by some kind of space.
286
+ # Layout/SpaceAfterComma
287
+
288
+ # Checks for space between a method name and a left parenthesis in defs.
289
+ # Layout/SpaceAfterMethodName
290
+
291
+ # This cop checks for space after !.
292
+ # Layout/SpaceAfterNot
293
+
294
+ # Checks for semicolon (;) not followed by some kind of space.
295
+ # Layout/SpaceAfterSemicolon
296
+
297
+ # Checks the spacing inside and after block parameters pipes.
298
+ # Layout/SpaceAroundBlockParameters
299
+
300
+ # Checks that the equals signs in parameter default assignments have or don’t have surrounding space depending on configuration.
301
+ Layout/SpaceAroundEqualsInParameterDefault:
302
+ EnforcedStyle: no_space
303
+
304
+ # Checks the spacing around the keywords.
305
+ # Layout/SpaceAroundKeyword
306
+
307
+ # Checks method call operators to not have spaces around them.
308
+ # Layout/SpaceAroundMethodCallOperator
309
+
310
+ # Checks that operators have space around them, except for ** which should or shouldn’t have surrounding space depending on configuration.
311
+ Layout/SpaceAroundOperators:
312
+ EnforcedStyleForExponentOperator: space
313
+
314
+ # Checks that block braces have or don’t have a space before the opening brace depending on configuration.
315
+ # Layout/SpaceBeforeBlockBraces
316
+
317
+ # Checks for space between the name of a receiver and a left brackets.
318
+ Layout/SpaceBeforeBrackets:
319
+ Enabled: true
320
+
321
+ # Checks for comma (,) preceded by space.
322
+ # Layout/SpaceBeforeComma
323
+
324
+ # This cop checks for missing space between a token and a comment on the same line.
325
+ # Layout/SpaceBeforeComment
326
+
327
+ # Checks that exactly one space is used between a method name and the first argument for method calls without parentheses.
328
+ # Layout/SpaceBeforeFirstArg
329
+
330
+ # Checks for semicolon (;) preceded by space.
331
+ # Layout/SpaceBeforeSemicolon
332
+
333
+ # This cop checks for spaces between → and opening parameter parenthesis (() in lambda literals.
334
+ # Layout/SpaceInLambdaLiteral
335
+
336
+ # Checks that brackets used for array literals have or don’t have surrounding space depending on configuration.
337
+ # Layout/SpaceInsideArrayLiteralBrackets
338
+
339
+ # Checks for unnecessary additional spaces inside array percent literals (i.e. %i/%w).
340
+ # Layout/SpaceInsideArrayPercentLiteral
341
+
342
+ # Checks that block braces have or don’t have surrounding space inside them on configuration.
343
+ # Layout/SpaceInsideBlockBraces
344
+
345
+ # Checks that braces used for hash literals have or don’t have surrounding space depending on configuration.
346
+ Layout/SpaceInsideHashLiteralBraces:
347
+ EnforcedStyle: no_space
348
+
349
+ # Checks for spaces inside ordinary round parentheses.
350
+ # Layout/SpaceInsideParens
351
+
352
+ # Checks for unnecessary additional spaces inside the delimiters of %i/%w/%x literals.
353
+ # Layout/SpaceInsidePercentLiteralDelimiters
354
+
355
+ # Checks for spaces inside range literals.
356
+ # Layout/SpaceInsideRangeLiteral
357
+
358
+ # Checks that reference brackets have or don’t have surrounding space depending on configuration.
359
+ # Layout/SpaceInsideReferenceBrackets
360
+
361
+ # This cop checks for whitespace within string interpolations.
362
+ # Layout/SpaceInsideStringInterpolation
363
+
364
+ # This cop looks for trailing blank lines and a final newline in the source code.
365
+ # Layout/TrailingEmptyLines
366
+
367
+ # This cop looks for trailing whitespace in the source code.
368
+ Layout/TrailingWhitespace:
369
+ AllowInHeredoc: true
370
+
371
+ ##################
372
+
373
+ ## Lint ##
374
+
375
+ # This cop checks for mistyped shorthand assignments.
376
+ Lint/AmbiguousAssignment:
377
+ Enabled: true
378
+
379
+ # This cop checks for ambiguous block association with method when param passed without parentheses.
380
+ # Lint/AmbiguousBlockAssociation
381
+
382
+ # This cop checks for ambiguous operators in the first argument of a method invocation without parentheses.
383
+ # Lint/AmbiguousOperator
384
+
385
+ # This cop looks for expressions containing multiple binary operators where precedence is ambiguous due to lack of parentheses.
386
+ Lint/AmbiguousOperatorPrecedence:
387
+ Enabled: true
388
+
389
+ # This cop checks for ambiguous ranges.
390
+ Lint/AmbiguousRange:
391
+ Enabled: true
392
+ RequireParenthesesForMethodChains: true
393
+
394
+ # This cop checks for ambiguous regexp literals in the first argument of a method invocation without parentheses.
395
+ # Lint/AmbiguousRegexpLiteral
396
+
397
+ # This cop checks for assignments in the conditions of if/while/until.
398
+ Lint/AssignmentInCondition:
399
+ AllowSafeAssignment: false # Severo ma giusto.
400
+
401
+ # BigDecimal.new() is deprecated since BigDecimal 1.3.3.
402
+ # This cop identifies places where BigDecimal.new() can be replaced by BigDecimal().
403
+ # Lint/BigDecimalNew
404
+
405
+ # This cop checks for places where binary operator has identical operands.
406
+ # Lint/BinaryOperatorWithIdenticalOperands
407
+
408
+ # This cop checks for :true and :false symbols. In most cases it would be a typo.
409
+ # Lint/BooleanSymbol
410
+
411
+ # This cop checks for circular argument references in optional keyword arguments and optional ordinal arguments.
412
+ # Lint/CircularArgumentReference
413
+
414
+ # Do not define constants within a block, since the block’s scope does not isolate or namespace the constant in any way.
415
+ # Lint/ConstantDefinitionInBlock
416
+
417
+ # Check that certain constants are fully qualified.
418
+ # Lint/ConstantResolution
419
+
420
+ # This cop checks for debug calls (such as debugger or binding.pry) that should not be kept for production code.
421
+ # Lint/Debugger
422
+
423
+ # This cop checks for uses of the deprecated class method usages.
424
+ # Lint/DeprecatedClassMethods
425
+
426
+ # This cop checks for deprecated constants.
427
+ Lint/DeprecatedConstants:
428
+ Enabled: true
429
+
430
+ # Algorithmic constants for OpenSSL::Cipher and OpenSSL::Digest deprecated since OpenSSL version 2.2.0.
431
+ # Lint/DeprecatedOpenSSLConstant
432
+
433
+ # This cop checks constructors for disjunctive assignments (||=) that should be plain assignments.
434
+ # So far, this cop is only concerned with disjunctive assignment of instance variables.
435
+ # Lint/DisjunctiveAssignmentInConstructor
436
+
437
+ # This cop checks that there are no repeated bodies within if/unless, case-when, case-in and rescue constructs.
438
+ Lint/DuplicateBranch:
439
+ Enabled: true
440
+ IgnoreLiteralBranches: true
441
+ IgnoreConstantBranches: true
442
+
443
+ # This cop checks that there are no repeated conditions used in case 'when' expressions.
444
+ # Lint/DuplicateCaseCondition
445
+
446
+ # This cop checks that there are no repeated conditions used in if 'elsif'.
447
+ # Lint/DuplicateElsifCondition
448
+
449
+ # This cop checks for duplicated keys in hash literals.
450
+ # Lint/DuplicateHashKey
451
+
452
+ # This cop checks for duplicated instance (or singleton) method definitions.
453
+ # Lint/DuplicateMethods
454
+
455
+ # This cop checks for duplicate elements in Regexp character classes.
456
+ Lint/DuplicateRegexpCharacterClassElement:
457
+ Enabled: true
458
+
459
+ # This cop checks for duplicate `require`s and `require_relative`s.
460
+ # Lint/DuplicateRequire
461
+
462
+ # This cop checks that there are no repeated exceptions used in 'rescue' expressions.
463
+ # Lint/DuplicateRescueException
464
+
465
+ # This cop checks if each_with_object is called with an immutable argument.
466
+ # Lint/EachWithObjectArgument
467
+
468
+ # This cop checks for odd else block layout - like having an expression on the same line as the else keyword, which is usually a mistake.
469
+ # Lint/ElseLayout
470
+
471
+ # This cop checks for blocks without a body. Such empty blocks are typically an oversight
472
+ # or we should provide a comment to be clearer what we’re aiming for.
473
+ Lint/EmptyBlock:
474
+ Enabled: true
475
+
476
+ # This cop checks for classes and metaclasses without a body.
477
+ # Such empty classes and metaclasses are typically an oversight or we should provide a comment to be clearer what we’re aiming for.
478
+ Lint/EmptyClass:
479
+ Enabled: true
480
+ AllowComments: true
481
+
482
+ # This cop checks for the presence of if, elsif and unless branches without a body.
483
+ # Lint/EmptyConditionalBody
484
+
485
+ # This cop checks for empty ensure blocks
486
+ # Lint/EmptyEnsure
487
+
488
+ # This cop checks for the presence of empty expressions.
489
+ # Lint/EmptyExpression
490
+
491
+ # This cop enforces that Ruby source files are not empty.
492
+ # Lint/EmptyFile
493
+
494
+ # This cop checks for the presence of in pattern branches without a body.
495
+ Lint/EmptyInPattern:
496
+ Enabled: true
497
+
498
+ # This cop checks for empty interpolation.
499
+ # Lint/EmptyInterpolation
500
+
501
+ # This cop checks for the presence of when branches without a body.
502
+ # Lint/EmptyWhen
503
+
504
+ # This cop checks for return from an ensure block. return from an ensure block is a dangerous code smell as
505
+ # it will take precedence over any exception being raised, and the exception will be silently thrown away as if it were rescued.
506
+ # Lint/EnsureReturn
507
+
508
+ # This checks for a deprecated use of ERB.new .
509
+ # Lint/ErbNewArguments
510
+
511
+ # This cop looks for uses of flip-flop operator based on the Ruby Style Guide.
512
+ # Lint/FlipFlop
513
+
514
+ # This cop checks for the presence of precise comparison of floating point numbers.
515
+ # Lint/FloatComparison
516
+
517
+ # This cop identifies Float literals which are, like, really really really really really really really really big.
518
+ # Too big. No-one needs Floats that big. If you need a float that big, something is wrong with you.
519
+ # Lint/FloatOutOfRange
520
+
521
+ # This lint sees if there is a mismatch between the number of expected fields for format/sprintf/#% and what is actually passed as arguments.
522
+ # Lint/FormatParameterMismatch
523
+
524
+ # Prefer using Hash#compare_by_identity rather than using object_id for hash keys.
525
+ # Lint/HashCompareByIdentity
526
+
527
+ # This cop checks for the ordering of a method call where the receiver of the call is a HEREDOC.
528
+ Lint/HeredocMethodCallPosition:
529
+ Enabled: true
530
+
531
+ # Prefer equal? over == when comparing object_id.
532
+ # Lint/IdentityComparison
533
+
534
+ # This cop checks for implicit string concatenation of string literals which are on the same line.
535
+ # Lint/ImplicitStringConcatenation
536
+
537
+ # This cop checks for IO.select that is incompatible with Fiber Scheduler since Ruby 3.0.
538
+ Lint/IncompatibleIoSelectWithFiberScheduler:
539
+ Enabled: false
540
+
541
+ # This cop checks for private or protected access modifiers which are applied to a singleton method.
542
+ # These access modifiers do not make singleton methods private/protected. private_class_method can be used for that.
543
+ # Lint/IneffectiveAccessModifier
544
+
545
+ # This cop looks for error classes inheriting from Exception and its standard library subclasses, excluding subclasses of StandardError.
546
+ # Lint/InheritException
547
+
548
+ # This cop checks for interpolation in a single quoted string.
549
+ # Lint/InterpolationCheck
550
+
551
+ # This cop checks uses of lambda without a literal block.
552
+ Lint/LambdaWithoutLiteralBlock:
553
+ Enabled: true
554
+
555
+ # This cop checks for literals used as the conditions or as operands in and/or expressions serving as the conditions of if/while/until/case-when/case-in.
556
+ # Lint/LiteralAsCondition
557
+
558
+ # This cop checks for interpolated literals.
559
+ # Lint/LiteralInInterpolation
560
+
561
+ # This cop checks for uses of begin…end while/until something.
562
+ # Lint/Loop
563
+
564
+ # This cop checks that there is an # rubocop:enable … statement after a # rubocop:disable … statement.
565
+ # This will prevent leaving cop disables on wide ranges of code, that latter contributors to a file wouldn’t be aware of.
566
+ # Lint/MissingCopEnableDirective
567
+
568
+ # This cop checks for the presence of constructors and lifecycle callbacks without calls to super.
569
+ # Lint/MissingSuper
570
+
571
+ # Do not mix named captures and numbered captures in a Regexp literal because numbered capture is ignored if they’re mixed.
572
+ # Replace numbered captures with non-capturing groupings or named captures.
573
+ # Lint/MixedRegexpCaptureTypes
574
+
575
+ # In math and Python, we can use x < y < z style comparison to compare multiple value. However, we can’t use the comparison in Ruby.
576
+ # However, the comparison is not syntax error. This cop checks the bad usage of comparison operators.
577
+ # Lint/MultipleComparison
578
+
579
+ # This cop checks for nested method definitions.
580
+ # Lint/NestedMethodDefinition
581
+
582
+ # This cop checks for nested percent literals.
583
+ # Lint/NestedPercentLiteral
584
+
585
+ # Don’t omit the accumulator when calling next in a reduce block.
586
+ # Lint/NextWithoutAccumulator
587
+
588
+ # Checks for the presence of a return inside a begin..end block in assignment contexts.
589
+ # In this situation, the return will result in an exit from the current method, possibly leading to unexpected behavior.
590
+ Lint/NoReturnInBeginEndBlocks:
591
+ Enabled: true
592
+
593
+ # Dir[…] and Dir.glob(…) do not make any guarantees about the order in which files are returned
594
+ # Lint/NonDeterministicRequireOrder
595
+
596
+ # This cop checks for non-local exits from iterators without a return value.
597
+ # Lint/NonLocalExitFromIterator
598
+
599
+ # This cop warns the usage of unsafe number conversions.
600
+ # Enable this in the generic project
601
+ # Lint/NumberConversion
602
+
603
+ # This cop checks for uses of numbered parameter assignment.
604
+ Lint/NumberedParameterAssignment:
605
+ Enabled: true
606
+
607
+ # This cop checks for unintended or-assignment to a constant.
608
+ Lint/OrAssignmentToConstant:
609
+ Enabled: true
610
+
611
+ # Checks the proper ordering of magic comments and whether a magic comment is not placed before a shebang.
612
+ # Lint/OrderedMagicComments
613
+
614
+ # This cops looks for references of Regexp captures that are out of range and thus always returns nil.
615
+ # Lint/OutOfRangeRegexpRef
616
+
617
+ # Checks for space between the name of a called method and a left parenthesis.
618
+ # Lint/ParenthesesAsGroupedExpression
619
+
620
+ # This cop checks for quotes and commas in %w, e.g. %w('foo', "bar")
621
+ # Lint/PercentStringArray
622
+
623
+ # This cop checks for colons and commas in %i, e.g. %i(:foo, :bar)
624
+ # Lint/PercentSymbolArray
625
+
626
+ # This cop checks for raise or fail statements which are raising Exception class.
627
+ # Lint/RaiseException
628
+
629
+ # This cop checks for rand(1) calls. Such calls always return 0.
630
+ # Lint/RandOne
631
+
632
+ # This cop detects instances of rubocop:disable comments that can be removed without causing any offenses to be reported.
633
+ # Lint/RedundantCopDisableDirective
634
+
635
+ # This cop detects instances of rubocop:enable comments that can be removed.
636
+ # Lint/RedundantCopEnableDirective
637
+
638
+ # Sort globbed results by default in Ruby 3.0. This cop checks for redundant sort method to Dir.glob and Dir[].
639
+ Lint/RedundantDirGlobSort:
640
+ Enabled: true
641
+
642
+ # Checks for unnecessary require statement.
643
+ # Lint/RedundantRequireStatement
644
+
645
+ # This cop checks for redundant safe navigation calls.
646
+ # Lint/RedundantSafeNavigation
647
+
648
+ # This cop checks for unneeded usages of splat expansion.
649
+ Lint/RedundantSplatExpansion:
650
+ AllowPercentLiteralArrayArgument: false
651
+
652
+ # This cop checks for string conversion in string interpolation, which is redundant.
653
+ # Lint/RedundantStringCoercion
654
+
655
+ # This cop checks for redundant with_index.
656
+ # Lint/RedundantWithIndex
657
+
658
+ # This cop checks for redundant with_object.
659
+ # Lint/RedundantWithObject
660
+
661
+ # This cop checks for regexp literals used as match-current-line. If a regexp literal is in condition, the regexp matches $_ implicitly.
662
+ # Lint/RegexpAsCondition
663
+
664
+ # This cop checks for expressions where there is a call to a predicate method with at least one argument,
665
+ # where no parentheses are used around the parameter list, and a boolean operator, && or ||, is used in the last argument.
666
+ # Lint/RequireParentheses
667
+
668
+ # Checks for uses a file requiring itself with require_relative.
669
+ Lint/RequireRelativeSelfPath:
670
+ Enabled: true
671
+
672
+ # This cop checks for rescue blocks targeting the Exception class.
673
+ # Lint/RescueException
674
+
675
+ # Check for arguments to rescue that will result in a TypeError if an exception is raised.
676
+ # Lint/RescueType
677
+
678
+ # This cop checks for the use of a return with a value in a context where the value will be ignored (initialize and setter methods).
679
+ # Lint/ReturnInVoidContext
680
+
681
+ # The safe navigation operator returns nil if the receiver is nil. If you chain an ordinary method call
682
+ # after a safe navigation operator, it raises NoMethodError. We should use a safe navigation operator after a safe navigation operator.
683
+ # Lint/SafeNavigationChain
684
+
685
+ # This cop check to make sure that if safe navigation is used for a method call in an && or || condition that
686
+ # safe navigation is used for all method calls on that same object.
687
+ # Lint/SafeNavigationConsistency
688
+
689
+ # This cop checks to make sure safe navigation isn’t used with empty? in a conditional.
690
+ # Lint/SafeNavigationWithEmpty
691
+
692
+ # This cop checks if a file which has a shebang line as its first line is granted execute permission.
693
+ # Lint/ScriptPermission
694
+
695
+ # This cop checks for self-assignments.
696
+ # Lint/SelfAssignment
697
+
698
+ # This cop checks for send, public_send, and send methods when using mix-in.
699
+ # Lint/SendWithMixinArgument
700
+
701
+ # This cop checks for shadowed arguments.
702
+ # Lint/ShadowedArgument
703
+
704
+ # This cop checks for a rescued exception that get shadowed by a less specific exception being rescued before a more specific exception is rescued.
705
+ # Lint/ShadowedException
706
+
707
+ # This cop checks for the use of local variable names from an outer scope in block arguments or block-local variables.
708
+ # Lint/ShadowingOuterLocalVariable
709
+
710
+ # This cop checks unexpected overrides of the Struct built-in methods via Struct.new.
711
+ # Lint/StructNewOverride
712
+
713
+ # This cop checks for rescue blocks with no body.
714
+ # Lint/SuppressedException
715
+
716
+ # This cop checks for uses of literal strings converted to a symbol where a literal symbol could be used instead.
717
+ Lint/SymbolConversion:
718
+ Enabled: true
719
+
720
+ # This cop repacks Parser’s diagnostics/errors into RuboCop’s offenses.
721
+ # Lint/Syntax
722
+
723
+ # This cop ensures that to_enum/enum_for, called for the current method, has correct arguments.
724
+ Lint/ToEnumArguments:
725
+ Enabled: true
726
+
727
+ # This cop checks to make sure #to_json includes an optional argument.
728
+ # Lint/ToJSON
729
+
730
+ # This cop checks for top level return with arguments. If there is a top-level return statement with an argument, then the argument is always ignored.
731
+ # Lint/TopLevelReturnWithArgument
732
+
733
+ # This cop checks for trailing commas in attribute declarations, such as #attr_reader.
734
+ # Leaving a trailing comma will nullify the next method definition by overriding it with a getter method.
735
+ # Lint/TrailingCommaInAttributeDeclaration
736
+
737
+ # This cop checks for "triple quotes" (strings delimited by any odd number of quotes greater than 1).
738
+ Lint/TripleQuotes:
739
+ Enabled: true
740
+
741
+ # This cop checks for underscore-prefixed variables that are actually used.
742
+ # Lint/UnderscorePrefixedVariableName
743
+
744
+ # This cop checks for a block that is known to need more positional block arguments than are given.
745
+ Lint/UnexpectedBlockArity:
746
+ Enabled: true
747
+
748
+ # This cop checks for using Fixnum or Bignum constant.
749
+ # Lint/UnifiedInteger
750
+
751
+ # Looks for reduce or inject blocks where the value returned (implicitly or explicitly) does not include the accumulator.
752
+ Lint/UnmodifiedReduceAccumulator:
753
+ Enabled: true
754
+
755
+ # This cop checks for unreachable code.
756
+ # Lint/UnreachableCode
757
+
758
+ # This cop checks for loops that will have at most one iteration.
759
+ # Lint/UnreachableLoop
760
+
761
+ # This cop checks for unused block arguments.
762
+ Lint/UnusedBlockArgument:
763
+ AutoCorrect: false
764
+
765
+ # This cop checks for unused method arguments.
766
+ Lint/UnusedMethodArgument:
767
+ AutoCorrect: false
768
+
769
+ # This cop identifies places where URI.escape can be replaced by CGI.escape, URI.encode_www_form,
770
+ # or URI.encode_www_form_component depending on your specific use case.
771
+ # Also this cop identifies places where URI.unescape can be replaced by CGI.unescape, URI.decode_www_form,
772
+ # or URI.decode_www_form_component depending on your specific use case.
773
+ # Lint/UriEscapeUnescape
774
+
775
+ # This cop identifies places where URI.regexp is obsolete and should not be used.
776
+ # Lint/UriRegexp
777
+
778
+ # This cop checks for redundant access modifiers.
779
+ # Lint/UselessAccessModifier
780
+
781
+ # This cop checks for every useless assignment to local variable in every scope.
782
+ # Lint/UselessAssignment
783
+
784
+ # This cop checks for useless else in begin..end without rescue.
785
+ # Lint/UselessElseWithoutRescue
786
+
787
+ # This cop checks for useless method definitions, specifically: empty constructors and methods just delegating to super.
788
+ # Lint/UselessMethodDefinition
789
+
790
+ # This cop looks for ruby2_keywords calls for methods that do not need it.
791
+ Lint/UselessRuby2Keywords:
792
+ Enabled: true
793
+
794
+ # This cop checks for setter call to local variable as the final expression of a function definition.
795
+ # Lint/UselessSetterCall
796
+
797
+ # This cop checks for uses of Integer#times that will never yield (when the integer ⇐ 0) or that will only ever yield once (1.times).
798
+ # Lint/UselessTimes
799
+
800
+ # This cop checks for operators, variables, literals, and nonmutating methods used in void context.
801
+ # Lint/Void
802
+
803
+ ##################
804
+
805
+ ## Metrics ##
806
+
807
+ Metrics:
808
+ Enabled: false
809
+
810
+ ##################
811
+
812
+ ## Naming ##
813
+
814
+ # This cop makes sure that accessor methods are named properly. Applies to both instance and class methods.
815
+ # Naming/AccessorMethodName
816
+
817
+ # This cop checks for non-ascii characters in identifier and constant names.
818
+ # Naming/AsciiIdentifiers
819
+
820
+ # This cop makes sure that certain binary operator methods have their sole parameter named other.
821
+ # Naming/BinaryOperatorParameterName
822
+
823
+ # This cop checks block parameter names for how descriptive they are.
824
+ # Naming/BlockParameterName:
825
+
826
+ # This cop checks for class and module names with an underscore in them.
827
+ # Naming/ClassAndModuleCamelCase
828
+
829
+ # This cop checks whether constant names are written using SCREAMING_SNAKE_CASE.
830
+ # Naming/ConstantName
831
+
832
+ # This cop makes sure that Ruby source files have snake_case names.
833
+ # Naming/FileName
834
+
835
+ # This cop checks that your heredocs are using the configured case.
836
+ # Naming/HeredocDelimiterCase
837
+
838
+ # This cop checks that your heredocs are using meaningful delimiters.
839
+ # Naming/HeredocDelimiterNaming
840
+
841
+ # This cops recommends the use of inclusive language instead of problematic terms.
842
+ # Note: really?
843
+ Naming/InclusiveLanguage:
844
+ Enabled: false
845
+
846
+ # This cop checks for memoized methods whose instance variable name does not match the method name.
847
+ # Naming/MemoizedInstanceVariableName
848
+
849
+ # This cop makes sure that all methods use the configured style, snake_case or camelCase, for their names.
850
+ # Naming/MethodName
851
+
852
+ # This cop checks method parameter names for how descriptive they are. It is highly configurable.
853
+ # Naming/MethodParameterName
854
+
855
+ # This cop makes sure that predicates are named properly.
856
+ # Naming/PredicateName
857
+
858
+ # This cop makes sure that rescued exceptions variables are named as expected.
859
+ # Naming/RescuedExceptionsVariableName
860
+
861
+ # This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.
862
+ # Naming/VariableName
863
+
864
+ # This cop makes sure that all numbered variables use the configured style, snake_case, normalcase, or non_integer, for their numbering.
865
+ # Naming/VariableNumber
866
+
867
+ ##################
868
+
869
+ ## Security ##
870
+
871
+ # This cop checks for the use of Kernel#eval and Binding#eval.
872
+ Security/Eval:
873
+ Enabled: false
874
+
875
+ # Checks for the first argument to IO.read, IO.binread, IO.write, IO.binwrite, IO.foreach, and IO.readlines.
876
+ Security/IoMethods:
877
+ Enabled: true
878
+
879
+ # This cop checks for the use of JSON class methods which have potential security issues.
880
+ # Security/JSONLoad
881
+
882
+ # This cop checks for the use of Marshal class methods which have potential security issues leading to remote code execution when loading from an untrusted source.
883
+ # Security/MarshalLoad
884
+
885
+ # This cop checks for the use of Kernel#open and URI.open with dynamic data.
886
+ # Security/Open
887
+
888
+ # This cop checks for the use of YAML class methods which have potential security issues leading to remote code execution when loading from an untrusted source.
889
+ # Security/YAMLLoad
890
+
891
+ ##################
892
+
893
+ ## Style ##
894
+
895
+ # Access modifiers should be declared to apply to a group of methods or inline before each method, depending on configuration.
896
+ # Style/AccessModifierDeclarations
897
+
898
+ # This cop checks for grouping of accessors in class and module bodies.
899
+ Style/AccessorGrouping:
900
+ EnforcedStyle: separated
901
+
902
+ # This cop enforces the use of either #alias or #alias_method depending on configuration.
903
+ # Style/Alias
904
+
905
+ # This cop checks for uses of and and or, and suggests using && and || instead.
906
+ # Style/AndOr
907
+
908
+ # This cop identifies places where do_something(*args, &block) can be replaced by do_something(…).
909
+ Style/ArgumentsForwarding:
910
+ Enabled: false
911
+
912
+ # This cop enforces the use of Array() instead of explicit Array check or [*var].
913
+ # Style/ArrayCoercion
914
+
915
+ # This cop checks for uses of "*" as a substitute for join.
916
+ # Style/ArrayJoin
917
+
918
+ # This cop checks for non-ascii (non-English) characters in comments.
919
+ # Style/AsciiComments
920
+
921
+ # This cop checks for uses of Module#attr.
922
+ # Style/Attr
923
+
924
+ # This cop checks for cases when you could use a block accepting version of a method that does automatic resource cleanup.
925
+ Style/AutoResourceCleanup:
926
+ Enabled: true
927
+
928
+ # This cop checks if usage of %() or %Q() matches configuration.
929
+ # Style/BarePercentLiterals
930
+
931
+ # This cop checks for BEGIN blocks.
932
+ # Style/BeginBlock
933
+
934
+ # This cop checks for places where attr_reader and attr_writer for the same method can be combined into single attr_accessor.
935
+ # Style/BisectedAttrAccessor
936
+
937
+ # This cop looks for uses of block comments (=begin…=end).
938
+ # Style/BlockComments
939
+
940
+ # Check for uses of braces or do/end around single line or multi-line blocks.
941
+ # Style/BlockDelimiters
942
+
943
+ # This cop checks for uses of the case equality operator(===).
944
+ # Style/CaseEquality
945
+
946
+ # This cop identifies places where if-elsif constructions can be replaced with case-when.
947
+ # Style/CaseLikeIf
948
+
949
+ # Checks for uses of the character literal ?x.
950
+ # Style/CharacterLiteral
951
+
952
+ # This cop checks the style of children definitions at classes and modules.
953
+ # Style/ClassAndModuleChildren
954
+
955
+ # This cop enforces consistent use of Object#is_a? or Object#kind_of?.
956
+ # Style/ClassCheck
957
+
958
+ # This cop enforces the use of Object#instance_of? instead of class comparison for equality.
959
+ # Style/ClassEqualityComparison
960
+
961
+ # This cop checks for uses of the class/module name instead of self, when defining class/module methods.
962
+ # Style/ClassMethods
963
+
964
+ # This cop enforces using def self.method_name or class << self to define class methods.
965
+ # Style/ClassMethodsDefinitions
966
+
967
+ # This cop checks for uses of class variables.
968
+ # Style/ClassVars
969
+
970
+ # This cop checks for places where custom logic on rejection nils from arrays and hashes can be replaced with {Array,Hash}#{compact,compact!}.
971
+ Style/CollectionCompact:
972
+ Enabled: true
973
+
974
+ # This cop enforces the use of consistent method names from the Enumerable module.
975
+ Style/CollectionMethods:
976
+ Enabled: true
977
+
978
+ # This cop checks for methods invoked via the :: operator instead of the . operator (like FileUtils::rmdir instead of FileUtils.rmdir).
979
+ # Style/ColonMethodCall
980
+
981
+ # This cop checks for class methods that are defined using the :: operator instead of the . operator.
982
+ # Style/ColonMethodDefinition
983
+
984
+ # This cop checks for places where multiple consecutive loops over the same data can be combined into a single loop. It is very likely that combining them will make the code more efficient and more concise.
985
+ # Style/CombinableLoops
986
+
987
+ # This cop enforces using ` or %x around command literals.
988
+ # Style/CommandLiteral
989
+
990
+ # This cop checks that comment annotation keywords are written according to guidelines.
991
+ # Style/CommentAnnotation
992
+
993
+ # This cop checks for comments put on the same line as some keywords. These keywords are: class, module, def, begin, end.
994
+ # Style/CommentedKeyword
995
+
996
+ # Check for if and case statements where each branch is used for assignment to the same variable when using the return of the condition can be used instead.
997
+ # Style/ConditionalAssignment
998
+
999
+ # This cop checks that constants defined in classes and modules have an explicit visibility declaration.
1000
+ # Style/ConstantVisibility
1001
+
1002
+ # Check that a copyright notice was given in each source file.
1003
+ # Style/Copyright
1004
+
1005
+ # This cop checks for consistent usage of the DateTime class over the Time class.
1006
+ # Style/DateTime
1007
+
1008
+ # This cop checks for parentheses in the definition of a method, that does not take any arguments.
1009
+ # Style/DefWithParentheses
1010
+
1011
+ # This cop checks for places where the #dir method can replace more complex constructs to retrieve a canonicalized absolute path to the current file.
1012
+ # Style/Dir
1013
+
1014
+ # Detects comments to enable/disable RuboCop. This is useful if want to make sure that every RuboCop error gets fixed and not quickly disabled with a comment.
1015
+ # Style/DisableCopsWithinSourceCodeDirective
1016
+
1017
+ # When using class_eval (or other eval) with string interpolation, add a comment block showing its appearance if interpolated (a practice used in Rails code).
1018
+ Style/DocumentDynamicEvalDefinition:
1019
+ Enabled: false
1020
+
1021
+ # This cop checks for missing top-level documentation of classes and modules.
1022
+ Style/Documentation:
1023
+ Enabled: false
1024
+
1025
+ # This cop checks for missing documentation comment for public methods.
1026
+ Style/DocumentationMethod:
1027
+ Enabled: false
1028
+
1029
+ # Detects double disable comments on one line. This is mostly to catch automatically generated comments that need to be regenerated.
1030
+ # Style/DoubleCopDisableDirective
1031
+
1032
+ # This cop checks for uses of double negation (!!) to convert something to a boolean value.
1033
+ Style/DoubleNegation:
1034
+ EnforcedStyle: forbidden
1035
+
1036
+ # This cop checks for loops which iterate a constant number of times, using a Range literal and #each. This can be done more readably using Integer#times.
1037
+ # Style/EachForSimpleLoop
1038
+
1039
+ # This cop looks for inject / reduce calls where the passed in object is returned at the end and so
1040
+ # could be replaced by each_with_object without the need to return the object at the end.
1041
+ # Style/EachWithObject
1042
+
1043
+ # This cop checks for pipes for empty block parameters. Pipes for empty block parameters do not cause syntax errors, but they are redundant.
1044
+ # Style/EmptyBlockParameter
1045
+
1046
+ # This cop checks for case statements with an empty condition.
1047
+ # Style/EmptyCaseCondition
1048
+
1049
+ # Checks for empty else-clauses, possibly including comments and/or an explicit nil depending on the EnforcedStyle.
1050
+ # Style/EmptyElse
1051
+
1052
+ # This cop checks for parentheses for empty lambda parameters. Parentheses for empty lambda parameters do not cause syntax errors, but they are redundant.
1053
+ # Style/EmptyLambdaParameter
1054
+
1055
+ # This cop checks for the use of a method, the result of which would be a literal, like an empty array, hash, or string.
1056
+ # Style/EmptyLiteral
1057
+
1058
+ # This cop checks for the formatting of empty method definitions.
1059
+ Style/EmptyMethod:
1060
+ EnforcedStyle: expanded
1061
+
1062
+ # This cop checks ensures source files have no utf-8 encoding comments.
1063
+ # Style/Encoding
1064
+
1065
+ # This cop checks for END blocks.
1066
+ # Style/EndBlock
1067
+
1068
+ # This cop checks for endless methods.
1069
+ Style/EndlessMethod:
1070
+ Enabled: true
1071
+ EnforcedStyle: disallow
1072
+
1073
+ # This cop ensures that eval methods (eval, instance_eval, class_eval and module_eval) are given filename and line number values (FILE and LINE).
1074
+ # Style/EvalWithLocation
1075
+
1076
+ # This cop checks for places where Integer#even? or Integer#odd? can be used.
1077
+ # Style/EvenOdd
1078
+
1079
+ # This cop checks for use of the File.expand_path arguments. Likewise, it also checks for the Pathname.new argument.
1080
+ # Style/ExpandPathArguments
1081
+
1082
+ # This cop enforces the use of explicit block argument to avoid writing block literal that just passes its arguments to another block.
1083
+ # Style/ExplicitBlockArgument
1084
+
1085
+ # This cop enforces consistency when using exponential notation for numbers in the code (eg 1.2e4). Different styles are supported:
1086
+ # Style/ExponentialNotation
1087
+
1088
+ # Favor File.(bin)read convenience methods.
1089
+ Style/FileRead:
1090
+ Enabled: true
1091
+
1092
+ # Favor File.(bin)write convenience methods.
1093
+ Style/FileWrite:
1094
+ Enabled: true
1095
+
1096
+ # This cop checks for division with integers coerced to floats. It is recommended to either always use fdiv or coerce one side only. This cop also provides other options for code consistency.
1097
+ # Style/FloatDivision
1098
+
1099
+ # This cop looks for uses of the for keyword or each method. The preferred alternative is set in the EnforcedStyle configuration parameter. An each call with a block on a single line is always allowed.
1100
+ # Style/For
1101
+
1102
+ # This cop enforces the use of a single string formatting utility. Valid options include Kernel#format, Kernel#sprintf and String#%.
1103
+ Style/FormatString:
1104
+ EnforcedStyle: percent
1105
+
1106
+ # Use a consistent style for named format string tokens.
1107
+ # Style/FormatStringToken
1108
+
1109
+ # This cop is designed to help you transition from mutable string literals to frozen string literals.
1110
+ Style/FrozenStringLiteralComment:
1111
+ Enabled: false
1112
+
1113
+ # This cop enforces the use of $stdout/$stderr/$stdin instead of STDOUT/STDERR/STDIN.
1114
+ # Style/GlobalStdStream
1115
+
1116
+ # This cop looks for uses of global variables.
1117
+ # Style/GlobalVars
1118
+
1119
+ # Use a guard clause instead of wrapping the code inside a conditional expression
1120
+ # Style/GuardClause
1121
+
1122
+ # Checks for presence or absence of braces around hash literal as a last array item depending on configuration.
1123
+ # Style/HashAsLastArrayItem
1124
+
1125
+ # This cop checks the usage of pre-2.1 Hash[args] method of converting enumerables and sequences of values to hashes.
1126
+ Style/HashConversion:
1127
+ Enabled: true
1128
+
1129
+ # This cop checks for uses of each_key and each_value Hash methods.
1130
+ # Style/HashEachMethods
1131
+
1132
+ # This cop checks for usages of Hash#reject, Hash#select, and Hash#filter methods that can be replaced with Hash#except method.
1133
+ Style/HashExcept:
1134
+ Enabled: true
1135
+
1136
+ # This cop checks for places where case-when represents a simple 1:1 mapping and can be replaced with a hash lookup.
1137
+ # Style/HashLikeCase
1138
+
1139
+ # This cop checks hash literal syntax.
1140
+ Style/HashSyntax:
1141
+ EnforcedShorthandSyntax: never
1142
+
1143
+ # This cop looks for uses of .each_with_object({}) {…}, .map {…}.to_h, and Hash[_.map {…}] that are actually just transforming the keys of a hash,
1144
+ # and tries to use a simpler & faster call to transform_keys instead.
1145
+ # Style/HashTransformKeys
1146
+
1147
+ # This cop looks for uses of .each_with_object({}) {…}, .map {…}.to_h, and Hash[_.map {…}] that are actually just transforming the values of a hash,
1148
+ # and tries to use a simpler & faster call to transform_values instead.
1149
+ # Style/HashTransformValues
1150
+
1151
+ # This cop checks for identical expressions at the beginning or end of each branch of a conditional expression.
1152
+ # Style/IdenticalConditionalBranches
1153
+
1154
+ # If the else branch of a conditional consists solely of an if node, it can be combined with the else to become an elsif.
1155
+ # Style/IfInsideElse
1156
+
1157
+ # Checks for if and unless statements that would fit on one line if written as modifier if/unless.
1158
+ # Style/IfUnlessModifier
1159
+
1160
+ # Checks for if and unless statements used as modifiers of other if or unless statements.
1161
+ # Style/IfUnlessModifierOfIfUnless
1162
+
1163
+ # This cop checks for redundant if with boolean literal branches.
1164
+ Style/IfWithBooleanLiteralBranches:
1165
+ Enabled: true
1166
+
1167
+ # Checks for uses of semicolon in if statements.
1168
+ # Style/IfWithSemicolon
1169
+
1170
+ # This cop checks for raise or fail statements which do not specify an explicit exception class.
1171
+ Style/ImplicitRuntimeError:
1172
+ Enabled: true
1173
+
1174
+ # This cop checks for in; uses in case expressions.
1175
+ Style/InPatternThen:
1176
+ Enabled: true
1177
+
1178
+ # Use Kernel#loop for infinite loops.
1179
+ # Style/InfiniteLoop
1180
+
1181
+ # This cop checks for trailing inline comments.
1182
+ # Style/InlineComment
1183
+
1184
+ # This cop check for usages of not (not or !) called on a method when an inverse of that method can be used instead.
1185
+ # Style/InverseMethods
1186
+
1187
+ # This cop checks for hardcoded IP addresses, which can make code brittle.
1188
+ Style/IpAddresses:
1189
+ Enabled: true
1190
+
1191
+ # This cop enforces that optional keyword parameters are placed at the end of the parameters list.
1192
+ # Style/KeywordParametersOrder
1193
+
1194
+ # This cop (by default) checks for uses of the lambda literal syntax for single line lambdas, and the method call syntax for multiline lambdas.
1195
+ # Style/Lambda
1196
+
1197
+ # This cop checks for use of the lambda.(args) syntax.
1198
+ # Style/LambdaCall
1199
+
1200
+ # This cop checks for string literal concatenation at the end of a line.
1201
+ # Style/LineEndConcatenation
1202
+
1203
+ # This cop looks for uses of map.to_h or collect.to_h that could be written with just to_h in Ruby >= 2.6.
1204
+ Style/MapToHash:
1205
+ Enabled: true
1206
+
1207
+ # This cop enforces the presence (default) or absence of parentheses in method calls containing parameters.
1208
+ Style/MethodCallWithArgsParentheses:
1209
+ Enabled: true
1210
+ EnforcedStyle: omit_parentheses
1211
+ AllowParenthesesInMultilineCall: true
1212
+ AllowParenthesesInChaining: true
1213
+ AllowParenthesesInCamelCaseMethod: true
1214
+
1215
+ # This cop checks for unwanted parentheses in parameterless method calls.
1216
+ # Style/MethodCallWithoutArgsParentheses
1217
+
1218
+ # This cop checks for methods called on a do…end block.
1219
+ # Style/MethodCalledOnDoEndBlock
1220
+
1221
+ # This cop checks for parentheses around the arguments in method definitions.
1222
+ Style/MethodDefParentheses:
1223
+ EnforcedStyle: require_no_parentheses_except_multiline
1224
+
1225
+ # This cop checks for potential uses of Enumerable#minmax.
1226
+ # Style/MinMax
1227
+
1228
+ # Checks for if expressions that do not have an else branch.
1229
+ # Style/MissingElse
1230
+
1231
+ # This cop checks for the presence of method_missing without also defining respond_to_missing?.
1232
+ # Style/MissingRespondToMissing
1233
+
1234
+ # This cop checks for grouping of mixins in class and module bodies.
1235
+ # Style/MixinGrouping
1236
+
1237
+ # This cop checks that include, extend and prepend statements appear inside classes and modules, not at the top level, so as to not affect the behavior of Object.
1238
+ # Style/MixinUsage
1239
+
1240
+ # This cop checks for use of extend self or module_function in a module.
1241
+ # Style/ModuleFunction
1242
+
1243
+ # This cop checks for chaining of a block after another block that spans multiple lines.
1244
+ Style/MultilineBlockChain:
1245
+ Enabled: false
1246
+
1247
+ # Checks for uses of if/unless modifiers with multiple-lines bodies.
1248
+ # Style/MultilineIfModifier
1249
+
1250
+ # Checks for uses of the then keyword in multi-line if statements.
1251
+ # Style/MultilineIfThen
1252
+
1253
+ # This cop checks uses of the then keyword in multi-line in statement.
1254
+ Style/MultilineInPatternThen:
1255
+ Enabled: true
1256
+
1257
+ # This cop checks expressions wrapping styles for multiline memoization.
1258
+ # Style/MultilineMemoization
1259
+
1260
+ # This cop checks for method signatures that span multiple lines.
1261
+ # Style/MultilineMethodSignature
1262
+
1263
+ # This cop checks for multi-line ternary op expressions.
1264
+ # Style/MultilineTernaryOperator
1265
+
1266
+ # This cop checks uses of the then keyword in multi-line when statements.
1267
+ # Style/MultilineWhenThen
1268
+
1269
+ # This cop checks against comparing a variable with multiple items, where Array#include?, Set#include? or a case could be used instead to avoid code repetition.
1270
+ # Style/MultipleComparison
1271
+
1272
+ # This cop checks whether some constant value isn’t a mutable literal (e.g. array or hash).
1273
+ # Style/MutableConstant
1274
+
1275
+ # Checks for uses of if with a negated condition.
1276
+ # Style/NegatedIf
1277
+
1278
+ # This cop checks for uses of if-else and ternary operators with a negated condition which can be simplified by inverting condition and swapping branches.
1279
+ Style/NegatedIfElseCondition:
1280
+ Enabled: true
1281
+
1282
+ # Checks for uses of unless with a negated condition. Only unless without else are considered. There are three different styles:
1283
+ # Style/NegatedUnless
1284
+
1285
+ # Checks for uses of while with a negated condition.
1286
+ # Style/NegatedWhile
1287
+
1288
+ # This cop checks for nested use of if, unless, while and until in their modifier form.
1289
+ # Style/NestedModifier
1290
+
1291
+ # This cop checks for unparenthesized method calls in the argument list of a parenthesized method call.
1292
+ Style/NestedParenthesizedCalls:
1293
+ Enabled: false
1294
+
1295
+ # This cop checks for nested ternary op expressions.
1296
+ # Style/NestedTernaryOperator
1297
+
1298
+ # Use next to skip iteration instead of a condition at the end.
1299
+ # Style/Next
1300
+
1301
+ # This cop checks for comparison of something with nil using == and nil?.
1302
+ # Style/NilComparison
1303
+
1304
+ # This cop checks for lambdas and procs that always return nil, which can be replaced with an empty lambda or proc instead.
1305
+ Style/NilLambda:
1306
+ Enabled: true
1307
+
1308
+ # This cop checks for non-nil checks, which are usually redundant.
1309
+ Style/NonNilCheck:
1310
+ Enabled: false
1311
+
1312
+ # This cop checks for uses of the keyword not instead of !.
1313
+ # Style/Not
1314
+
1315
+ # This cop checks for numbered parameters.
1316
+ Style/NumberedParameters:
1317
+ Enabled: true
1318
+ EnforcedStyle: disallow
1319
+
1320
+ # This cop detects use of an excessive amount of numbered parameters in a single block.
1321
+ Style/NumberedParametersLimit:
1322
+ Enabled: true
1323
+
1324
+ # This cop checks for octal, hex, binary, and decimal literals using uppercase prefixes and corrects them to lowercase prefix or no prefix (in case of decimals).
1325
+ # Style/NumericLiteralPrefix
1326
+
1327
+ # This cop checks for big numeric literals without _ between groups of digits in them.
1328
+ # Style/NumericLiterals
1329
+
1330
+ # This cop checks for usage of comparison operators (==, >, <) to test numbers as zero, positive, or negative.
1331
+ # Style/NumericPredicate
1332
+
1333
+ # Checks for uses of if/then/else/end constructs on a single line.
1334
+ # Style/OneLineConditional
1335
+
1336
+ # This cop flags uses of OpenStruct, as it is now officially discouraged to be used for performance, version compatibility, and potential security issues.
1337
+ Style/OpenStructUse:
1338
+ Enabled: false
1339
+
1340
+ # This cop checks for options hashes and discourages them if the current Ruby version supports keyword arguments.
1341
+ Style/OptionHash:
1342
+ Enabled: true
1343
+
1344
+ # This cop checks for optional arguments to methods that do not come at the end of the argument list.
1345
+ # Style/OptionalArguments
1346
+
1347
+ # This cop checks for places where keyword arguments can be used instead of boolean arguments when defining methods.
1348
+ # Style/OptionalBooleanParameter
1349
+
1350
+ # This cop checks for potential usage of the ||= operator.
1351
+ # Style/OrAssignment
1352
+
1353
+ # Checks for simple usages of parallel assignment. This will only complain when the number of variables being assigned matched the number of assigning variables.
1354
+ # Style/ParallelAssignment
1355
+
1356
+ # This cop checks for the presence of superfluous parentheses around the condition of if/unless/while/until.
1357
+ # Style/ParenthesesAroundCondition
1358
+
1359
+ # This cop enforces the consistent usage of %-literal delimiters.
1360
+ # Style/PercentLiteralDelimiters
1361
+
1362
+ # This cop checks for usage of the %Q() syntax when %q() would do.
1363
+ # Style/PercentQLiterals
1364
+
1365
+ # This cop looks for uses of Perl-style regexp match backreferences and their English versions like $1, $2, $&, &+, $MATCH, $PREMATCH, etc.
1366
+ # Style/PerlBackrefs
1367
+
1368
+ # This cop checks for uses of methods Hash#has_key? and Hash#has_value?, and suggests using Hash#key? and Hash#value? instead.
1369
+ # Style/PreferredHashMethods
1370
+
1371
+ # This cop checks for uses of Proc.new where Kernel#proc would be more appropriate.
1372
+ # Style/Proc
1373
+
1374
+ # Checks if the quotes used for quoted symbols match the configured defaults.
1375
+ Style/QuotedSymbols:
1376
+ Enabled: true
1377
+
1378
+ # This cop checks the args passed to fail and raise.
1379
+ # Style/RaiseArgs
1380
+
1381
+ # This cop checks for the use of randomly generated numbers, added/subtracted with integer literals, as well as those with Integer#succ and Integer#pred methods.
1382
+ # Style/RandomWithOffset
1383
+
1384
+ # This cop checks for a redundant argument passed to certain methods.
1385
+ Style/RedundantArgument:
1386
+ Enabled: false
1387
+
1388
+ # This cop checks for redundant assignment before returning.
1389
+ # Style/RedundantAssignment
1390
+
1391
+ # This cop checks for redundant begin blocks.
1392
+ # Style/RedundantBegin
1393
+
1394
+ # This cop checks for usage of the %W() syntax when %w() would do.
1395
+ # Style/RedundantCapitalW
1396
+
1397
+ # This cop checks for unnecessary conditional expressions.
1398
+ # Style/RedundantCondition
1399
+
1400
+ # This cop checks for redundant returning of true/false in conditionals.
1401
+ # Style/RedundantConditional
1402
+
1403
+ # This cop checks for RuntimeError as the argument of raise/fail.
1404
+ Style/RedundantException:
1405
+ Enabled: false
1406
+
1407
+ # This cop identifies places where fetch(key) { value } can be replaced by fetch(key, value).
1408
+ # Style/RedundantFetchBlock
1409
+
1410
+ # This cop checks for the presence of superfluous .rb extension in the filename provided to require and require_relative.
1411
+ # Style/RedundantFileExtensionInRequire
1412
+
1413
+ # This cop check for uses of Object#freeze on immutable objects.
1414
+ # Style/RedundantFreeze
1415
+
1416
+ # This cop checks for strings that are just an interpolated expression.
1417
+ # Style/RedundantInterpolation
1418
+
1419
+ # This cop checks for redundant parentheses.
1420
+ Style/RedundantParentheses:
1421
+ Enabled: false
1422
+
1423
+ # This cop checks for usage of the %q/%Q syntax when \'\' or "" would do.
1424
+ # Style/RedundantPercentQ
1425
+
1426
+ # This cop checks for unnecessary single-element Regexp character classes.
1427
+ # Style/RedundantRegexpCharacterClass
1428
+
1429
+ # This cop checks for redundant escapes inside Regexp literals.
1430
+ # Style/RedundantRegexpEscape
1431
+
1432
+ # This cop checks for redundant return expressions.
1433
+ # Style/RedundantReturn
1434
+
1435
+ # This cop checks for redundant uses of self.
1436
+ # Style/RedundantSelf
1437
+
1438
+ # This cop checks for places where redundant assignments are made for in place modification methods.
1439
+ # Style/RedundantSelfAssignment
1440
+
1441
+ # This cop checks for places where conditional branch makes redundant self-assignment.
1442
+ Style/RedundantSelfAssignmentBranch:
1443
+ Enabled: true
1444
+
1445
+ # This cop is used to identify instances of sorting and then taking only the first or last element.
1446
+ # Style/RedundantSort
1447
+
1448
+ # This cop identifies places where sort_by { … } can be replaced by sort.
1449
+ # Style/RedundantSortBy
1450
+
1451
+ # This cop enforces using // or %r around regular expressions.
1452
+ Style/RegexpLiteral:
1453
+ EnforcedStyle: percent_r
1454
+
1455
+ # This cop checks for uses of rescue in its modifier form.
1456
+ # Style/RescueModifier
1457
+
1458
+ # This cop checks for rescuing StandardError.
1459
+ # Style/RescueStandardError
1460
+
1461
+ # This cop enforces consistency between 'return nil' and 'return'.
1462
+ Style/ReturnNil:
1463
+ Enabled: true
1464
+
1465
+ # This cop transforms usages of a method call safeguarded by a non nil check for the variable whose method is being called to safe navigation (&.).
1466
+ # Style/SafeNavigation
1467
+
1468
+ # This cop is used to identify usages of shuffle.first, shuffle.last, and shuffle[] and change them to use sample instead.
1469
+ # Style/Sample
1470
+
1471
+ # This cop looks for places where an subset of an Enumerable (array, range, set, etc.; see note below) is calculated based on a Regexp match,
1472
+ # and suggests grep or grep_v instead.
1473
+ Style/SelectByRegexp:
1474
+ Enabled: true
1475
+
1476
+ # This cop enforces the use the shorthand for self-assignment.
1477
+ # Style/SelfAssignment
1478
+
1479
+ # This cop checks for multiple expressions placed on the same line. It also checks for lines terminated with a semicolon.
1480
+ # Style/Semicolon
1481
+
1482
+ # This cop checks for the use of the send method.
1483
+ # Style/Send
1484
+
1485
+ # This cop checks for uses of fail and raise.
1486
+ # Style/SignalException
1487
+
1488
+ # Sometimes using dig method ends up with just a single argument. In such cases, dig should be replaced with [].
1489
+ # Style/SingleArgumentDig
1490
+
1491
+ # This cop checks whether the block parameters of a single-line method accepting a block match the names specified via configuration.
1492
+ # Style/SingleLineBlockParams
1493
+
1494
+ # This cop checks for single-line method definitions that contain a body.
1495
+ Style/SingleLineMethods:
1496
+ AllowIfMethodIsEmpty: false
1497
+
1498
+ # This cop checks that arrays are sliced with endless ranges instead of ary[start..-1] on Ruby 2.6+.
1499
+ # Style/SlicingWithRange
1500
+
1501
+ # If the branch of a conditional consists solely of a conditional node, its conditions can be combined with the conditions of the outer branch. This helps to keep the nesting level from getting too deep.
1502
+ # Style/SoleNestedConditional
1503
+
1504
+ # This cop looks for uses of Perl-style global variables. Correcting to global variables in the \'English\' library will add a require statement to the top of the file if enabled by RequireEnglish config.
1505
+ # Style/SpecialGlobalVars
1506
+
1507
+ # Check for parentheses around stabby lambda arguments. There are two different styles. Defaults to require_parentheses.
1508
+ # Style/StabbyLambdaParentheses
1509
+
1510
+ # This cop checks for places where classes with only class methods can be replaced with a module.
1511
+ Style/StaticClass:
1512
+ Enabled: true
1513
+
1514
+ # This cop identifies places where $stderr.puts can be replaced by warn.
1515
+ # Style/StderrPuts
1516
+
1517
+ # Checks for uses of String#split with empty string or regexp literal argument.
1518
+ Style/StringChars:
1519
+ Enabled: true
1520
+
1521
+ # This cop checks for places where string concatenation can be replaced with string interpolation.
1522
+ # Style/StringConcatenation
1523
+
1524
+ # This cop checks for the use of strings as keys in hashes. The use of symbols is preferred instead.
1525
+ Style/StringHashKeys:
1526
+ Enabled: false
1527
+
1528
+ # Checks if uses of quotes match the configured preference.
1529
+ # Style/StringLiterals
1530
+
1531
+ # This cop checks that quotes inside the string interpolation match the configured preference.
1532
+ # Style/StringLiteralsInInterpolation
1533
+
1534
+ # This cop enforces the use of consistent method names from the String class.
1535
+ # Style/StringMethods
1536
+
1537
+ # This cop identifies places where lstrip.rstrip can be replaced by strip.
1538
+ # Style/Strip
1539
+
1540
+ # This cop checks for inheritance from Struct.new.
1541
+ # Style/StructInheritance
1542
+
1543
+ # This cop enforces the use of shorthand-style swapping of 2 variables.
1544
+ Style/SwapValues:
1545
+ Enabled: true
1546
+
1547
+ # This cop can check for array literals made up of symbols that are not using the %i() syntax.
1548
+ Style/SymbolArray:
1549
+ EnforcedStyle: brackets
1550
+
1551
+ # This cop checks symbol literal syntax.
1552
+ # Style/SymbolLiteral
1553
+
1554
+ # Use symbols as procs when possible.
1555
+ # Style/SymbolProc
1556
+
1557
+ # This cop checks for the presence of parentheses around ternary conditions.
1558
+ Style/TernaryParentheses:
1559
+ EnforcedStyle: require_parentheses_when_complex
1560
+ AllowSafeAssignment: false
1561
+
1562
+ # Newcomers to ruby applications may write top-level methods, when ideally they should be organized in appropriate classes or modules.
1563
+ Style/TopLevelMethodDefinition:
1564
+ Enabled: true
1565
+
1566
+ # This cop checks for trailing code after the class definition.
1567
+ # Style/TrailingBodyOnClass
1568
+
1569
+ # This cop checks for trailing code after the method definition.
1570
+ # Style/TrailingBodyOnMethodDefinition
1571
+
1572
+ # This cop checks for trailing code after the module definition.
1573
+ # Style/TrailingBodyOnModule
1574
+
1575
+ # This cop checks for trailing comma in argument lists.
1576
+ Style/TrailingCommaInArguments:
1577
+ Enabled: true
1578
+ EnforcedStyleForMultiline: no_comma
1579
+
1580
+ # This cop checks for trailing comma in array literals.
1581
+ Style/TrailingCommaInArrayLiteral:
1582
+ Enabled: true
1583
+ EnforcedStyleForMultiline: no_comma
1584
+
1585
+ # This cop checks whether trailing commas in block arguments are required.
1586
+ Style/TrailingCommaInBlockArgs:
1587
+ Enabled: true
1588
+
1589
+ # This cop checks for trailing comma in hash literals.
1590
+ Style/TrailingCommaInHashLiteral:
1591
+ Enabled: true
1592
+ EnforcedStyleForMultiline: no_comma
1593
+
1594
+ # This cop checks for trailing code after the method definition.
1595
+ # Style/TrailingMethodEndStatement
1596
+
1597
+ # This cop checks for extra underscores in variable assignment.
1598
+ # Style/TrailingUnderscoreVariable
1599
+
1600
+ # This cop looks for trivial reader/writer methods, that could have been created with the attr_* family of functions automatically.
1601
+ # Style/TrivialAccessors
1602
+
1603
+ # This cop looks for unless expressions with else clauses.
1604
+ # Style/UnlessElse
1605
+
1606
+ # This cop checks for the use of logical operators in an unless condition. It discourages such code, as the condition becomes more difficult to read and understand.
1607
+ Style/UnlessLogicalOperators:
1608
+ EnforcedStyle: forbid_logical_operators
1609
+
1610
+ # This cop checks for accessing the first element of String#unpack which can be replaced with the shorter method unpack1.
1611
+ # Style/UnpackFirst
1612
+
1613
+ # This cop checks for variable interpolation (like "#@ivar").
1614
+ # Style/VariableInterpolation
1615
+
1616
+ # This cop checks for when; uses in case expressions.
1617
+ # Style/WhenThen
1618
+
1619
+ # Checks for uses of do in multi-line while/until statements.
1620
+ # Style/WhileUntilDo
1621
+
1622
+ # Checks for while and until statements that would fit on one line if written as a modifier while/until.
1623
+ # Style/WhileUntilModifier
1624
+
1625
+ # This cop can check for array literals made up of word-like strings, that are not using the %w() syntax.
1626
+ Style/WordArray:
1627
+ EnforcedStyle: brackets
1628
+
1629
+ # This cop can either enforce or forbid Yoda conditions, i.e. comparison operations where the order of expression is reversed. eg. 5 == x
1630
+ Style/YodaCondition:
1631
+ Enabled: true
1632
+ EnforcedStyle: forbid_for_all_comparison_operators
1633
+
1634
+ # This cop checks for numeric comparisons that can be replaced by a predicate method.
1635
+ # Style/ZeroLengthPredicate'