roast-ai 0.4.6 → 0.4.7

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 (48) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yaml +3 -1
  3. data/.gitignore +7 -0
  4. data/.rubocop.yml +14 -0
  5. data/CHANGELOG.md +5 -0
  6. data/Gemfile +2 -1
  7. data/Gemfile.lock +9 -1
  8. data/Rakefile +14 -4
  9. data/examples/available_tools_demo/workflow.yml +2 -2
  10. data/examples/cmd/basic_workflow.yml +0 -1
  11. data/examples/grading/js_test_runner +1 -1
  12. data/examples/grading/run_coverage.rb +1 -1
  13. data/examples/user_input/funny_name/workflow.yml +3 -4
  14. data/lib/roast/dsl/executor.rb +2 -1
  15. data/lib/roast/helpers/cmd_runner.rb +199 -0
  16. data/lib/roast/initializers.rb +1 -1
  17. data/lib/roast/tools/apply_diff.rb +1 -1
  18. data/lib/roast/tools/bash.rb +4 -4
  19. data/lib/roast/tools/cmd.rb +3 -5
  20. data/lib/roast/tools/coding_agent.rb +1 -1
  21. data/lib/roast/tools/grep.rb +6 -2
  22. data/lib/roast/tools/read_file.rb +2 -1
  23. data/lib/roast/tools/swarm.rb +2 -7
  24. data/lib/roast/tools.rb +10 -1
  25. data/lib/roast/version.rb +1 -1
  26. data/lib/roast/workflow/command_executor.rb +3 -3
  27. data/lib/roast/workflow/resource_resolver.rb +1 -1
  28. data/lib/roast/workflow/shell_script_step.rb +1 -1
  29. data/lib/roast.rb +1 -0
  30. data/rubocop/cop/roast/use_cmd_runner.rb +93 -0
  31. data/rubocop/cop/roast.rb +4 -0
  32. data/sorbet/rbi/gems/docile@1.4.1.rbi +377 -0
  33. data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +233 -2
  34. data/sorbet/rbi/gems/racc@1.8.1.rbi +6 -4
  35. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +396 -2
  36. data/sorbet/rbi/gems/regexp_parser@2.10.0.rbi +3788 -2
  37. data/sorbet/rbi/gems/rubocop-ast@1.45.1.rbi +7747 -2
  38. data/sorbet/rbi/gems/rubocop-sorbet@0.10.5.rbi +2386 -0
  39. data/sorbet/rbi/gems/rubocop@1.77.0.rbi +62813 -2
  40. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1311 -2
  41. data/sorbet/rbi/gems/simplecov-html@0.13.2.rbi +225 -0
  42. data/sorbet/rbi/gems/simplecov@0.22.0.rbi +2259 -0
  43. data/sorbet/rbi/gems/simplecov_json_formatter@0.1.4.rbi +9 -0
  44. data/sorbet/rbi/gems/unicode-display_width@3.1.4.rbi +125 -2
  45. data/sorbet/rbi/gems/unicode-emoji@4.0.4.rbi +244 -2
  46. data/sorbet/tapioca/require.rb +2 -1
  47. metadata +9 -2
  48. data/lib/roast/helpers/timeout_handler.rb +0 -89
@@ -0,0 +1,2386 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `rubocop-sorbet` gem.
5
+ # Please instead update this file by running `bin/tapioca gem rubocop-sorbet`.
6
+
7
+
8
+ # source://rubocop-sorbet//lib/rubocop/sorbet/version.rb#3
9
+ module RuboCop; end
10
+
11
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#4
12
+ module RuboCop::Cop; end
13
+
14
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#5
15
+ module RuboCop::Cop::Sorbet; end
16
+
17
+ # Disallows using `.override(allow_incompatible: true)`.
18
+ # Using `allow_incompatible` suggests a violation of the Liskov
19
+ # Substitution Principle, meaning that a subclass is not a valid
20
+ # subtype of its superclass. This Cop prevents these design smells
21
+ # from occurring.
22
+ #
23
+ # @example
24
+ #
25
+ # # bad
26
+ # sig.override(allow_incompatible: true)
27
+ #
28
+ # # good
29
+ # sig.override
30
+ #
31
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb#21
32
+ class RuboCop::Cop::Sorbet::AllowIncompatibleOverride < ::RuboCop::Cop::Base
33
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb#55
34
+ def on_block(node); end
35
+
36
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb#55
37
+ def on_numblock(node); end
38
+
39
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb#49
40
+ def on_send(node); end
41
+
42
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb#41
43
+ def override?(param0 = T.unsafe(nil)); end
44
+
45
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb#36
46
+ def sig?(param0); end
47
+
48
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb#27
49
+ def sig_dot_override?(param0 = T.unsafe(nil)); end
50
+ end
51
+
52
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb#22
53
+ RuboCop::Cop::Sorbet::AllowIncompatibleOverride::MSG = T.let(T.unsafe(nil), String)
54
+
55
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb#24
56
+ RuboCop::Cop::Sorbet::AllowIncompatibleOverride::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
57
+
58
+ # Disallows binding the return value of `T.any`, `T.all`, `T.enum`
59
+ # to a constant directly. To bind the value, one must use `T.type_alias`.
60
+ #
61
+ # @example
62
+ #
63
+ # # bad
64
+ # FooOrBar = T.any(Foo, Bar)
65
+ #
66
+ # # good
67
+ # FooOrBar = T.type_alias { T.any(Foo, Bar) }
68
+ #
69
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constant_without_type_alias.rb#18
70
+ class RuboCop::Cop::Sorbet::BindingConstantWithoutTypeAlias < ::RuboCop::Cop::Base
71
+ extend ::RuboCop::Cop::AutoCorrector
72
+
73
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constant_without_type_alias.rb#65
74
+ def on_casgn(node); end
75
+
76
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constant_without_type_alias.rb#48
77
+ def requires_type_alias?(param0 = T.unsafe(nil)); end
78
+
79
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constant_without_type_alias.rb#38
80
+ def type_alias_with_block?(param0 = T.unsafe(nil)); end
81
+
82
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constant_without_type_alias.rb#29
83
+ def type_alias_without_block(param0 = T.unsafe(nil)); end
84
+
85
+ private
86
+
87
+ # Given nested send nodes, returns the leaf with explicit receiver.
88
+ #
89
+ # i.e. in Ruby
90
+ #
91
+ # a.b.c.d.e.f
92
+ # ^^^
93
+ #
94
+ # i.e. in AST
95
+ #
96
+ # (send (send (send (send (send (send nil :a) :b) :c) :d) :e) :f)
97
+ # ^^^^^^^^^^^^^^^^^^^^^^^
98
+ #
99
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constant_without_type_alias.rb#98
100
+ def send_leaf(node); end
101
+ end
102
+
103
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constant_without_type_alias.rb#21
104
+ RuboCop::Cop::Sorbet::BindingConstantWithoutTypeAlias::MSG = T.let(T.unsafe(nil), String)
105
+
106
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constant_without_type_alias.rb#23
107
+ RuboCop::Cop::Sorbet::BindingConstantWithoutTypeAlias::WITHOUT_BLOCK_MSG = T.let(T.unsafe(nil), String)
108
+
109
+ # Disallow defining methods in blocks, to prevent running into issues
110
+ # caused by https://github.com/sorbet/sorbet/issues/3609.
111
+ #
112
+ # As a workaround, use `define_method` instead.
113
+ #
114
+ # The one exception is for `Class.new` blocks, as long as the result is
115
+ # assigned to a constant (i.e. as long as it is not an anonymous class).
116
+ # Another exception is for ActiveSupport::Concern `class_methods` blocks.
117
+ #
118
+ # @example
119
+ # # bad
120
+ # yielding_method do
121
+ # def bad(args)
122
+ # # ...
123
+ # end
124
+ # end
125
+ #
126
+ # # bad
127
+ # Class.new do
128
+ # def bad(args)
129
+ # # ...
130
+ # end
131
+ # end
132
+ #
133
+ # # good
134
+ # yielding_method do
135
+ # define_method(:good) do |args|
136
+ # # ...
137
+ # end
138
+ # end
139
+ #
140
+ # # good
141
+ # MyClass = Class.new do
142
+ # def good(args)
143
+ # # ...
144
+ # end
145
+ # end
146
+ #
147
+ # # good
148
+ # module SomeConcern
149
+ # extend ActiveSupport::Concern
150
+ #
151
+ # class_methods do
152
+ # def good(args)
153
+ # # ...
154
+ # end
155
+ # end
156
+ # end
157
+ #
158
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/block_method_definition.rb#55
159
+ class RuboCop::Cop::Sorbet::BlockMethodDefinition < ::RuboCop::Cop::Base
160
+ include ::RuboCop::Cop::Alignment
161
+ extend ::RuboCop::Cop::AutoCorrector
162
+
163
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/block_method_definition.rb#62
164
+ def activesupport_concern_class_methods_block?(param0 = T.unsafe(nil)); end
165
+
166
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/block_method_definition.rb#71
167
+ def module_extends_activesupport_concern?(param0 = T.unsafe(nil)); end
168
+
169
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/block_method_definition.rb#80
170
+ def on_block(node); end
171
+
172
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/block_method_definition.rb#80
173
+ def on_numblock(node); end
174
+
175
+ private
176
+
177
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/block_method_definition.rb#186
178
+ def adjust_for_closing_parenthesis(end_pos); end
179
+
180
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/block_method_definition.rb#106
181
+ def autocorrect_method_in_block(corrector, node); end
182
+
183
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/block_method_definition.rb#198
184
+ def closing_parenthesis_follows(source); end
185
+
186
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/block_method_definition.rb#175
187
+ def find_end_position_with_arguments(node); end
188
+
189
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/block_method_definition.rb#182
190
+ def find_end_position_without_arguments(node); end
191
+
192
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/block_method_definition.rb#167
193
+ def find_method_signature_end_position(node); end
194
+
195
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/block_method_definition.rb#143
196
+ def handle_method_without_body(node, indent); end
197
+
198
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/block_method_definition.rb#161
199
+ def handle_multiline_method_without_body(node); end
200
+
201
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/block_method_definition.rb#155
202
+ def handle_single_line_method(node, indent); end
203
+
204
+ # @return [Boolean]
205
+ #
206
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/block_method_definition.rb#98
207
+ def in_activesupport_concern_class_methods_block?(node); end
208
+
209
+ # @return [Boolean]
210
+ #
211
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/block_method_definition.rb#151
212
+ def single_line_method?(node); end
213
+
214
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/block_method_definition.rb#132
215
+ def transform_args_to_block_args(node); end
216
+ end
217
+
218
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/block_method_definition.rb#59
219
+ RuboCop::Cop::Sorbet::BlockMethodDefinition::MSG = T.let(T.unsafe(nil), String)
220
+
221
+ # Checks for the a mistaken variant of the "obsolete memoization pattern" that used to be required
222
+ # on every call, causing the memoized value to be discarded and recomputed on every call.
223
+ #
224
+ # This cop will correct it to read from the ivar instead of `nil`, which will memoize it correctly.
225
+ #
226
+ # The result of this correction will be the "obsolete memoization pattern", which can further be corrected by
227
+ # the `Sorbet/ObsoleteStrictMemoization` cop.
228
+ #
229
+ # See `Sorbet/ObsoleteStrictMemoization` for more details.
230
+ #
231
+ # @example
232
+ # # bad
233
+ # sig { returns(Foo) }
234
+ # def foo
235
+ # # This `nil` is likely a mistake, causing the memoized value to be discarded and recomputed on every call.
236
+ # @foo = T.let(nil, T.nilable(Foo))
237
+ # @foo ||= some_computation
238
+ # end
239
+ #
240
+ # # good
241
+ # sig { returns(Foo) }
242
+ # def foo
243
+ # # This will now memoize the value as was likely intended, so `some_computation` is only ever called once.
244
+ # # ⚠️If `some_computation` has side effects, this might be a breaking change!
245
+ # @foo = T.let(@foo, T.nilable(Foo))
246
+ # @foo ||= some_computation
247
+ # end
248
+ # @see Sorbet/ObsoleteStrictMemoization
249
+ #
250
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/buggy_obsolete_strict_memoization.rb#42
251
+ class RuboCop::Cop::Sorbet::BuggyObsoleteStrictMemoization < ::RuboCop::Cop::Base
252
+ include ::RuboCop::Cop::RangeHelp
253
+ include ::RuboCop::Cop::MatchRange
254
+ include ::RuboCop::Cop::Alignment
255
+ include ::RuboCop::Cop::LineLengthHelp
256
+ include ::RuboCop::Cop::Sorbet::TargetSorbetVersion
257
+ extend ::RuboCop::Cop::AutoCorrector
258
+ extend ::RuboCop::Cop::Sorbet::TargetSorbetVersion::ClassMethods
259
+
260
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/buggy_obsolete_strict_memoization.rb#55
261
+ def buggy_legacy_memoization_pattern?(param0 = T.unsafe(nil)); end
262
+
263
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/buggy_obsolete_strict_memoization.rb#66
264
+ def on_begin(node); end
265
+
266
+ # @return [Boolean]
267
+ #
268
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/buggy_obsolete_strict_memoization.rb#77
269
+ def relevant_file?(file); end
270
+ end
271
+
272
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/buggy_obsolete_strict_memoization.rb#51
273
+ RuboCop::Cop::Sorbet::BuggyObsoleteStrictMemoization::MSG = T.let(T.unsafe(nil), String)
274
+
275
+ # Ensures that callback conditionals are bound to the right type
276
+ # so that they are type checked properly.
277
+ #
278
+ # Auto-correction is unsafe because other libraries define similar style callbacks as Rails, but don't always need
279
+ # binding to the attached class. Auto-correcting those usages can lead to false positives and auto-correction
280
+ # introduces new typing errors.
281
+ #
282
+ # @example
283
+ #
284
+ # # bad
285
+ # class Post < ApplicationRecord
286
+ # before_create :do_it, if: -> { should_do_it? }
287
+ #
288
+ # def should_do_it?
289
+ # true
290
+ # end
291
+ # end
292
+ #
293
+ # # good
294
+ # class Post < ApplicationRecord
295
+ # before_create :do_it, if: -> {
296
+ # T.bind(self, Post)
297
+ # should_do_it?
298
+ # }
299
+ #
300
+ # def should_do_it?
301
+ # true
302
+ # end
303
+ # end
304
+ #
305
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#36
306
+ class RuboCop::Cop::Sorbet::CallbackConditionalsBinding < ::RuboCop::Cop::Base
307
+ include ::RuboCop::Cop::Alignment
308
+ extend ::RuboCop::Cop::AutoCorrector
309
+
310
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#82
311
+ def argumentless_unbound_callable_callback_conditional?(param0 = T.unsafe(nil)); end
312
+
313
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#92
314
+ def on_send(node); end
315
+
316
+ private
317
+
318
+ # Find the immediately enclosing class or module name.
319
+ # Returns `nil`` if the immediate parent (skipping begin if present) is not a class or module.
320
+ #
321
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#129
322
+ def immediately_enclosing_module_name(node); end
323
+ end
324
+
325
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#40
326
+ RuboCop::Cop::Sorbet::CallbackConditionalsBinding::MSG = T.let(T.unsafe(nil), String)
327
+
328
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#42
329
+ RuboCop::Cop::Sorbet::CallbackConditionalsBinding::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
330
+
331
+ # Ensure type parameters used in generic methods are always capitalized.
332
+ #
333
+ # @example
334
+ #
335
+ # # bad
336
+ # sig { type_parameters(:x).params(a: T.type_parameter(:x)).void }
337
+ # def foo(a); end
338
+ #
339
+ # # good
340
+ # sig { type_parameters(:X).params(a: T.type_parameter(:X)).void }
341
+ # def foo(a: 1); end
342
+ #
343
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/capitalized_type_parameters.rb#17
344
+ class RuboCop::Cop::Sorbet::CapitalizedTypeParameters < ::RuboCop::Cop::Base
345
+ include ::RuboCop::Cop::Sorbet::SignatureHelp
346
+ extend ::RuboCop::Cop::AutoCorrector
347
+
348
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/capitalized_type_parameters.rb#51
349
+ def on_csend(node); end
350
+
351
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/capitalized_type_parameters.rb#47
352
+ def on_send(node); end
353
+
354
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/capitalized_type_parameters.rb#35
355
+ def on_signature(node); end
356
+
357
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/capitalized_type_parameters.rb#31
358
+ def t_type_parameter?(param0 = T.unsafe(nil)); end
359
+
360
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/capitalized_type_parameters.rb#26
361
+ def type_parameters?(param0 = T.unsafe(nil)); end
362
+
363
+ private
364
+
365
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/capitalized_type_parameters.rb#57
366
+ def check_type_parameters_case(node); end
367
+ end
368
+
369
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/capitalized_type_parameters.rb#21
370
+ RuboCop::Cop::Sorbet::CapitalizedTypeParameters::MSG = T.let(T.unsafe(nil), String)
371
+
372
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/capitalized_type_parameters.rb#23
373
+ RuboCop::Cop::Sorbet::CapitalizedTypeParameters::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
374
+
375
+ # Disallows the usage of `checked(true)`. This usage could cause
376
+ # confusion; it could lead some people to believe that a method would be checked
377
+ # even if runtime checks have not been enabled on the class or globally.
378
+ # Additionally, in the event where checks are enabled, `checked(true)` would
379
+ # be redundant; only `checked(false)` or `soft` would change the behaviour.
380
+ #
381
+ # @example
382
+ #
383
+ # # bad
384
+ # sig { void.checked(true) }
385
+ #
386
+ # # good
387
+ # sig { void }
388
+ #
389
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb#19
390
+ class RuboCop::Cop::Sorbet::CheckedTrueInSignature < ::RuboCop::Cop::Base
391
+ include ::RuboCop::Cop::RangeHelp
392
+ include ::RuboCop::Cop::Sorbet::SignatureHelp
393
+
394
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb#24
395
+ def offending_node(param0); end
396
+
397
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb#35
398
+ def on_signature(node); end
399
+ end
400
+
401
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb#28
402
+ RuboCop::Cop::Sorbet::CheckedTrueInSignature::MESSAGE = T.let(T.unsafe(nil), String)
403
+
404
+ # Disallows the calls that are used to get constants fom Strings
405
+ # such as +constantize+, +const_get+, and +constants+.
406
+ #
407
+ # The goal of this cop is to make the code easier to statically analyze,
408
+ # more IDE-friendly, and more predictable. It leads to code that clearly
409
+ # expresses which values the constant can have.
410
+ #
411
+ # @example
412
+ #
413
+ # # bad
414
+ # class_name.constantize
415
+ #
416
+ # # bad
417
+ # constants.detect { |c| c.name == "User" }
418
+ #
419
+ # # bad
420
+ # const_get(class_name)
421
+ #
422
+ # # good
423
+ # case class_name
424
+ # when "User"
425
+ # User
426
+ # else
427
+ # raise ArgumentError
428
+ # end
429
+ #
430
+ # # good
431
+ # { "User" => User }.fetch(class_name)
432
+ #
433
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/constants_from_strings.rb#36
434
+ class RuboCop::Cop::Sorbet::ConstantsFromStrings < ::RuboCop::Cop::Base
435
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/constants_from_strings.rb#47
436
+ def on_csend(node); end
437
+
438
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/constants_from_strings.rb#47
439
+ def on_send(node); end
440
+ end
441
+
442
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/constants_from_strings.rb#37
443
+ RuboCop::Cop::Sorbet::ConstantsFromStrings::MSG = T.let(T.unsafe(nil), String)
444
+
445
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/constants_from_strings.rb#40
446
+ RuboCop::Cop::Sorbet::ConstantsFromStrings::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
447
+
448
+ # Checks for blank lines after signatures.
449
+ #
450
+ # @example
451
+ # # bad
452
+ # sig { void }
453
+ #
454
+ # def foo; end
455
+ #
456
+ # # good
457
+ # sig { void }
458
+ # def foo; end
459
+ #
460
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb#17
461
+ class RuboCop::Cop::Sorbet::EmptyLineAfterSig < ::RuboCop::Cop::Base
462
+ include ::RuboCop::Cop::RangeHelp
463
+ include ::RuboCop::Cop::Sorbet::SignatureHelp
464
+ extend ::RuboCop::Cop::AutoCorrector
465
+
466
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb#33
467
+ def on_signature(sig); end
468
+
469
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb#25
470
+ def sig_or_signable_method_definition?(param0 = T.unsafe(nil)); end
471
+
472
+ private
473
+
474
+ # @return [Boolean]
475
+ #
476
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb#62
477
+ def contains_only_rubocop_directives?(range); end
478
+
479
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb#66
480
+ def lines_between(node1, node2, buffer: T.unsafe(nil)); end
481
+
482
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb#58
483
+ def next_sibling(node); end
484
+ end
485
+
486
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb#22
487
+ RuboCop::Cop::Sorbet::EmptyLineAfterSig::MSG = T.let(T.unsafe(nil), String)
488
+
489
+ # Checks that the Sorbet sigil comes as the first magic comment in the file, after the encoding comment if any.
490
+ #
491
+ # The expected order for magic comments is: (en)?coding, typed, warn_indent then frozen_string_literal.
492
+ #
493
+ # The ordering is for consistency only, except for the encoding comment which must be first, if present.
494
+ #
495
+ # For example, the following bad ordering:
496
+ #
497
+ # ```ruby
498
+ # class Foo; end
499
+ # ```
500
+ #
501
+ # Will be corrected as:
502
+ #
503
+ # ```ruby
504
+ # class Foo; end
505
+ # ```
506
+ #
507
+ # Only `(en)?coding`, `typed`, `warn_indent` and `frozen_string_literal` magic comments are considered,
508
+ # other comments or magic comments are left in the same place.
509
+ #
510
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#32
511
+ class RuboCop::Cop::Sorbet::EnforceSigilOrder < ::RuboCop::Cop::Sorbet::ValidSigil
512
+ include ::RuboCop::Cop::RangeHelp
513
+
514
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#35
515
+ def on_new_investigation; end
516
+
517
+ protected
518
+
519
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#93
520
+ def autocorrect(corrector); end
521
+
522
+ # checks
523
+ #
524
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#70
525
+ def check_magic_comments_order(tokens); end
526
+
527
+ # Get all the tokens in `processed_source` that match `MAGIC_REGEX`
528
+ #
529
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#62
530
+ def extract_magic_comments(processed_source); end
531
+ end
532
+
533
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#46
534
+ RuboCop::Cop::Sorbet::EnforceSigilOrder::CODING_REGEX = T.let(T.unsafe(nil), Regexp)
535
+
536
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#48
537
+ RuboCop::Cop::Sorbet::EnforceSigilOrder::FROZEN_REGEX = T.let(T.unsafe(nil), Regexp)
538
+
539
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#47
540
+ RuboCop::Cop::Sorbet::EnforceSigilOrder::INDENT_REGEX = T.let(T.unsafe(nil), Regexp)
541
+
542
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#57
543
+ RuboCop::Cop::Sorbet::EnforceSigilOrder::MAGIC_REGEX = T.let(T.unsafe(nil), Regexp)
544
+
545
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#50
546
+ RuboCop::Cop::Sorbet::EnforceSigilOrder::PREFERRED_ORDER = T.let(T.unsafe(nil), Hash)
547
+
548
+ # Checks that every method definition and attribute accessor has a Sorbet signature.
549
+ #
550
+ # It also suggest an autocorrect with placeholders so the following code:
551
+ #
552
+ # ```
553
+ # def foo(a, b, c); end
554
+ # ```
555
+ #
556
+ # Will be corrected as:
557
+ #
558
+ # ```
559
+ # sig { params(a: T.untyped, b: T.untyped, c: T.untyped).returns(T.untyped)
560
+ # def foo(a, b, c); end
561
+ # ```
562
+ #
563
+ # You can configure the placeholders used by changing the following options:
564
+ #
565
+ # * `ParameterTypePlaceholder`: placeholders used for parameter types (default: 'T.untyped')
566
+ # * `ReturnTypePlaceholder`: placeholders used for return types (default: 'T.untyped')
567
+ # * `Style`: signature style to enforce - 'sig' for sig blocks, 'rbs' for RBS comments, 'both' to allow either (default: 'sig')
568
+ #
569
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#26
570
+ class RuboCop::Cop::Sorbet::EnforceSignatures < ::RuboCop::Cop::Base
571
+ include ::RuboCop::Cop::Sorbet::SignatureHelp
572
+ extend ::RuboCop::Cop::AutoCorrector
573
+
574
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#33
575
+ def accessor?(param0 = T.unsafe(nil)); end
576
+
577
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#37
578
+ def on_def(node); end
579
+
580
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#41
581
+ def on_defs(node); end
582
+
583
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#53
584
+ def on_new_investigation; end
585
+
586
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#45
587
+ def on_send(node); end
588
+
589
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#49
590
+ def on_signature(node); end
591
+
592
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#59
593
+ def scope(node); end
594
+
595
+ private
596
+
597
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#154
598
+ def add_accessor_parameter_if_needed(suggest, symbol, method); end
599
+
600
+ # @return [Boolean]
601
+ #
602
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#176
603
+ def allow_rbs?; end
604
+
605
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#113
606
+ def autocorrect_with_signature_type(corrector, node, type); end
607
+
608
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#68
609
+ def check_node(node); end
610
+
611
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#119
612
+ def create_signature_suggestion(node, type); end
613
+
614
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#168
615
+ def param_type_placeholder; end
616
+
617
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#146
618
+ def populate_accessor_suggestion(suggest, node); end
619
+
620
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#136
621
+ def populate_method_definition_suggestion(suggest, node); end
622
+
623
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#128
624
+ def populate_signature_suggestion(suggest, node); end
625
+
626
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#109
627
+ def rbs_checker; end
628
+
629
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#172
630
+ def return_type_placeholder; end
631
+
632
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#160
633
+ def set_void_return_for_writer(suggest, method); end
634
+
635
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#105
636
+ def sig_checker; end
637
+
638
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#180
639
+ def signature_style; end
640
+
641
+ # @return [Boolean]
642
+ #
643
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#164
644
+ def writer_or_accessor?(method); end
645
+ end
646
+
647
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#209
648
+ class RuboCop::Cop::Sorbet::EnforceSignatures::RBSSignatureChecker < ::RuboCop::Cop::Sorbet::EnforceSignatures::SignatureChecker
649
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#212
650
+ def signature_node(node); end
651
+
652
+ private
653
+
654
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#225
655
+ def find_non_send_ancestor(node); end
656
+ end
657
+
658
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#210
659
+ RuboCop::Cop::Sorbet::EnforceSignatures::RBSSignatureChecker::RBS_COMMENT_REGEX = T.let(T.unsafe(nil), Regexp)
660
+
661
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#285
662
+ class RuboCop::Cop::Sorbet::EnforceSignatures::RBSSuggestion
663
+ # @return [RBSSuggestion] a new instance of RBSSuggestion
664
+ #
665
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#288
666
+ def initialize(indent); end
667
+
668
+ # Returns the value of attribute has_block.
669
+ #
670
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#286
671
+ def has_block; end
672
+
673
+ # Sets the attribute has_block
674
+ #
675
+ # @param value the value to set the attribute has_block to.
676
+ #
677
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#286
678
+ def has_block=(_arg0); end
679
+
680
+ # Returns the value of attribute params.
681
+ #
682
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#286
683
+ def params; end
684
+
685
+ # Sets the attribute params
686
+ #
687
+ # @param value the value to set the attribute params to.
688
+ #
689
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#286
690
+ def params=(_arg0); end
691
+
692
+ # Returns the value of attribute returns.
693
+ #
694
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#286
695
+ def returns; end
696
+
697
+ # Sets the attribute returns
698
+ #
699
+ # @param value the value to set the attribute returns to.
700
+ #
701
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#286
702
+ def returns=(_arg0); end
703
+
704
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#295
705
+ def to_autocorrect; end
706
+
707
+ private
708
+
709
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#301
710
+ def generate_signature; end
711
+ end
712
+
713
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#231
714
+ class RuboCop::Cop::Sorbet::EnforceSignatures::SigSignatureChecker < ::RuboCop::Cop::Sorbet::EnforceSignatures::SignatureChecker
715
+ # @return [SigSignatureChecker] a new instance of SigSignatureChecker
716
+ #
717
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#232
718
+ def initialize(processed_source); end
719
+
720
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#245
721
+ def clear_signature(scope); end
722
+
723
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#241
724
+ def on_signature(node, scope); end
725
+
726
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#237
727
+ def signature_node(scope); end
728
+ end
729
+
730
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#250
731
+ class RuboCop::Cop::Sorbet::EnforceSignatures::SigSuggestion
732
+ # @return [SigSuggestion] a new instance of SigSuggestion
733
+ #
734
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#253
735
+ def initialize(indent, param_placeholder, return_placeholder); end
736
+
737
+ # Returns the value of attribute params.
738
+ #
739
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#251
740
+ def params; end
741
+
742
+ # Sets the attribute params
743
+ #
744
+ # @param value the value to set the attribute params to.
745
+ #
746
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#251
747
+ def params=(_arg0); end
748
+
749
+ # Returns the value of attribute returns.
750
+ #
751
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#251
752
+ def returns; end
753
+
754
+ # Sets the attribute returns
755
+ #
756
+ # @param value the value to set the attribute returns to.
757
+ #
758
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#251
759
+ def returns=(_arg0); end
760
+
761
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#261
762
+ def to_autocorrect; end
763
+
764
+ private
765
+
766
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#267
767
+ def generate_params; end
768
+
769
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#274
770
+ def generate_return; end
771
+ end
772
+
773
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#195
774
+ class RuboCop::Cop::Sorbet::EnforceSignatures::SignatureChecker
775
+ # @return [SignatureChecker] a new instance of SignatureChecker
776
+ #
777
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#196
778
+ def initialize(processed_source); end
779
+
780
+ protected
781
+
782
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#204
783
+ def preceding_comments(node); end
784
+
785
+ # Returns the value of attribute processed_source.
786
+ #
787
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#202
788
+ def processed_source; end
789
+ end
790
+
791
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#30
792
+ RuboCop::Cop::Sorbet::EnforceSignatures::VALID_STYLES = T.let(T.unsafe(nil), Array)
793
+
794
+ # Checks that there is only one Sorbet sigil in a given file
795
+ #
796
+ # For example, the following class with two sigils
797
+ #
798
+ # ```ruby
799
+ # class Foo; end
800
+ # ```
801
+ #
802
+ # Will be corrected as:
803
+ #
804
+ # ```ruby
805
+ # class Foo; end
806
+ # ```
807
+ #
808
+ # Other comments or magic comments are left in place.
809
+ #
810
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb#26
811
+ class RuboCop::Cop::Sorbet::EnforceSingleSigil < ::RuboCop::Cop::Sorbet::ValidSigil
812
+ include ::RuboCop::Cop::RangeHelp
813
+
814
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb#29
815
+ def on_new_investigation; end
816
+
817
+ protected
818
+
819
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb#50
820
+ def autocorrect(corrector); end
821
+
822
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb#44
823
+ def extract_all_sigils(processed_source); end
824
+ end
825
+
826
+ # Makes the Sorbet `false` sigil mandatory in all files.
827
+ #
828
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/false_sigil.rb#10
829
+ class RuboCop::Cop::Sorbet::FalseSigil < ::RuboCop::Cop::Sorbet::HasSigil
830
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/false_sigil.rb#11
831
+ def minimum_strictness; end
832
+ end
833
+
834
+ # Disallow including the `Comparable` module in `T::Enum`.
835
+ #
836
+ # @example
837
+ #
838
+ # # bad
839
+ # class Priority < T::Enum
840
+ # include Comparable
841
+ #
842
+ # enums do
843
+ # High = new(3)
844
+ # Medium = new(2)
845
+ # Low = new(1)
846
+ # end
847
+ #
848
+ # def <=>(other)
849
+ # serialize <=> other.serialize
850
+ # end
851
+ # end
852
+ #
853
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/t_enum/forbid_comparable_t_enum.rb#24
854
+ class RuboCop::Cop::Sorbet::ForbidComparableTEnum < ::RuboCop::Cop::Base
855
+ include ::RuboCop::Cop::Sorbet::TEnum
856
+
857
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/t_enum/forbid_comparable_t_enum.rb#32
858
+ def mix_in_comparable?(param0 = T.unsafe(nil)); end
859
+
860
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/t_enum/forbid_comparable_t_enum.rb#36
861
+ def on_send(node); end
862
+ end
863
+
864
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/t_enum/forbid_comparable_t_enum.rb#27
865
+ RuboCop::Cop::Sorbet::ForbidComparableTEnum::MSG = T.let(T.unsafe(nil), String)
866
+
867
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/t_enum/forbid_comparable_t_enum.rb#29
868
+ RuboCop::Cop::Sorbet::ForbidComparableTEnum::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
869
+
870
+ # Ensures RBI shims do not include a call to extend T::Sig
871
+ # or to extend T::Helpers
872
+ #
873
+ # @example
874
+ #
875
+ # # bad
876
+ # module SomeModule
877
+ # extend T::Sig
878
+ # extend T::Helpers
879
+ #
880
+ # sig { returns(String) }
881
+ # def foo; end
882
+ # end
883
+ #
884
+ # # good
885
+ # module SomeModule
886
+ # sig { returns(String) }
887
+ # def foo; end
888
+ # end
889
+ #
890
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb#25
891
+ class RuboCop::Cop::Sorbet::ForbidExtendTSigHelpersInShims < ::RuboCop::Cop::Base
892
+ include ::RuboCop::Cop::RangeHelp
893
+ extend ::RuboCop::Cop::AutoCorrector
894
+
895
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb#33
896
+ def extend_t_sig_or_helpers?(param0 = T.unsafe(nil)); end
897
+
898
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb#37
899
+ def on_send(node); end
900
+ end
901
+
902
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb#29
903
+ RuboCop::Cop::Sorbet::ForbidExtendTSigHelpersInShims::MSG = T.let(T.unsafe(nil), String)
904
+
905
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb#30
906
+ RuboCop::Cop::Sorbet::ForbidExtendTSigHelpersInShims::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
907
+
908
+ # Correct `send` expressions in include statements by constant literals.
909
+ #
910
+ # Sorbet, the static checker, is not (yet) able to support constructs on the
911
+ # following form:
912
+ #
913
+ # ```ruby
914
+ # class MyClass
915
+ # include send_expr
916
+ # end
917
+ # ```
918
+ #
919
+ # Multiple occurences of this can be found in Shopify's code base like:
920
+ #
921
+ # ```ruby
922
+ # include Rails.application.routes.url_helpers
923
+ # ```
924
+ # or
925
+ # ```ruby
926
+ # include Polaris::Engine.helpers
927
+ # ```
928
+ #
929
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#29
930
+ class RuboCop::Cop::Sorbet::ForbidIncludeConstLiteral < ::RuboCop::Cop::Base
931
+ extend ::RuboCop::Cop::AutoCorrector
932
+
933
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#36
934
+ def dynamic_inclusion?(param0 = T.unsafe(nil)); end
935
+
936
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#40
937
+ def on_send(node); end
938
+
939
+ private
940
+
941
+ # @return [Boolean]
942
+ #
943
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#52
944
+ def neither_const_nor_self?(node); end
945
+
946
+ # Returns true if the node is within a module declaration that is not anonymous.
947
+ #
948
+ # @return [Boolean]
949
+ #
950
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#57
951
+ def within_onymous_module?(node); end
952
+ end
953
+
954
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#32
955
+ RuboCop::Cop::Sorbet::ForbidIncludeConstLiteral::MSG = T.let(T.unsafe(nil), String)
956
+
957
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#33
958
+ RuboCop::Cop::Sorbet::ForbidIncludeConstLiteral::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
959
+
960
+ # Check that code does not call `mixes_in_class_methods` from Sorbet `T::Helpers`.
961
+ #
962
+ # Good:
963
+ #
964
+ # ```
965
+ # module M
966
+ # extend ActiveSupport::Concern
967
+ #
968
+ # class_methods do
969
+ # ...
970
+ # end
971
+ # end
972
+ # ```
973
+ #
974
+ # Bad:
975
+ #
976
+ # ```
977
+ # module M
978
+ # extend T::Helpers
979
+ #
980
+ # module ClassMethods
981
+ # ...
982
+ # end
983
+ #
984
+ # mixes_in_class_methods(ClassMethods)
985
+ # end
986
+ # ```
987
+ #
988
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_mixes_in_class_methods.rb#33
989
+ class RuboCop::Cop::Sorbet::ForbidMixesInClassMethods < ::RuboCop::Cop::Base
990
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_mixes_in_class_methods.rb#38
991
+ def mixes_in_class_methods?(param0 = T.unsafe(nil)); end
992
+
993
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_mixes_in_class_methods.rb#42
994
+ def on_csend(node); end
995
+
996
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_mixes_in_class_methods.rb#42
997
+ def on_send(node); end
998
+ end
999
+
1000
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_mixes_in_class_methods.rb#34
1001
+ RuboCop::Cop::Sorbet::ForbidMixesInClassMethods::MSG = T.let(T.unsafe(nil), String)
1002
+
1003
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_mixes_in_class_methods.rb#35
1004
+ RuboCop::Cop::Sorbet::ForbidMixesInClassMethods::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1005
+
1006
+ # Makes sure that RBI files are always located under the defined allowed paths.
1007
+ #
1008
+ # Options:
1009
+ #
1010
+ # * `AllowedPaths`: A list of the paths where RBI files are allowed (default: ["rbi/**", "sorbet/rbi/**"])
1011
+ #
1012
+ # @example
1013
+ # # bad
1014
+ # # lib/some_file.rbi
1015
+ # # other_file.rbi
1016
+ #
1017
+ # # good
1018
+ # # rbi/external_interface.rbi
1019
+ # # sorbet/rbi/some_file.rbi
1020
+ # # sorbet/rbi/any/path/for/file.rbi
1021
+ #
1022
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_rbi_outside_of_allowed_paths.rb#23
1023
+ class RuboCop::Cop::Sorbet::ForbidRBIOutsideOfAllowedPaths < ::RuboCop::Cop::Base
1024
+ include ::RuboCop::Cop::RangeHelp
1025
+
1026
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_rbi_outside_of_allowed_paths.rb#26
1027
+ def on_new_investigation; end
1028
+
1029
+ private
1030
+
1031
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_rbi_outside_of_allowed_paths.rb#48
1032
+ def allowed_paths; end
1033
+ end
1034
+
1035
+ # Check that definitions do not use a `sig` block.
1036
+ #
1037
+ # Good:
1038
+ #
1039
+ # ```
1040
+ # #: -> void
1041
+ # def foo; end
1042
+ # ```
1043
+ #
1044
+ # Bad:
1045
+ #
1046
+ # ```
1047
+ # sig { void }
1048
+ # def foo; end
1049
+ # ```
1050
+ #
1051
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/forbid_sig.rb#23
1052
+ class RuboCop::Cop::Sorbet::ForbidSig < ::RuboCop::Cop::Base
1053
+ include ::RuboCop::Cop::Sorbet::SignatureHelp
1054
+
1055
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/forbid_sig.rb#28
1056
+ def on_signature(node); end
1057
+ end
1058
+
1059
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/forbid_sig.rb#26
1060
+ RuboCop::Cop::Sorbet::ForbidSig::MSG = T.let(T.unsafe(nil), String)
1061
+
1062
+ # Check that definitions do not use a `sig` block.
1063
+ #
1064
+ # Good:
1065
+ #
1066
+ # ```
1067
+ # #: -> void
1068
+ # def foo; end
1069
+ # ```
1070
+ #
1071
+ # Bad:
1072
+ #
1073
+ # ```
1074
+ # T::Sig.sig { void }
1075
+ # def foo; end
1076
+ # ```
1077
+ #
1078
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/forbid_sig_with_runtime.rb#23
1079
+ class RuboCop::Cop::Sorbet::ForbidSigWithRuntime < ::RuboCop::Cop::Base
1080
+ include ::RuboCop::Cop::Sorbet::SignatureHelp
1081
+
1082
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/forbid_sig_with_runtime.rb#28
1083
+ def on_signature(node); end
1084
+ end
1085
+
1086
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/forbid_sig_with_runtime.rb#26
1087
+ RuboCop::Cop::Sorbet::ForbidSigWithRuntime::MSG = T.let(T.unsafe(nil), String)
1088
+
1089
+ # Check that `sig` is used instead of `T::Sig::WithoutRuntime.sig`.
1090
+ #
1091
+ # Good:
1092
+ #
1093
+ # ```
1094
+ # sig { void }
1095
+ # def foo; end
1096
+ # ```
1097
+ #
1098
+ # Bad:
1099
+ #
1100
+ # ```
1101
+ # T::Sig::WithoutRuntime.sig { void }
1102
+ # def foo; end
1103
+ # ```
1104
+ #
1105
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/forbid_sig_without_runtime.rb#23
1106
+ class RuboCop::Cop::Sorbet::ForbidSigWithoutRuntime < ::RuboCop::Cop::Base
1107
+ include ::RuboCop::Cop::Sorbet::SignatureHelp
1108
+ extend ::RuboCop::Cop::AutoCorrector
1109
+
1110
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/forbid_sig_without_runtime.rb#29
1111
+ def on_signature(node); end
1112
+ end
1113
+
1114
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/forbid_sig_without_runtime.rb#27
1115
+ RuboCop::Cop::Sorbet::ForbidSigWithoutRuntime::MSG = T.let(T.unsafe(nil), String)
1116
+
1117
+ # Correct superclass `send` expressions by constant literals.
1118
+ #
1119
+ # Sorbet, the static checker, is not (yet) able to support constructs on the
1120
+ # following form:
1121
+ #
1122
+ # ```ruby
1123
+ # class Foo < send_expr; end
1124
+ # ```
1125
+ #
1126
+ # Multiple occurences of this can be found in Shopify's code base like:
1127
+ #
1128
+ # ```ruby
1129
+ # class ShopScope < Component::TrustedIdScope[ShopIdentity::ShopId]
1130
+ # ```
1131
+ # or
1132
+ # ```ruby
1133
+ # class ApiClientEligibility < Struct.new(:api_client, :match_results, :shop)
1134
+ # ```
1135
+ #
1136
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_superclass_const_literal.rb#28
1137
+ class RuboCop::Cop::Sorbet::ForbidSuperclassConstLiteral < ::RuboCop::Cop::Base
1138
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_superclass_const_literal.rb#32
1139
+ def dynamic_superclass?(param0 = T.unsafe(nil)); end
1140
+
1141
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_superclass_const_literal.rb#36
1142
+ def on_class(node); end
1143
+ end
1144
+
1145
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_superclass_const_literal.rb#29
1146
+ RuboCop::Cop::Sorbet::ForbidSuperclassConstLiteral::MSG = T.let(T.unsafe(nil), String)
1147
+
1148
+ # Disallows using `T.absurd` anywhere.
1149
+ #
1150
+ # @example
1151
+ #
1152
+ # # bad
1153
+ # T.absurd(foo)
1154
+ #
1155
+ # # good
1156
+ # x #: absurd
1157
+ #
1158
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_absurd.rb#17
1159
+ class RuboCop::Cop::Sorbet::ForbidTAbsurd < ::RuboCop::Cop::Base
1160
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_absurd.rb#24
1161
+ def on_csend(node); end
1162
+
1163
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_absurd.rb#24
1164
+ def on_send(node); end
1165
+
1166
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_absurd.rb#22
1167
+ def t_absurd?(param0 = T.unsafe(nil)); end
1168
+ end
1169
+
1170
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_absurd.rb#18
1171
+ RuboCop::Cop::Sorbet::ForbidTAbsurd::MSG = T.let(T.unsafe(nil), String)
1172
+
1173
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_absurd.rb#19
1174
+ RuboCop::Cop::Sorbet::ForbidTAbsurd::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1175
+
1176
+ # Disallows using `T.bind` anywhere.
1177
+ #
1178
+ # @example
1179
+ #
1180
+ # # bad
1181
+ # T.bind(self, Integer)
1182
+ #
1183
+ # # good
1184
+ # #: self as Integer
1185
+ #
1186
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_bind.rb#17
1187
+ class RuboCop::Cop::Sorbet::ForbidTBind < ::RuboCop::Cop::Base
1188
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_bind.rb#24
1189
+ def on_csend(node); end
1190
+
1191
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_bind.rb#24
1192
+ def on_send(node); end
1193
+
1194
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_bind.rb#22
1195
+ def t_bind?(param0 = T.unsafe(nil)); end
1196
+ end
1197
+
1198
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_bind.rb#18
1199
+ RuboCop::Cop::Sorbet::ForbidTBind::MSG = T.let(T.unsafe(nil), String)
1200
+
1201
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_bind.rb#19
1202
+ RuboCop::Cop::Sorbet::ForbidTBind::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1203
+
1204
+ # Disallows using `T.cast` anywhere.
1205
+ #
1206
+ # @example
1207
+ #
1208
+ # # bad
1209
+ # T.cast(foo, Integer)
1210
+ #
1211
+ # # good
1212
+ # foo #: as Integer
1213
+ #
1214
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_cast.rb#17
1215
+ class RuboCop::Cop::Sorbet::ForbidTCast < ::RuboCop::Cop::Base
1216
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_cast.rb#24
1217
+ def on_csend(node); end
1218
+
1219
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_cast.rb#24
1220
+ def on_send(node); end
1221
+
1222
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_cast.rb#22
1223
+ def t_cast?(param0 = T.unsafe(nil)); end
1224
+ end
1225
+
1226
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_cast.rb#18
1227
+ RuboCop::Cop::Sorbet::ForbidTCast::MSG = T.let(T.unsafe(nil), String)
1228
+
1229
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_cast.rb#19
1230
+ RuboCop::Cop::Sorbet::ForbidTCast::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1231
+
1232
+ # Disallow using `T::Enum`.
1233
+ #
1234
+ # @example
1235
+ #
1236
+ # # bad
1237
+ # class MyEnum < T::Enum
1238
+ # enums do
1239
+ # A = new
1240
+ # B = new
1241
+ # end
1242
+ # end
1243
+ #
1244
+ # # good
1245
+ # class MyEnum
1246
+ # A = "a"
1247
+ # B = "b"
1248
+ # C = "c"
1249
+ # end
1250
+ #
1251
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_enum.rb#26
1252
+ class RuboCop::Cop::Sorbet::ForbidTEnum < ::RuboCop::Cop::Base
1253
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_enum.rb#34
1254
+ def on_class(node); end
1255
+
1256
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_enum.rb#30
1257
+ def t_enum?(param0 = T.unsafe(nil)); end
1258
+ end
1259
+
1260
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_enum.rb#27
1261
+ RuboCop::Cop::Sorbet::ForbidTEnum::MSG = T.let(T.unsafe(nil), String)
1262
+
1263
+ # Disallows using `T.let` anywhere.
1264
+ #
1265
+ # @example
1266
+ #
1267
+ # # bad
1268
+ # T.let(foo, Integer)
1269
+ #
1270
+ # # good
1271
+ # foo #: Integer
1272
+ #
1273
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_let.rb#17
1274
+ class RuboCop::Cop::Sorbet::ForbidTLet < ::RuboCop::Cop::Base
1275
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_let.rb#24
1276
+ def on_csend(node); end
1277
+
1278
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_let.rb#24
1279
+ def on_send(node); end
1280
+
1281
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_let.rb#22
1282
+ def t_let?(param0 = T.unsafe(nil)); end
1283
+ end
1284
+
1285
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_let.rb#18
1286
+ RuboCop::Cop::Sorbet::ForbidTLet::MSG = T.let(T.unsafe(nil), String)
1287
+
1288
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_let.rb#19
1289
+ RuboCop::Cop::Sorbet::ForbidTLet::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1290
+
1291
+ # Disallows using `T.must` anywhere.
1292
+ #
1293
+ # @example
1294
+ #
1295
+ # # bad
1296
+ # T.must(foo)
1297
+ #
1298
+ # # good
1299
+ # foo #: as !nil
1300
+ #
1301
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_must.rb#17
1302
+ class RuboCop::Cop::Sorbet::ForbidTMust < ::RuboCop::Cop::Base
1303
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_must.rb#24
1304
+ def on_csend(node); end
1305
+
1306
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_must.rb#24
1307
+ def on_send(node); end
1308
+
1309
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_must.rb#22
1310
+ def t_must?(param0 = T.unsafe(nil)); end
1311
+ end
1312
+
1313
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_must.rb#18
1314
+ RuboCop::Cop::Sorbet::ForbidTMust::MSG = T.let(T.unsafe(nil), String)
1315
+
1316
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_must.rb#19
1317
+ RuboCop::Cop::Sorbet::ForbidTMust::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1318
+
1319
+ # Disallow using `T::Struct` and `T::Props`.
1320
+ #
1321
+ # @example
1322
+ #
1323
+ # # bad
1324
+ # class MyStruct < T::Struct
1325
+ # const :foo, String
1326
+ # prop :bar, Integer, default: 0
1327
+ #
1328
+ # def some_method; end
1329
+ # end
1330
+ #
1331
+ # # good
1332
+ # class MyStruct
1333
+ # extend T::Sig
1334
+ #
1335
+ # sig { returns(String) }
1336
+ # attr_reader :foo
1337
+ #
1338
+ # sig { returns(Integer) }
1339
+ # attr_accessor :bar
1340
+ #
1341
+ # sig { params(foo: String, bar: Integer) }
1342
+ # def initialize(foo:, bar: 0)
1343
+ # @foo = foo
1344
+ # @bar = bar
1345
+ # end
1346
+ #
1347
+ # def some_method; end
1348
+ # end
1349
+ #
1350
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#38
1351
+ class RuboCop::Cop::Sorbet::ForbidTStruct < ::RuboCop::Cop::Base
1352
+ include ::RuboCop::Cop::Alignment
1353
+ include ::RuboCop::Cop::RangeHelp
1354
+ include ::RuboCop::Cop::CommentsHelp
1355
+ extend ::RuboCop::Cop::AutoCorrector
1356
+
1357
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#169
1358
+ def on_class(node); end
1359
+
1360
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#210
1361
+ def on_send(node); end
1362
+
1363
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#167
1364
+ def t_props?(param0 = T.unsafe(nil)); end
1365
+
1366
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#162
1367
+ def t_struct?(param0 = T.unsafe(nil)); end
1368
+
1369
+ private
1370
+
1371
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#218
1372
+ def initialize_method(indent, props); end
1373
+
1374
+ # @return [Boolean]
1375
+ #
1376
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#258
1377
+ def previous_line_blank?(node); end
1378
+ end
1379
+
1380
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#47
1381
+ RuboCop::Cop::Sorbet::ForbidTStruct::MSG_PROPS = T.let(T.unsafe(nil), String)
1382
+
1383
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#46
1384
+ RuboCop::Cop::Sorbet::ForbidTStruct::MSG_STRUCT = T.let(T.unsafe(nil), String)
1385
+
1386
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#104
1387
+ class RuboCop::Cop::Sorbet::ForbidTStruct::Property
1388
+ # @return [Property] a new instance of Property
1389
+ #
1390
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#107
1391
+ def initialize(node, kind, name, type, default:, factory:); end
1392
+
1393
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#123
1394
+ def attr_accessor; end
1395
+
1396
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#119
1397
+ def attr_sig; end
1398
+
1399
+ # Returns the value of attribute default.
1400
+ #
1401
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#105
1402
+ def default; end
1403
+
1404
+ # Returns the value of attribute factory.
1405
+ #
1406
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#105
1407
+ def factory; end
1408
+
1409
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#144
1410
+ def initialize_assign; end
1411
+
1412
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#131
1413
+ def initialize_param; end
1414
+
1415
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#127
1416
+ def initialize_sig_param; end
1417
+
1418
+ # Returns the value of attribute kind.
1419
+ #
1420
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#105
1421
+ def kind; end
1422
+
1423
+ # Returns the value of attribute name.
1424
+ #
1425
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#105
1426
+ def name; end
1427
+
1428
+ # @return [Boolean]
1429
+ #
1430
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#151
1431
+ def nilable?; end
1432
+
1433
+ # Returns the value of attribute node.
1434
+ #
1435
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#105
1436
+ def node; end
1437
+
1438
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#155
1439
+ def type; end
1440
+ end
1441
+
1442
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#44
1443
+ RuboCop::Cop::Sorbet::ForbidTStruct::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1444
+
1445
+ # This class walks down the class body of a T::Struct and collects all the properties that will need to be
1446
+ # translated into `attr_reader` and `attr_accessor` methods.
1447
+ #
1448
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#51
1449
+ class RuboCop::Cop::Sorbet::ForbidTStruct::TStructWalker
1450
+ include ::RuboCop::AST::Traversal
1451
+ extend ::RuboCop::AST::NodePattern::Macros
1452
+
1453
+ # @return [TStructWalker] a new instance of TStructWalker
1454
+ #
1455
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#57
1456
+ def initialize; end
1457
+
1458
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#63
1459
+ def extend_t_sig?(param0 = T.unsafe(nil)); end
1460
+
1461
+ # Returns the value of attribute has_extend_t_sig.
1462
+ #
1463
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#55
1464
+ def has_extend_t_sig; end
1465
+
1466
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#72
1467
+ def on_send(node); end
1468
+
1469
+ # Returns the value of attribute props.
1470
+ #
1471
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#55
1472
+ def props; end
1473
+
1474
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#68
1475
+ def t_struct_prop?(param0 = T.unsafe(nil)); end
1476
+ end
1477
+
1478
+ # Disallows using `T.type_alias` anywhere.
1479
+ #
1480
+ # @example
1481
+ #
1482
+ # # bad
1483
+ # STRING_OR_INTEGER = T.type_alias { T.any(Integer, String) }
1484
+ #
1485
+ # # good
1486
+ # #: type string_or_integer = Integer | String
1487
+ #
1488
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_type_alias.rb#17
1489
+ class RuboCop::Cop::Sorbet::ForbidTTypeAlias < ::RuboCop::Cop::Base
1490
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_type_alias.rb#23
1491
+ def on_block(node); end
1492
+
1493
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_type_alias.rb#23
1494
+ def on_numblock(node); end
1495
+
1496
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_type_alias.rb#21
1497
+ def t_type_alias?(param0 = T.unsafe(nil)); end
1498
+ end
1499
+
1500
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_type_alias.rb#18
1501
+ RuboCop::Cop::Sorbet::ForbidTTypeAlias::MSG = T.let(T.unsafe(nil), String)
1502
+
1503
+ # Disallows using `T.unsafe` anywhere.
1504
+ #
1505
+ # @example
1506
+ #
1507
+ # # bad
1508
+ # T.unsafe(foo)
1509
+ #
1510
+ # # good
1511
+ # foo
1512
+ #
1513
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_unsafe.rb#17
1514
+ class RuboCop::Cop::Sorbet::ForbidTUnsafe < ::RuboCop::Cop::Base
1515
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_unsafe.rb#24
1516
+ def on_csend(node); end
1517
+
1518
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_unsafe.rb#24
1519
+ def on_send(node); end
1520
+
1521
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_unsafe.rb#22
1522
+ def t_unsafe?(param0 = T.unsafe(nil)); end
1523
+ end
1524
+
1525
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_unsafe.rb#18
1526
+ RuboCop::Cop::Sorbet::ForbidTUnsafe::MSG = T.let(T.unsafe(nil), String)
1527
+
1528
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_unsafe.rb#19
1529
+ RuboCop::Cop::Sorbet::ForbidTUnsafe::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1530
+
1531
+ # Disallows using `T.untyped` anywhere.
1532
+ #
1533
+ # @example
1534
+ #
1535
+ # # bad
1536
+ # sig { params(my_argument: T.untyped).void }
1537
+ # def foo(my_argument); end
1538
+ #
1539
+ # # good
1540
+ # sig { params(my_argument: String).void }
1541
+ # def foo(my_argument); end
1542
+ #
1543
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_untyped.rb#20
1544
+ class RuboCop::Cop::Sorbet::ForbidTUntyped < ::RuboCop::Cop::Base
1545
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_untyped.rb#27
1546
+ def on_send(node); end
1547
+
1548
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_untyped.rb#25
1549
+ def t_untyped?(param0 = T.unsafe(nil)); end
1550
+ end
1551
+
1552
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_untyped.rb#21
1553
+ RuboCop::Cop::Sorbet::ForbidTUntyped::MSG = T.let(T.unsafe(nil), String)
1554
+
1555
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_untyped.rb#22
1556
+ RuboCop::Cop::Sorbet::ForbidTUntyped::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1557
+
1558
+ # Disallows defining type aliases that contain shapes
1559
+ #
1560
+ # @example
1561
+ #
1562
+ # # bad
1563
+ # Foo = T.type_alias { { foo: Integer } }
1564
+ #
1565
+ # # good
1566
+ # class Foo
1567
+ # extend T::Sig
1568
+ #
1569
+ # sig { params(foo: Integer).void }
1570
+ # def initialize(foo)
1571
+ # @foo = foo
1572
+ # end
1573
+ # end
1574
+ #
1575
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_type_aliased_shapes.rb#24
1576
+ class RuboCop::Cop::Sorbet::ForbidTypeAliasedShapes < ::RuboCop::Cop::Base
1577
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_type_aliased_shapes.rb#36
1578
+ def on_block(node); end
1579
+
1580
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_type_aliased_shapes.rb#36
1581
+ def on_numblock(node); end
1582
+
1583
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_type_aliased_shapes.rb#28
1584
+ def shape_type_alias?(param0 = T.unsafe(nil)); end
1585
+ end
1586
+
1587
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_type_aliased_shapes.rb#25
1588
+ RuboCop::Cop::Sorbet::ForbidTypeAliasedShapes::MSG = T.let(T.unsafe(nil), String)
1589
+
1590
+ # Disallows use of `T.untyped` or `T.nilable(T.untyped)`
1591
+ # as a prop type for `T::Struct` or `T::ImmutableStruct`.
1592
+ #
1593
+ # @example
1594
+ #
1595
+ # # bad
1596
+ # class SomeClass < T::Struct
1597
+ # const :foo, T.untyped
1598
+ # prop :bar, T.nilable(T.untyped)
1599
+ # end
1600
+ #
1601
+ # # good
1602
+ # class SomeClass < T::Struct
1603
+ # const :foo, Integer
1604
+ # prop :bar, T.nilable(String)
1605
+ # end
1606
+ #
1607
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#25
1608
+ class RuboCop::Cop::Sorbet::ForbidUntypedStructProps < ::RuboCop::Cop::Base
1609
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#54
1610
+ def on_class(node); end
1611
+
1612
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#44
1613
+ def subclass_of_t_struct?(param0 = T.unsafe(nil)); end
1614
+
1615
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#39
1616
+ def t_nilable_untyped(param0 = T.unsafe(nil)); end
1617
+
1618
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#29
1619
+ def t_struct(param0 = T.unsafe(nil)); end
1620
+
1621
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#34
1622
+ def t_untyped(param0 = T.unsafe(nil)); end
1623
+
1624
+ # Search for untyped prop/const declarations and capture their types
1625
+ #
1626
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#50
1627
+ def untyped_props(param0); end
1628
+ end
1629
+
1630
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#26
1631
+ RuboCop::Cop::Sorbet::ForbidUntypedStructProps::MSG = T.let(T.unsafe(nil), String)
1632
+
1633
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi_versioning/gem_version_annotation_helper.rb#6
1634
+ module RuboCop::Cop::Sorbet::GemVersionAnnotationHelper
1635
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi_versioning/gem_version_annotation_helper.rb#9
1636
+ def gem_version_annotations; end
1637
+
1638
+ private
1639
+
1640
+ # @return [Boolean]
1641
+ #
1642
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi_versioning/gem_version_annotation_helper.rb#17
1643
+ def gem_version_annotation?(comment); end
1644
+
1645
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi_versioning/gem_version_annotation_helper.rb#21
1646
+ def gem_versions(comment); end
1647
+ end
1648
+
1649
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi_versioning/gem_version_annotation_helper.rb#7
1650
+ RuboCop::Cop::Sorbet::GemVersionAnnotationHelper::VERSION_PREFIX = T.let(T.unsafe(nil), String)
1651
+
1652
+ # Makes the Sorbet typed sigil mandatory in all files.
1653
+ #
1654
+ # Options:
1655
+ #
1656
+ # * `SuggestedStrictness`: Sorbet strictness level suggested in offense messages (default: 'false')
1657
+ # * `MinimumStrictness`: If set, make offense if the strictness level in the file is below this one
1658
+ #
1659
+ # If a `SuggestedStrictness` level is specified, it will be used in autocorrect.
1660
+ # If a `MinimumStrictness` level is specified, it will be used in offense messages and autocorrect.
1661
+ #
1662
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/has_sigil.rb#18
1663
+ class RuboCop::Cop::Sorbet::HasSigil < ::RuboCop::Cop::Sorbet::ValidSigil
1664
+ # @return [Boolean]
1665
+ #
1666
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/has_sigil.rb#19
1667
+ def require_sigil_on_all_files?; end
1668
+ end
1669
+
1670
+ # Makes the Sorbet `ignore` sigil mandatory in all files.
1671
+ #
1672
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/ignore_sigil.rb#10
1673
+ class RuboCop::Cop::Sorbet::IgnoreSigil < ::RuboCop::Cop::Sorbet::HasSigil
1674
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/ignore_sigil.rb#11
1675
+ def minimum_strictness; end
1676
+ end
1677
+
1678
+ # Disallows declaring implicit conversion methods.
1679
+ # Since Sorbet is a nominal (not structural) type system,
1680
+ # implicit conversion is currently unsupported.
1681
+ #
1682
+ # @example
1683
+ #
1684
+ # # bad
1685
+ # def to_str; end
1686
+ #
1687
+ # # good
1688
+ # def to_str(x); end
1689
+ #
1690
+ # # bad
1691
+ # def self.to_str; end
1692
+ #
1693
+ # # good
1694
+ # def self.to_str(x); end
1695
+ #
1696
+ # # bad
1697
+ # alias to_str to_s
1698
+ # @note Since the arity of aliased methods is not checked, false positives may result.
1699
+ # @see https://docs.ruby-lang.org/en/master/implicit_conversion_rdoc.html
1700
+ #
1701
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/implicit_conversion_method.rb#31
1702
+ class RuboCop::Cop::Sorbet::ImplicitConversionMethod < ::RuboCop::Cop::Base
1703
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/implicit_conversion_method.rb#37
1704
+ def on_alias(node); end
1705
+
1706
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/implicit_conversion_method.rb#42
1707
+ def on_def(node); end
1708
+
1709
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/implicit_conversion_method.rb#42
1710
+ def on_defs(node); end
1711
+
1712
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/implicit_conversion_method.rb#50
1713
+ def on_send(node); end
1714
+ end
1715
+
1716
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/implicit_conversion_method.rb#32
1717
+ RuboCop::Cop::Sorbet::ImplicitConversionMethod::IMPLICIT_CONVERSION_METHODS = T.let(T.unsafe(nil), Array)
1718
+
1719
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/implicit_conversion_method.rb#33
1720
+ RuboCop::Cop::Sorbet::ImplicitConversionMethod::MSG = T.let(T.unsafe(nil), String)
1721
+
1722
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/implicit_conversion_method.rb#35
1723
+ RuboCop::Cop::Sorbet::ImplicitConversionMethod::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1724
+
1725
+ # Checks for the ordering of keyword arguments required by
1726
+ # sorbet-runtime. The ordering requires that all keyword arguments
1727
+ # are at the end of the parameters list, and all keyword arguments
1728
+ # with a default value must be after those without default values.
1729
+ #
1730
+ # @example
1731
+ #
1732
+ # # bad
1733
+ # sig { params(a: Integer, b: String).void }
1734
+ # def foo(a: 1, b:); end
1735
+ #
1736
+ # # good
1737
+ # sig { params(b: String, a: Integer).void }
1738
+ # def foo(b:, a: 1); end
1739
+ #
1740
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/keyword_argument_ordering.rb#20
1741
+ class RuboCop::Cop::Sorbet::KeywordArgumentOrdering < ::RuboCop::Cop::Base
1742
+ include ::RuboCop::Cop::Sorbet::SignatureHelp
1743
+
1744
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/keyword_argument_ordering.rb#23
1745
+ def on_signature(node); end
1746
+
1747
+ private
1748
+
1749
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/keyword_argument_ordering.rb#34
1750
+ def check_order_for_kwoptargs(parameters); end
1751
+ end
1752
+
1753
+ # Disallow creating a `T::Enum` with less than two values.
1754
+ #
1755
+ # @example
1756
+ #
1757
+ # # bad
1758
+ # class ErrorMessages < T::Enum
1759
+ # enums do
1760
+ # ServerError = new("There was a server error.")
1761
+ # end
1762
+ # end
1763
+ #
1764
+ # # good
1765
+ # class ErrorMessages < T::Enum
1766
+ # enums do
1767
+ # ServerError = new("There was a server error.")
1768
+ # NotFound = new("The resource was not found.")
1769
+ # end
1770
+ # end
1771
+ #
1772
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/t_enum/multiple_t_enum_values.rb#24
1773
+ class RuboCop::Cop::Sorbet::MultipleTEnumValues < ::RuboCop::Cop::Base
1774
+ include ::RuboCop::Cop::Sorbet::TEnum
1775
+
1776
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/t_enum/multiple_t_enum_values.rb#30
1777
+ def enums_block?(param0 = T.unsafe(nil)); end
1778
+
1779
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/t_enum/multiple_t_enum_values.rb#40
1780
+ def on_block(node); end
1781
+
1782
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/t_enum/multiple_t_enum_values.rb#34
1783
+ def on_class(node); end
1784
+ end
1785
+
1786
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/t_enum/multiple_t_enum_values.rb#27
1787
+ RuboCop::Cop::Sorbet::MultipleTEnumValues::MSG = T.let(T.unsafe(nil), String)
1788
+
1789
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#8
1790
+ module RuboCop::Cop::Sorbet::MutableConstantSorbetAwareBehaviour
1791
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#18
1792
+ def on_assignment(value); end
1793
+
1794
+ class << self
1795
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#10
1796
+ def prepended(base); end
1797
+ end
1798
+ end
1799
+
1800
+ # Checks for the obsolete pattern for initializing instance variables that was required for older Sorbet
1801
+ #
1802
+ # It's no longer required, as of Sorbet 0.5.10210
1803
+ # See https://sorbet.org/docs/type-assertions#put-type-assertions-behind-memoization
1804
+ #
1805
+ # @example
1806
+ #
1807
+ # # bad
1808
+ # sig { returns(Foo) }
1809
+ # def foo
1810
+ # @foo = T.let(@foo, T.nilable(Foo))
1811
+ # @foo ||= Foo.new
1812
+ # end
1813
+ #
1814
+ # # bad
1815
+ # sig { returns(Foo) }
1816
+ # def foo
1817
+ # # This would have been a mistake, causing the memoized value to be discarded and recomputed on every call.
1818
+ # @foo = T.let(nil, T.nilable(Foo))
1819
+ # @foo ||= Foo.new
1820
+ # end
1821
+ #
1822
+ # # good
1823
+ # sig { returns(Foo) }
1824
+ # def foo
1825
+ # @foo ||= T.let(Foo.new, T.nilable(Foo))
1826
+ # end
1827
+ #
1828
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/obsolete_strict_memoization.rb#37
1829
+ class RuboCop::Cop::Sorbet::ObsoleteStrictMemoization < ::RuboCop::Cop::Base
1830
+ include ::RuboCop::Cop::RangeHelp
1831
+ include ::RuboCop::Cop::MatchRange
1832
+ include ::RuboCop::Cop::Alignment
1833
+ include ::RuboCop::Cop::LineLengthHelp
1834
+ include ::RuboCop::Cop::Sorbet::TargetSorbetVersion
1835
+ extend ::RuboCop::Cop::AutoCorrector
1836
+ extend ::RuboCop::Cop::Sorbet::TargetSorbetVersion::ClassMethods
1837
+
1838
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/obsolete_strict_memoization.rb#51
1839
+ def legacy_memoization_pattern?(param0 = T.unsafe(nil)); end
1840
+
1841
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/obsolete_strict_memoization.rb#62
1842
+ def on_begin(node); end
1843
+
1844
+ # @return [Boolean]
1845
+ #
1846
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/obsolete_strict_memoization.rb#86
1847
+ def relevant_file?(file); end
1848
+ end
1849
+
1850
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/obsolete_strict_memoization.rb#47
1851
+ RuboCop::Cop::Sorbet::ObsoleteStrictMemoization::MSG = T.let(T.unsafe(nil), String)
1852
+
1853
+ # Forbids the use of redundant `extend T::Sig`. Only for use in
1854
+ # applications that monkey patch `Module.include(T::Sig)` globally,
1855
+ # which would make it redundant.
1856
+ #
1857
+ # @example
1858
+ # # bad
1859
+ # class Example
1860
+ # extend T::Sig
1861
+ # sig { void }
1862
+ # def no_op; end
1863
+ # end
1864
+ #
1865
+ # # good
1866
+ # class Example
1867
+ # sig { void }
1868
+ # def no_op; end
1869
+ # end
1870
+ #
1871
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb#28
1872
+ class RuboCop::Cop::Sorbet::RedundantExtendTSig < ::RuboCop::Cop::Base
1873
+ include ::RuboCop::Cop::RangeHelp
1874
+ extend ::RuboCop::Cop::AutoCorrector
1875
+
1876
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb#36
1877
+ def extend_t_sig?(param0 = T.unsafe(nil)); end
1878
+
1879
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb#40
1880
+ def on_send(node); end
1881
+ end
1882
+
1883
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb#32
1884
+ RuboCop::Cop::Sorbet::RedundantExtendTSig::MSG = T.let(T.unsafe(nil), String)
1885
+
1886
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb#33
1887
+ RuboCop::Cop::Sorbet::RedundantExtendTSig::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1888
+
1889
+ # Checks for the use of Ruby Refinements library. Refinements add
1890
+ # complexity and incur a performance penalty that can be significant
1891
+ # for large code bases. Good examples are cases of unrelated
1892
+ # methods that happen to have the same name as these module methods.
1893
+ #
1894
+ # @example
1895
+ # # bad
1896
+ # module Foo
1897
+ # refine(Date) do
1898
+ # end
1899
+ # end
1900
+ #
1901
+ # # bad
1902
+ # module Foo
1903
+ # using(Date) do
1904
+ # end
1905
+ # end
1906
+ #
1907
+ # # good
1908
+ # module Foo
1909
+ # bar.refine(Date)
1910
+ # end
1911
+ #
1912
+ # # good
1913
+ # module Foo
1914
+ # bar.using(Date)
1915
+ # end
1916
+ #
1917
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/refinement.rb#34
1918
+ class RuboCop::Cop::Sorbet::Refinement < ::RuboCop::Cop::Base
1919
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/refinement.rb#38
1920
+ def on_send(node); end
1921
+ end
1922
+
1923
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/refinement.rb#35
1924
+ RuboCop::Cop::Sorbet::Refinement::MSG = T.let(T.unsafe(nil), String)
1925
+
1926
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/refinement.rb#36
1927
+ RuboCop::Cop::Sorbet::Refinement::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1928
+
1929
+ # Suggests using `grep` over `select` when using it only for type narrowing.
1930
+ #
1931
+ # @example
1932
+ #
1933
+ # # bad
1934
+ # strings_or_integers.select { |e| e.is_a?(String) }
1935
+ # strings_or_integers.filter { |e| e.is_a?(String) }
1936
+ # strings_or_integers.select { |e| e.kind_of?(String) }
1937
+ #
1938
+ # # good
1939
+ # strings_or_integers.grep(String)
1940
+ #
1941
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/select_by_is_a.rb#19
1942
+ class RuboCop::Cop::Sorbet::SelectByIsA < ::RuboCop::Cop::Base
1943
+ extend ::RuboCop::Cop::AutoCorrector
1944
+
1945
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/select_by_is_a.rb#43
1946
+ def on_csend(node); end
1947
+
1948
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/select_by_is_a.rb#43
1949
+ def on_send(node); end
1950
+
1951
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/select_by_is_a.rb#26
1952
+ def type_narrowing_select?(param0 = T.unsafe(nil)); end
1953
+ end
1954
+
1955
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/select_by_is_a.rb#22
1956
+ RuboCop::Cop::Sorbet::SelectByIsA::MSG = T.let(T.unsafe(nil), String)
1957
+
1958
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/select_by_is_a.rb#23
1959
+ RuboCop::Cop::Sorbet::SelectByIsA::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1960
+
1961
+ # Checks for the correct order of `sig` builder methods.
1962
+ #
1963
+ # Options:
1964
+ #
1965
+ # * `Order`: The order in which to enforce the builder methods are called.
1966
+ #
1967
+ # @example
1968
+ # # bad
1969
+ # sig { void.abstract }
1970
+ #
1971
+ # # good
1972
+ # sig { abstract.void }
1973
+ #
1974
+ # # bad
1975
+ # sig { returns(Integer).params(x: Integer) }
1976
+ #
1977
+ # # good
1978
+ # sig { params(x: Integer).returns(Integer) }
1979
+ #
1980
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#24
1981
+ class RuboCop::Cop::Sorbet::SignatureBuildOrder < ::RuboCop::Cop::Base
1982
+ include ::RuboCop::Cop::Sorbet::SignatureHelp
1983
+ extend ::RuboCop::Cop::AutoCorrector
1984
+
1985
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#33
1986
+ def on_signature(node); end
1987
+
1988
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#29
1989
+ def root_call(param0); end
1990
+
1991
+ private
1992
+
1993
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#96
1994
+ def builder_method_indexes; end
1995
+
1996
+ # Split foo.bar.baz into [foo, foo.bar, foo.bar.baz]
1997
+ #
1998
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#83
1999
+ def call_chain(node); end
2000
+
2001
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#70
2002
+ def expected_source(expected_calls_and_indexes); end
2003
+ end
2004
+
2005
+ # Mixin for writing cops for signatures, providing a `signature?` node matcher and an `on_signature` trigger.
2006
+ #
2007
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/signature_help.rb#7
2008
+ module RuboCop::Cop::Sorbet::SignatureHelp
2009
+ extend ::RuboCop::AST::NodePattern::Macros
2010
+
2011
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/signature_help.rb#16
2012
+ def bare_sig?(param0 = T.unsafe(nil)); end
2013
+
2014
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/signature_help.rb#42
2015
+ def on_block(node); end
2016
+
2017
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/signature_help.rb#42
2018
+ def on_numblock(node); end
2019
+
2020
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/signature_help.rb#48
2021
+ def on_signature(_node); end
2022
+
2023
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/signature_help.rb#25
2024
+ def sig_with_runtime?(param0 = T.unsafe(nil)); end
2025
+
2026
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/signature_help.rb#34
2027
+ def sig_without_runtime?(param0 = T.unsafe(nil)); end
2028
+
2029
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/signature_help.rb#11
2030
+ def signature?(param0 = T.unsafe(nil)); end
2031
+ end
2032
+
2033
+ # Ensures empty class/module definitions in RBI files are
2034
+ # done on a single line rather than being split across multiple lines.
2035
+ #
2036
+ # @example
2037
+ #
2038
+ # # bad
2039
+ # module SomeModule
2040
+ # end
2041
+ #
2042
+ # # good
2043
+ # module SomeModule; end
2044
+ #
2045
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#17
2046
+ class RuboCop::Cop::Sorbet::SingleLineRbiClassModuleDefinitions < ::RuboCop::Cop::Base
2047
+ extend ::RuboCop::Cop::AutoCorrector
2048
+
2049
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#22
2050
+ def on_class(node); end
2051
+
2052
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#22
2053
+ def on_module(node); end
2054
+
2055
+ private
2056
+
2057
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#34
2058
+ def convert_newlines_to_semicolons(source); end
2059
+ end
2060
+
2061
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#20
2062
+ RuboCop::Cop::Sorbet::SingleLineRbiClassModuleDefinitions::MSG = T.let(T.unsafe(nil), String)
2063
+
2064
+ # Makes the Sorbet `strict` sigil mandatory in all files.
2065
+ #
2066
+ # @example
2067
+ #
2068
+ # # bad
2069
+ # # typed: true
2070
+ #
2071
+ # # bad
2072
+ # # typed: false
2073
+ #
2074
+ # # good
2075
+ # # typed: strict
2076
+ #
2077
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/strict_sigil.rb#25
2078
+ class RuboCop::Cop::Sorbet::StrictSigil < ::RuboCop::Cop::Sorbet::HasSigil
2079
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/strict_sigil.rb#26
2080
+ def minimum_strictness; end
2081
+ end
2082
+
2083
+ # Makes the Sorbet `strong` sigil mandatory in all files.
2084
+ #
2085
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/strong_sigil.rb#10
2086
+ class RuboCop::Cop::Sorbet::StrongSigil < ::RuboCop::Cop::Sorbet::HasSigil
2087
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/strong_sigil.rb#11
2088
+ def minimum_strictness; end
2089
+ end
2090
+
2091
+ # Mixing for writing cops that deal with `T::Enum`s
2092
+ #
2093
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/t_enum.rb#7
2094
+ module RuboCop::Cop::Sorbet::TEnum
2095
+ extend ::RuboCop::AST::NodePattern::Macros
2096
+
2097
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/t_enum.rb#9
2098
+ def initialize(*_arg0); end
2099
+
2100
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/t_enum.rb#23
2101
+ def after_class(node); end
2102
+
2103
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/t_enum.rb#19
2104
+ def on_class(node); end
2105
+
2106
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/t_enum.rb#15
2107
+ def t_enum?(param0 = T.unsafe(nil)); end
2108
+
2109
+ private
2110
+
2111
+ # @return [Boolean]
2112
+ #
2113
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/t_enum.rb#29
2114
+ def in_t_enum_class?; end
2115
+ end
2116
+
2117
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#6
2118
+ module RuboCop::Cop::Sorbet::TargetSorbetVersion
2119
+ mixes_in_class_methods ::RuboCop::Cop::Sorbet::TargetSorbetVersion::ClassMethods
2120
+
2121
+ # @return [Boolean]
2122
+ #
2123
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#28
2124
+ def enabled_for_sorbet_static_version?; end
2125
+
2126
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#44
2127
+ def read_sorbet_static_version_from_bundler_lock_file; end
2128
+
2129
+ # @return [Boolean]
2130
+ #
2131
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#24
2132
+ def sorbet_enabled?; end
2133
+
2134
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#35
2135
+ def target_sorbet_static_version_from_bundler_lock_file; end
2136
+
2137
+ class << self
2138
+ # @private
2139
+ #
2140
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#8
2141
+ def included(target); end
2142
+ end
2143
+ end
2144
+
2145
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#13
2146
+ module RuboCop::Cop::Sorbet::TargetSorbetVersion::ClassMethods
2147
+ # Sets the version of the Sorbet static type checker required by this cop
2148
+ #
2149
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#15
2150
+ def minimum_target_sorbet_static_version(version); end
2151
+
2152
+ # @return [Boolean]
2153
+ #
2154
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#19
2155
+ def supports_target_sorbet_static_version?(version); end
2156
+ end
2157
+
2158
+ # Makes the Sorbet `true` sigil mandatory in all files.
2159
+ #
2160
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/true_sigil.rb#10
2161
+ class RuboCop::Cop::Sorbet::TrueSigil < ::RuboCop::Cop::Sorbet::HasSigil
2162
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/true_sigil.rb#11
2163
+ def minimum_strictness; end
2164
+ end
2165
+
2166
+ # Ensures all constants used as `T.type_alias` are using CamelCase.
2167
+ #
2168
+ # @example
2169
+ #
2170
+ # # bad
2171
+ # FOO_OR_BAR = T.type_alias { T.any(Foo, Bar) }
2172
+ #
2173
+ # # good
2174
+ # FooOrBar = T.type_alias { T.any(Foo, Bar) }
2175
+ #
2176
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/type_alias_name.rb#17
2177
+ class RuboCop::Cop::Sorbet::TypeAliasName < ::RuboCop::Cop::Base
2178
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/type_alias_name.rb#32
2179
+ def on_casgn(node); end
2180
+
2181
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/type_alias_name.rb#21
2182
+ def underscored_type_alias?(param0 = T.unsafe(nil)); end
2183
+ end
2184
+
2185
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/type_alias_name.rb#18
2186
+ RuboCop::Cop::Sorbet::TypeAliasName::MSG = T.let(T.unsafe(nil), String)
2187
+
2188
+ # Checks that gem versions in RBI annotations are properly formatted per the Bundler gem specification.
2189
+ #
2190
+ # @example
2191
+ # # bad
2192
+ # # @version > not a version number
2193
+ #
2194
+ # # good
2195
+ # # @version = 1
2196
+ #
2197
+ # # good
2198
+ # # @version > 1.2.3
2199
+ #
2200
+ # # good
2201
+ # # @version <= 4.3-preview
2202
+ #
2203
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi_versioning/valid_gem_version_annotations.rb#21
2204
+ class RuboCop::Cop::Sorbet::ValidGemVersionAnnotations < ::RuboCop::Cop::Base
2205
+ include ::RuboCop::Cop::Sorbet::GemVersionAnnotationHelper
2206
+
2207
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi_versioning/valid_gem_version_annotations.rb#27
2208
+ def on_new_investigation; end
2209
+
2210
+ private
2211
+
2212
+ # @return [Boolean]
2213
+ #
2214
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi_versioning/valid_gem_version_annotations.rb#50
2215
+ def valid_version?(version_string); end
2216
+ end
2217
+
2218
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi_versioning/valid_gem_version_annotations.rb#24
2219
+ RuboCop::Cop::Sorbet::ValidGemVersionAnnotations::MSG = T.let(T.unsafe(nil), String)
2220
+
2221
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi_versioning/valid_gem_version_annotations.rb#25
2222
+ RuboCop::Cop::Sorbet::ValidGemVersionAnnotations::VALID_OPERATORS = T.let(T.unsafe(nil), Array)
2223
+
2224
+ # Checks that every Ruby file contains a valid Sorbet sigil.
2225
+ # Adapted from: https://gist.github.com/clarkdave/85aca4e16f33fd52aceb6a0a29936e52
2226
+ #
2227
+ # Options:
2228
+ #
2229
+ # * `RequireSigilOnAllFiles`: make offense if the Sorbet typed is not found in the file (default: false)
2230
+ # * `SuggestedStrictness`: Sorbet strictness level suggested in offense messages (default: 'false')
2231
+ # * `MinimumStrictness`: If set, make offense if the strictness level in the file is below this one
2232
+ # * `ExactStrictness`: If set, make offense if the strictness level in the file is different than this one
2233
+ #
2234
+ # If an `ExactStrictness` level is specified, it will be used in offense messages and autocorrect.
2235
+ # If a `SuggestedStrictness` level is specified, it will be used in autocorrect.
2236
+ # Otherwise, if a `MinimumStrictness` level is specified, it will be used in offense messages and autocorrect.
2237
+ #
2238
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#21
2239
+ class RuboCop::Cop::Sorbet::ValidSigil < ::RuboCop::Cop::Base
2240
+ extend ::RuboCop::Cop::AutoCorrector
2241
+
2242
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#24
2243
+ def on_new_investigation; end
2244
+
2245
+ protected
2246
+
2247
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#169
2248
+ def autocorrect(corrector); end
2249
+
2250
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#110
2251
+ def check_double_commented_sigil(sigil, strictness); end
2252
+
2253
+ # checks
2254
+ #
2255
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#59
2256
+ def check_sigil_present(sigil); end
2257
+
2258
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#137
2259
+ def check_strictness_level(sigil, strictness); end
2260
+
2261
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#98
2262
+ def check_strictness_not_empty(sigil, strictness); end
2263
+
2264
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#125
2265
+ def check_strictness_valid(sigil, strictness); end
2266
+
2267
+ # Default is `nil`
2268
+ #
2269
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#203
2270
+ def exact_strictness; end
2271
+
2272
+ # extraction
2273
+ #
2274
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#47
2275
+ def extract_sigil(processed_source); end
2276
+
2277
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#53
2278
+ def extract_strictness(sigil); end
2279
+
2280
+ # Default is `nil`
2281
+ #
2282
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#197
2283
+ def minimum_strictness; end
2284
+
2285
+ # Default is `false`
2286
+ #
2287
+ # @return [Boolean]
2288
+ #
2289
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#186
2290
+ def require_sigil_on_all_files?; end
2291
+
2292
+ # Default is `'false'`
2293
+ #
2294
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#191
2295
+ def suggested_strictness; end
2296
+
2297
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#76
2298
+ def suggested_strictness_level; end
2299
+ end
2300
+
2301
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#43
2302
+ RuboCop::Cop::Sorbet::ValidSigil::INVALID_SIGIL_MSG = T.let(T.unsafe(nil), String)
2303
+
2304
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#42
2305
+ RuboCop::Cop::Sorbet::ValidSigil::SIGIL_REGEX = T.let(T.unsafe(nil), Regexp)
2306
+
2307
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#41
2308
+ RuboCop::Cop::Sorbet::ValidSigil::STRICTNESS_LEVELS = T.let(T.unsafe(nil), Array)
2309
+
2310
+ # Disallows the usage of `.void.checked(:tests)`.
2311
+ #
2312
+ # Using `.void` changes the value returned from the method, but only if
2313
+ # runtime type checking is enabled for the method. Methods marked `.void`
2314
+ # will return different values in tests compared with non-test
2315
+ # environments. This is particularly troublesome if branching on the
2316
+ # result of a `.void` method, because the returned value in test code
2317
+ # will be the truthy `VOID` value, while the non-test return value may be
2318
+ # falsy depending on the method's implementation.
2319
+ #
2320
+ # - Use `.returns(T.anything).checked(:tests)` to keep the runtime type
2321
+ # checking for the rest of the parameters.
2322
+ # - Use `.void.checked(:never)` if you are on an older version of Sorbet
2323
+ # which does not have `T.anything` (meaning versions 0.5.10781 or
2324
+ # earlier. Versions released after 2023-04-14 include `T.anything`.)
2325
+ #
2326
+ # @example
2327
+ #
2328
+ # # bad
2329
+ # sig { void.checked(:tests) }
2330
+ #
2331
+ # # good
2332
+ # sig { void }
2333
+ # sig { returns(T.anything).checked(:tests) }
2334
+ # sig { void.checked(:never) }
2335
+ #
2336
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/void_checked_tests.rb#31
2337
+ class RuboCop::Cop::Sorbet::VoidCheckedTests < ::RuboCop::Cop::Base
2338
+ include ::RuboCop::Cop::RangeHelp
2339
+ include ::RuboCop::Cop::Sorbet::SignatureHelp
2340
+ extend ::RuboCop::Cop::AutoCorrector
2341
+
2342
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/void_checked_tests.rb#37
2343
+ def checked_tests(param0); end
2344
+
2345
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/void_checked_tests.rb#58
2346
+ def on_signature(node); end
2347
+
2348
+ private
2349
+
2350
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/void_checked_tests.rb#48
2351
+ def top_level_void(node); end
2352
+ end
2353
+
2354
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/void_checked_tests.rb#41
2355
+ RuboCop::Cop::Sorbet::VoidCheckedTests::MESSAGE = T.let(T.unsafe(nil), String)
2356
+
2357
+ module RuboCop::Cop::Style; end
2358
+
2359
+ class RuboCop::Cop::Style::MutableConstant < ::RuboCop::Cop::Base
2360
+ include ::RuboCop::Cop::Sorbet::MutableConstantSorbetAwareBehaviour
2361
+ end
2362
+
2363
+ # source://rubocop-sorbet//lib/rubocop/sorbet/version.rb#4
2364
+ module RuboCop::Sorbet; end
2365
+
2366
+ # source://rubocop-sorbet//lib/rubocop/sorbet.rb#11
2367
+ class RuboCop::Sorbet::Error < ::StandardError; end
2368
+
2369
+ # A plugin that integrates RuboCop Sorbet with RuboCop's plugin system.
2370
+ #
2371
+ # source://rubocop-sorbet//lib/rubocop/sorbet/plugin.rb#15
2372
+ class RuboCop::Sorbet::Plugin < ::LintRoller::Plugin
2373
+ # source://rubocop-sorbet//lib/rubocop/sorbet/plugin.rb#16
2374
+ def about; end
2375
+
2376
+ # source://rubocop-sorbet//lib/rubocop/sorbet/plugin.rb#29
2377
+ def rules(_context); end
2378
+
2379
+ # @return [Boolean]
2380
+ #
2381
+ # source://rubocop-sorbet//lib/rubocop/sorbet/plugin.rb#25
2382
+ def supported?(context); end
2383
+ end
2384
+
2385
+ # source://rubocop-sorbet//lib/rubocop/sorbet/version.rb#5
2386
+ RuboCop::Sorbet::VERSION = T.let(T.unsafe(nil), String)