fractor 0.1.3 → 0.1.6

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.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop-https---raw-githubusercontent-com-riboseinc-oss-guides-main-ci-rubocop-yml +552 -0
  3. data/.rubocop.yml +14 -8
  4. data/.rubocop_todo.yml +154 -48
  5. data/README.adoc +1371 -317
  6. data/examples/auto_detection/README.adoc +52 -0
  7. data/examples/auto_detection/auto_detection.rb +170 -0
  8. data/examples/continuous_chat_common/message_protocol.rb +53 -0
  9. data/examples/continuous_chat_fractor/README.adoc +217 -0
  10. data/examples/continuous_chat_fractor/chat_client.rb +303 -0
  11. data/examples/continuous_chat_fractor/chat_common.rb +83 -0
  12. data/examples/continuous_chat_fractor/chat_server.rb +167 -0
  13. data/examples/continuous_chat_fractor/simulate.rb +345 -0
  14. data/examples/continuous_chat_server/README.adoc +135 -0
  15. data/examples/continuous_chat_server/chat_client.rb +303 -0
  16. data/examples/continuous_chat_server/chat_server.rb +359 -0
  17. data/examples/continuous_chat_server/simulate.rb +343 -0
  18. data/examples/hierarchical_hasher/hierarchical_hasher.rb +12 -8
  19. data/examples/multi_work_type/multi_work_type.rb +30 -29
  20. data/examples/pipeline_processing/pipeline_processing.rb +15 -15
  21. data/examples/producer_subscriber/producer_subscriber.rb +20 -16
  22. data/examples/scatter_gather/scatter_gather.rb +29 -28
  23. data/examples/simple/sample.rb +38 -6
  24. data/examples/specialized_workers/specialized_workers.rb +44 -37
  25. data/lib/fractor/continuous_server.rb +188 -0
  26. data/lib/fractor/result_aggregator.rb +1 -1
  27. data/lib/fractor/supervisor.rb +291 -108
  28. data/lib/fractor/version.rb +1 -1
  29. data/lib/fractor/work_queue.rb +68 -0
  30. data/lib/fractor/work_result.rb +1 -1
  31. data/lib/fractor/worker.rb +2 -1
  32. data/lib/fractor/wrapped_ractor.rb +12 -2
  33. data/lib/fractor.rb +2 -0
  34. metadata +17 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b51bfbe1d8aac8575dcd85deb88b286b8f3b26e391a228e01d43f3a466d91f26
4
- data.tar.gz: '08198a0b664d2ddfa9cbef0a173f1672f9584dba1700f82374b0b9916cad91a6'
3
+ metadata.gz: 80a673f8ff411292c2b4c73440475b1dd0ded1873d12a787eb09945bcb975168
4
+ data.tar.gz: 2c3474340398fc56506c343829b292baa836b7ed383264d5817ce7e06e7a049c
5
5
  SHA512:
6
- metadata.gz: af7c2e42e19b28ced53b9e3aecf37409b9aff3c92d8829a0835312a4a5852069530b36f57c01c84727d09ad9de3b308ecfa05a5a812454402a300219938bce19
7
- data.tar.gz: e08de69150ff8d528d481fcb1e872cd2d274e6b332f6d2ad3ad3b879e13328d50af3fae3294aecd81851dc7d6f3f6cc317570a7978b0f1a8adcd142d4b18a8f5
6
+ metadata.gz: 4f71dcaba51327b6df103a8e43671bc5f751165c05da4dbdc4b23ac55326ba7d743028bf8d94a9ea3298291251ff7b52b67371abc53ce06f19d540d78af37a9f
7
+ data.tar.gz: a74f2b9f871dfd8c9bd867a6b562800703c23525a4f2fcc19eec77626685524aec1bcae46e8859e15734cf7153dd6c866e22911e4cc4ea12ac48737adeac1df2
@@ -0,0 +1,552 @@
1
+ ############################################
2
+ # This file is auto-generated. #
3
+ # DO NOT EDIT DIRECTLY #
4
+ # OR YOUR CHANGES MAY BE OVERWRITTEN #
5
+ # Edit source files instead. #
6
+ # See README for details. #
7
+ ############################################
8
+ #
9
+ # Source files:
10
+ # - src/rubocop/rubocop.tb.yml
11
+ # - src/rubocop/rubocop.ribose.yml
12
+ #
13
+ ############################################
14
+ ---
15
+ AllCops:
16
+ Exclude:
17
+ - db/**/*
18
+ - tmp/**/*
19
+ - vendor/**/*
20
+ DisplayCopNames: false
21
+ StyleGuideCopsOnly: false
22
+ TargetRubyVersion: 3.1
23
+ plugins:
24
+ - rubocop-performance
25
+ Naming/AccessorMethodName:
26
+ Description: Check the naming of accessor methods for get_/set_.
27
+ Enabled: false
28
+ Style/Alias:
29
+ Description: Use alias_method instead of alias.
30
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#alias-method
31
+ Enabled: false
32
+ Style/ArrayJoin:
33
+ Description: Use Array#join instead of Array#*.
34
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#array-join
35
+ Enabled: false
36
+ Style/AsciiComments:
37
+ Description: Use only ascii symbols in comments.
38
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#english-comments
39
+ Enabled: false
40
+ Naming/AsciiIdentifiers:
41
+ Description: Use only ascii symbols in identifiers.
42
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#english-identifiers
43
+ Enabled: false
44
+ Style/Attr:
45
+ Description: Checks for uses of Module#attr.
46
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#attr
47
+ Enabled: false
48
+ Metrics/BlockNesting:
49
+ Description: Avoid excessive block nesting
50
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count
51
+ Enabled: true
52
+ Max: 3
53
+ Style/CaseEquality:
54
+ Description: Avoid explicit use of the case equality operator(===).
55
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-case-equality
56
+ Enabled: false
57
+ Style/CharacterLiteral:
58
+ Description: Checks for uses of character literals.
59
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-character-literals
60
+ Enabled: false
61
+ Style/ClassAndModuleChildren:
62
+ Description: Checks style of children classes and modules.
63
+ Enabled: true
64
+ EnforcedStyle: nested
65
+ Metrics/ClassLength:
66
+ Description: Avoid classes longer than 100 lines of code.
67
+ Enabled: false
68
+ CountComments: false
69
+ Max: 100
70
+ Metrics/ModuleLength:
71
+ Description: Avoid modules longer than 100 lines of code.
72
+ Enabled: false
73
+ Style/ClassVars:
74
+ Description: Avoid the use of class variables.
75
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-class-vars
76
+ Enabled: false
77
+ Style/CollectionMethods:
78
+ Enabled: false
79
+ PreferredMethods:
80
+ find: detect
81
+ inject: reduce
82
+ collect: map
83
+ find_all: select
84
+ Style/ColonMethodCall:
85
+ Description: 'Do not use :: for method call.'
86
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#double-colons
87
+ Enabled: false
88
+ Style/CommentAnnotation:
89
+ Description: Checks formatting of special comments (TODO, FIXME, OPTIMIZE, HACK,
90
+ REVIEW).
91
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#annotate-keywords
92
+ Enabled: false
93
+ Metrics/AbcSize:
94
+ Description: A calculated magnitude based on number of assignments, branches, and
95
+ conditions.
96
+ Enabled: true
97
+ Max: 15
98
+ Metrics/BlockLength:
99
+ CountComments: true
100
+ Max: 25
101
+ Exclude:
102
+ - "**/*.gemspec"
103
+ - spec/**/*
104
+ Metrics/CyclomaticComplexity:
105
+ Description: A complexity metric that is strongly correlated to the number of test
106
+ cases needed to validate a method.
107
+ Enabled: true
108
+ Max: 6
109
+ Style/PreferredHashMethods:
110
+ Description: Checks use of `has_key?` and `has_value?` Hash methods.
111
+ StyleGuide: "#hash-key"
112
+ Enabled: false
113
+ Style/Documentation:
114
+ Description: Document classes and non-namespace modules.
115
+ Enabled: false
116
+ Style/DoubleNegation:
117
+ Description: Checks for uses of double negation (!!).
118
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-bang-bang
119
+ Enabled: false
120
+ Style/EachWithObject:
121
+ Description: Prefer `each_with_object` over `inject` or `reduce`.
122
+ Enabled: false
123
+ Style/EmptyLiteral:
124
+ Description: Prefer literals to Array.new/Hash.new/String.new.
125
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#literal-array-hash
126
+ Enabled: false
127
+ Style/Encoding:
128
+ Enabled: false
129
+ Style/EvenOdd:
130
+ Description: Favor the use of Fixnum#even? && Fixnum#odd?
131
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#predicate-methods
132
+ Enabled: false
133
+ Naming/FileName:
134
+ Description: Use snake_case for source file names.
135
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files
136
+ Enabled: false
137
+ Style/FrozenStringLiteralComment:
138
+ Description: Add the frozen_string_literal comment to the top of files to help transition
139
+ from Ruby 2.3.0 to Ruby 3.0.
140
+ Enabled: false
141
+ Lint/FlipFlop:
142
+ Description: Checks for flip flops
143
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-flip-flops
144
+ Enabled: false
145
+ Style/FormatString:
146
+ Description: Enforce the use of Kernel#sprintf, Kernel#format or String#%.
147
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#sprintf
148
+ Enabled: false
149
+ Style/GlobalVars:
150
+ Description: Do not introduce global variables.
151
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#instance-vars
152
+ Reference: http://www.zenspider.com/Languages/Ruby/QuickRef.html
153
+ Enabled: false
154
+ Style/GuardClause:
155
+ Description: Check for conditionals that can be replaced with guard clauses
156
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
157
+ Enabled: false
158
+ Style/IfUnlessModifier:
159
+ Description: Favor modifier if/unless usage when you have a single-line body.
160
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier
161
+ Enabled: false
162
+ Style/IfWithSemicolon:
163
+ Description: Do not use if x; .... Use the ternary operator instead.
164
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs
165
+ Enabled: false
166
+ Style/InlineComment:
167
+ Description: Avoid inline comments.
168
+ Enabled: false
169
+ Style/Lambda:
170
+ Description: Use the new lambda literal syntax for single-line blocks.
171
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#lambda-multi-line
172
+ Enabled: false
173
+ Style/LambdaCall:
174
+ Description: Use lambda.call(...) instead of lambda.(...).
175
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#proc-call
176
+ Enabled: false
177
+ Style/LineEndConcatenation:
178
+ Description: Use \ instead of + or << to concatenate two string literals at line
179
+ end.
180
+ Enabled: false
181
+ Metrics/MethodLength:
182
+ Description: Avoid methods longer than 10 lines of code.
183
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#short-methods
184
+ Enabled: true
185
+ CountComments: true
186
+ Max: 10
187
+ Exclude:
188
+ - spec/**/*
189
+ CountAsOne:
190
+ - array
191
+ - heredoc
192
+ Style/ModuleFunction:
193
+ Description: Checks for usage of `extend self` in modules.
194
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#module-function
195
+ Enabled: false
196
+ Style/MultilineBlockChain:
197
+ Description: Avoid multi-line chains of blocks.
198
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#single-line-blocks
199
+ Enabled: false
200
+ Style/NegatedIf:
201
+ Description: Favor unless over if for negative conditions (or control flow or).
202
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#unless-for-negatives
203
+ Enabled: false
204
+ Style/NegatedWhile:
205
+ Description: Favor until over while for negative conditions.
206
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#until-for-negatives
207
+ Enabled: false
208
+ Style/Next:
209
+ Description: Use `next` to skip iteration instead of a condition at the end.
210
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals
211
+ Enabled: false
212
+ Style/NilComparison:
213
+ Description: Prefer x.nil? to x == nil.
214
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#predicate-methods
215
+ Enabled: false
216
+ Style/Not:
217
+ Description: Use ! instead of not.
218
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#bang-not-not
219
+ Enabled: false
220
+ Style/NumericLiterals:
221
+ Description: Add underscores to large numeric literals to improve their readability.
222
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics
223
+ Enabled: false
224
+ Style/OneLineConditional:
225
+ Description: Favor the ternary operator(?:) over if/then/else/end constructs.
226
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#ternary-operator
227
+ Enabled: false
228
+ Naming/BinaryOperatorParameterName:
229
+ Description: When defining binary operators, name the argument other.
230
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#other-arg
231
+ Enabled: false
232
+ Metrics/ParameterLists:
233
+ Description: Avoid long parameter lists.
234
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#too-many-params
235
+ Enabled: true
236
+ Max: 5
237
+ CountKeywordArgs: true
238
+ Style/PercentLiteralDelimiters:
239
+ Description: Use `%`-literal delimiters consistently
240
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-literal-braces
241
+ Enabled: false
242
+ Style/PerlBackrefs:
243
+ Description: Avoid Perl-style regex back references.
244
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers
245
+ Enabled: false
246
+ Naming/PredicatePrefix:
247
+ Description: Check the names of predicate methods.
248
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark
249
+ ForbiddenPrefixes:
250
+ - is_
251
+ Exclude:
252
+ - spec/**/*
253
+ Style/Proc:
254
+ Description: Use proc instead of Proc.new.
255
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#proc
256
+ Enabled: false
257
+ Style/RaiseArgs:
258
+ Description: Checks the arguments passed to raise/fail.
259
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#exception-class-messages
260
+ Enabled: false
261
+ Style/RegexpLiteral:
262
+ Description: Use / or %r around regular expressions.
263
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-r
264
+ Enabled: false
265
+ Style/Sample:
266
+ Description: Use `sample` instead of `shuffle.first`, `shuffle.last`, and `shuffle[Fixnum]`.
267
+ Reference: https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code
268
+ Enabled: false
269
+ Style/SelfAssignment:
270
+ Description: Checks for places where self-assignment shorthand should have been
271
+ used.
272
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#self-assignment
273
+ Enabled: false
274
+ Style/SingleLineBlockParams:
275
+ Description: Enforces the names of some block params.
276
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#reduce-blocks
277
+ Enabled: false
278
+ Style/SingleLineMethods:
279
+ Description: Avoid single-line methods.
280
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-single-line-methods
281
+ Enabled: false
282
+ Style/SignalException:
283
+ Description: Checks for proper usage of fail and raise.
284
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#fail-method
285
+ Enabled: false
286
+ Style/SpecialGlobalVars:
287
+ Description: Avoid Perl-style global variables.
288
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms
289
+ Enabled: false
290
+ Style/StringLiterals:
291
+ Description: Checks if uses of quotes match the configured preference.
292
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-string-literals
293
+ EnforcedStyle: double_quotes
294
+ Enabled: true
295
+ Style/TrailingCommaInArguments:
296
+ Description: Checks for trailing comma in argument lists.
297
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas
298
+ EnforcedStyleForMultiline: comma
299
+ SupportedStylesForMultiline:
300
+ - comma
301
+ - consistent_comma
302
+ - no_comma
303
+ Enabled: true
304
+ Style/TrailingCommaInArrayLiteral:
305
+ Description: Checks for trailing comma in array literals.
306
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas
307
+ EnforcedStyleForMultiline: comma
308
+ SupportedStylesForMultiline:
309
+ - comma
310
+ - consistent_comma
311
+ - no_comma
312
+ Enabled: true
313
+ Style/TrailingCommaInHashLiteral:
314
+ Description: Checks for trailing comma in hash literals.
315
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas
316
+ EnforcedStyleForMultiline: comma
317
+ SupportedStylesForMultiline:
318
+ - comma
319
+ - consistent_comma
320
+ - no_comma
321
+ Enabled: true
322
+ Style/TrivialAccessors:
323
+ Description: Prefer attr_* methods to trivial readers/writers.
324
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#attr_family
325
+ Enabled: false
326
+ Style/VariableInterpolation:
327
+ Description: Don't interpolate global, instance and class variables directly in
328
+ strings.
329
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#curlies-interpolate
330
+ Enabled: false
331
+ Style/WhenThen:
332
+ Description: Use when x then ... for one-line cases.
333
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#one-line-cases
334
+ Enabled: false
335
+ Style/WhileUntilModifier:
336
+ Description: Favor modifier while/until usage when you have a single-line body.
337
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier
338
+ Enabled: false
339
+ Style/WordArray:
340
+ Description: Use %w or %W for arrays of words.
341
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-w
342
+ Enabled: false
343
+ Layout/ParameterAlignment:
344
+ Description: Here we check if the parameters on a multi-line method call or definition
345
+ are aligned.
346
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-double-indent
347
+ Enabled: false
348
+ Layout/ConditionPosition:
349
+ Description: Checks for condition placed in a confusing position relative to the
350
+ keyword.
351
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#same-line-condition
352
+ Enabled: false
353
+ Layout/DotPosition:
354
+ Description: Checks the position of the dot in multi-line method calls.
355
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
356
+ EnforcedStyle: leading
357
+ Layout/ExtraSpacing:
358
+ Description: Do not use unnecessary spacing.
359
+ Enabled: true
360
+ Layout/MultilineOperationIndentation:
361
+ Description: Checks indentation of binary operations that span more than one line.
362
+ Enabled: true
363
+ EnforcedStyle: indented
364
+ Layout/MultilineMethodCallIndentation:
365
+ Description: Checks indentation of method calls with the dot operator that span
366
+ more than one line.
367
+ Enabled: true
368
+ EnforcedStyle: indented
369
+ Layout/InitialIndentation:
370
+ Description: Checks the indentation of the first non-blank non-comment line in a
371
+ file.
372
+ Enabled: false
373
+ Layout/LineLength:
374
+ Description: Limit lines to 80 characters.
375
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#80-character-limits
376
+ Max: 80
377
+ Enabled: true
378
+ AllowURI: true
379
+ URISchemes:
380
+ - http
381
+ - https
382
+ Lint/AmbiguousOperator:
383
+ Description: Checks for ambiguous operators in the first argument of a method invocation
384
+ without parentheses.
385
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-as-args
386
+ Enabled: false
387
+ Lint/AmbiguousRegexpLiteral:
388
+ Description: Checks for ambiguous regexp literals in the first argument of a method
389
+ invocation without parenthesis.
390
+ Enabled: false
391
+ Lint/AssignmentInCondition:
392
+ Description: Don't use assignment in conditions.
393
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition
394
+ Enabled: false
395
+ Lint/CircularArgumentReference:
396
+ Description: Don't refer to the keyword argument in the default value.
397
+ Enabled: false
398
+ Lint/DeprecatedClassMethods:
399
+ Description: Check for deprecated class method calls.
400
+ Enabled: false
401
+ Lint/DuplicateHashKey:
402
+ Description: Check for duplicate keys in hash literals.
403
+ Enabled: false
404
+ Lint/DuplicateRegexpCharacterClassElement:
405
+ Description: Checks for duplicate elements in Regexp character classes.
406
+ Enabled: true
407
+ Lint/EachWithObjectArgument:
408
+ Description: Check for immutable argument given to each_with_object.
409
+ Enabled: false
410
+ Lint/ElseLayout:
411
+ Description: Check for odd code arrangement in an else block.
412
+ Enabled: false
413
+ Lint/FormatParameterMismatch:
414
+ Description: The number of parameters to format/sprint must match the fields.
415
+ Enabled: false
416
+ Lint/SuppressedException:
417
+ Description: Don't suppress exception.
418
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions
419
+ Enabled: false
420
+ Lint/LiteralAsCondition:
421
+ Description: Checks of literals used in conditions.
422
+ Enabled: false
423
+ Lint/LiteralInInterpolation:
424
+ Description: Checks for literals used in interpolation.
425
+ Enabled: false
426
+ Lint/Loop:
427
+ Description: Use Kernel#loop with break rather than begin/end/until or begin/end/while
428
+ for post-loop tests.
429
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#loop-with-break
430
+ Enabled: false
431
+ Lint/NestedMethodDefinition:
432
+ Description: Do not use nested method definitions.
433
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-methods
434
+ Enabled: false
435
+ Lint/NonLocalExitFromIterator:
436
+ Description: Do not use return in iterator to cause non-local exit.
437
+ Enabled: false
438
+ Lint/ParenthesesAsGroupedExpression:
439
+ Description: Checks for method calls with a space before the opening parenthesis.
440
+ StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-no-spaces
441
+ Enabled: false
442
+ Lint/RequireParentheses:
443
+ Description: Use parentheses in the method call to avoid confusion about precedence.
444
+ Enabled: false
445
+ Lint/UnderscorePrefixedVariableName:
446
+ Description: Do not use prefix `_` for a variable that is used.
447
+ Enabled: false
448
+ Lint/RedundantCopDisableDirective:
449
+ Description: 'Checks for rubocop:disable comments that can be removed. Note: this
450
+ cop is not disabled when disabling all cops. It must be explicitly disabled.'
451
+ Enabled: false
452
+ Lint/Void:
453
+ Description: Possible use of operator/literal/variable in void context.
454
+ Enabled: false
455
+ Performance/ConstantRegexp:
456
+ Description: Finds regular expressions with dynamic components that are all constants.
457
+ Enabled: true
458
+ Performance/Count:
459
+ Description: Use `count` instead of `select...size`, `reject...size`, `select...count`,
460
+ `reject...count`, `select...length`, and `reject...length`.
461
+ Enabled: false
462
+ Performance/Detect:
463
+ Description: Use `detect` instead of `select.first`, `find_all.first`, `select.last`,
464
+ and `find_all.last`.
465
+ Reference: https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code
466
+ Enabled: false
467
+ Performance/FlatMap:
468
+ Description: Use `Enumerable#flat_map` instead of `Enumerable#map...Array#flatten(1)`
469
+ or `Enumberable#collect..Array#flatten(1)`
470
+ Reference: https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code
471
+ Enabled: false
472
+ Performance/ReverseEach:
473
+ Description: Use `reverse_each` instead of `reverse.each`.
474
+ Reference: https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code
475
+ Enabled: false
476
+ Performance/Size:
477
+ Description: Use `size` instead of `count` for counting the number of elements in
478
+ `Array` and `Hash`.
479
+ Reference: https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code
480
+ Enabled: false
481
+ Performance/StringReplacement:
482
+ Description: Use `tr` instead of `gsub` when you are replacing the same number of
483
+ characters. Use `delete` instead of `gsub` when you are deleting characters.
484
+ Reference: https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code
485
+ Enabled: false
486
+ Lint/DuplicateBranch:
487
+ Enabled: true
488
+ Lint/EmptyBlock:
489
+ Enabled: true
490
+ Lint/EmptyClass:
491
+ Enabled: true
492
+ Lint/NoReturnInBeginEndBlocks:
493
+ Enabled: true
494
+ Lint/ShadowedArgument:
495
+ Enabled: true
496
+ IgnoreImplicitReferences: true
497
+ Lint/ToEnumArguments:
498
+ Enabled: true
499
+ Lint/UnexpectedBlockArity:
500
+ Enabled: true
501
+ Lint/UnmodifiedReduceAccumulator:
502
+ Enabled: true
503
+ Metrics/PerceivedComplexity:
504
+ Description: A complexity metric geared towards measuring complexity for a human
505
+ reader.
506
+ Enabled: true
507
+ Max: 7
508
+ Performance/AncestorsInclude:
509
+ Enabled: true
510
+ Performance/BigDecimalWithNumericArgument:
511
+ Enabled: true
512
+ Performance/BlockGivenWithExplicitBlock:
513
+ Enabled: true
514
+ Performance/CollectionLiteralInLoop:
515
+ Enabled: true
516
+ Performance/MethodObjectAsBlock:
517
+ Enabled: true
518
+ Performance/RedundantEqualityComparisonBlock:
519
+ Enabled: true
520
+ Performance/RedundantSortBlock:
521
+ Enabled: true
522
+ Performance/RedundantSplitRegexpArgument:
523
+ Enabled: true
524
+ Performance/RedundantStringChars:
525
+ Enabled: true
526
+ Performance/ReverseFirst:
527
+ Enabled: true
528
+ Performance/SortReverse:
529
+ Enabled: true
530
+ Performance/Squeeze:
531
+ Enabled: true
532
+ Performance/StringInclude:
533
+ Enabled: true
534
+ Performance/Sum:
535
+ Enabled: true
536
+ Style/ArgumentsForwarding:
537
+ Enabled: true
538
+ Style/CollectionCompact:
539
+ Description: Checks for places where custom logic on rejection nils from arrays
540
+ and hashes can be replaced with {Array,Hash}#{compact,compact!}.
541
+ StyleGuide: https://docs.rubocop.org/rubocop/cops_style.html#stylecollectioncompact
542
+ Enabled: true
543
+ Style/DocumentDynamicEvalDefinition:
544
+ Enabled: true
545
+ Style/NegatedIfElseCondition:
546
+ Enabled: true
547
+ Style/NilLambda:
548
+ Enabled: true
549
+ Style/RedundantArgument:
550
+ Enabled: true
551
+ Style/SwapValues:
552
+ Enabled: true
data/.rubocop.yml CHANGED
@@ -1,10 +1,16 @@
1
- inherit_from: .rubocop_todo.yml
1
+ inherit_from:
2
+ - https://raw.githubusercontent.com/riboseinc/oss-guides/main/ci/rubocop.yml
3
+ - .rubocop_todo.yml
2
4
 
3
- AllCops:
4
- TargetRubyVersion: 3.0
5
-
6
- Style/StringLiterals:
7
- EnforcedStyle: double_quotes
5
+ plugins:
6
+ - rubocop-rake
7
+ - rubocop-rspec
8
+ - rubocop-performance
8
9
 
9
- Style/StringLiteralsInInterpolation:
10
- EnforcedStyle: double_quotes
10
+ AllCops:
11
+ TargetRubyVersion: 3.1
12
+ Exclude:
13
+ - 'examples/**/*'
14
+ inherit_mode:
15
+ merge:
16
+ - Exclude