ori-rb 0.4

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 (84) hide show
  1. checksums.yaml +7 -0
  2. data/.rubocop.yml +8 -0
  3. data/.ruby-version +1 -0
  4. data/LICENSE +9 -0
  5. data/README.md +444 -0
  6. data/Rakefile +17 -0
  7. data/docs/images/example_boundary.png +0 -0
  8. data/docs/images/example_boundary_cancellation.png +0 -0
  9. data/docs/images/example_channel.png +0 -0
  10. data/docs/images/example_mutex.png +0 -0
  11. data/docs/images/example_promise.png +0 -0
  12. data/docs/images/example_semaphore.png +0 -0
  13. data/docs/images/example_trace.png +0 -0
  14. data/docs/images/example_trace_tag.png +0 -0
  15. data/lib/ori/channel.rb +148 -0
  16. data/lib/ori/lazy.rb +163 -0
  17. data/lib/ori/mutex.rb +9 -0
  18. data/lib/ori/out/index.html +146 -0
  19. data/lib/ori/out/script.js +3 -0
  20. data/lib/ori/promise.rb +39 -0
  21. data/lib/ori/reentrant_semaphore.rb +68 -0
  22. data/lib/ori/scope.rb +620 -0
  23. data/lib/ori/select.rb +35 -0
  24. data/lib/ori/selectable.rb +9 -0
  25. data/lib/ori/semaphore.rb +49 -0
  26. data/lib/ori/task.rb +78 -0
  27. data/lib/ori/timeout.rb +16 -0
  28. data/lib/ori/tracer.rb +335 -0
  29. data/lib/ori/version.rb +5 -0
  30. data/lib/ori.rb +68 -0
  31. data/mise-tasks/test +15 -0
  32. data/mise.toml +40 -0
  33. data/sorbet/config +8 -0
  34. data/sorbet/rbi/gems/.gitattributes +1 -0
  35. data/sorbet/rbi/gems/ast@2.4.3.rbi +585 -0
  36. data/sorbet/rbi/gems/benchmark@0.4.1.rbi +619 -0
  37. data/sorbet/rbi/gems/date@3.4.1.rbi +75 -0
  38. data/sorbet/rbi/gems/erb@5.1.1.rbi +845 -0
  39. data/sorbet/rbi/gems/erubi@1.13.1.rbi +155 -0
  40. data/sorbet/rbi/gems/io-console@0.8.1.rbi +9 -0
  41. data/sorbet/rbi/gems/json@2.15.1.rbi +2101 -0
  42. data/sorbet/rbi/gems/language_server-protocol@3.17.0.5.rbi +9 -0
  43. data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +240 -0
  44. data/sorbet/rbi/gems/logger@1.7.0.rbi +963 -0
  45. data/sorbet/rbi/gems/minitest@5.26.0.rbi +2234 -0
  46. data/sorbet/rbi/gems/netrc@0.11.0.rbi +159 -0
  47. data/sorbet/rbi/gems/nio4r@2.7.4.rbi +293 -0
  48. data/sorbet/rbi/gems/parallel@1.27.0.rbi +291 -0
  49. data/sorbet/rbi/gems/parser@3.3.9.0.rbi +5535 -0
  50. data/sorbet/rbi/gems/pp@0.6.3.rbi +376 -0
  51. data/sorbet/rbi/gems/prettyprint@0.2.0.rbi +477 -0
  52. data/sorbet/rbi/gems/prism@1.5.2.rbi +42056 -0
  53. data/sorbet/rbi/gems/psych@5.2.6.rbi +2469 -0
  54. data/sorbet/rbi/gems/racc@1.8.1.rbi +160 -0
  55. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +403 -0
  56. data/sorbet/rbi/gems/rake@13.3.0.rbi +3036 -0
  57. data/sorbet/rbi/gems/rbi@0.3.7.rbi +7115 -0
  58. data/sorbet/rbi/gems/rbs@3.9.5.rbi +6978 -0
  59. data/sorbet/rbi/gems/rdoc@6.15.0.rbi +12777 -0
  60. data/sorbet/rbi/gems/regexp_parser@2.11.3.rbi +3845 -0
  61. data/sorbet/rbi/gems/reline@0.6.2.rbi +9 -0
  62. data/sorbet/rbi/gems/rexml@3.4.4.rbi +5285 -0
  63. data/sorbet/rbi/gems/rubocop-ast@1.47.1.rbi +7780 -0
  64. data/sorbet/rbi/gems/rubocop-shopify@2.17.1.rbi +9 -0
  65. data/sorbet/rbi/gems/rubocop-sorbet@0.11.0.rbi +2506 -0
  66. data/sorbet/rbi/gems/rubocop@1.81.1.rbi +63489 -0
  67. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1318 -0
  68. data/sorbet/rbi/gems/spoom@1.6.3.rbi +6985 -0
  69. data/sorbet/rbi/gems/stringio@3.1.7.rbi +9 -0
  70. data/sorbet/rbi/gems/tapioca@0.16.11.rbi +3628 -0
  71. data/sorbet/rbi/gems/thor@1.4.0.rbi +4399 -0
  72. data/sorbet/rbi/gems/tsort@0.2.0.rbi +393 -0
  73. data/sorbet/rbi/gems/unicode-display_width@3.2.0.rbi +132 -0
  74. data/sorbet/rbi/gems/unicode-emoji@4.1.0.rbi +251 -0
  75. data/sorbet/rbi/gems/vernier@1.8.1-96ce5c739bfe6a18d2f4393f4219a1bf48674b87.rbi +904 -0
  76. data/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi +435 -0
  77. data/sorbet/rbi/gems/yard@0.9.37.rbi +18379 -0
  78. data/sorbet/rbi/gems/zeitwerk@2.7.3.rbi +1429 -0
  79. data/sorbet/shims/fiber.rbi +21 -0
  80. data/sorbet/shims/io.rbi +8 -0
  81. data/sorbet/shims/random.rbi +9 -0
  82. data/sorbet/shims/rdoc.rbi +3 -0
  83. data/sorbet/tapioca/require.rb +7 -0
  84. metadata +169 -0
@@ -0,0 +1,2506 @@
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
+ # Detect and autocorrect `T.any(..., NilClass, ...)` to `T.nilable(...)`
1177
+ #
1178
+ # @example
1179
+ #
1180
+ # # bad
1181
+ # T.any(String, NilClass)
1182
+ # T.any(NilClass, String)
1183
+ # T.any(NilClass, Symbol, String)
1184
+ #
1185
+ # # good
1186
+ # T.nilable(String)
1187
+ # T.nilable(String)
1188
+ # T.nilable(T.any(Symbol, String))
1189
+ #
1190
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_any_with_nil.rb#19
1191
+ class RuboCop::Cop::Sorbet::ForbidTAnyWithNil < ::RuboCop::Cop::Base
1192
+ extend ::RuboCop::Cop::AutoCorrector
1193
+
1194
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_any_with_nil.rb#31
1195
+ def nil_const_node?(param0 = T.unsafe(nil)); end
1196
+
1197
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_any_with_nil.rb#35
1198
+ def on_csend(node); end
1199
+
1200
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_any_with_nil.rb#35
1201
+ def on_send(node); end
1202
+
1203
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_any_with_nil.rb#26
1204
+ def t_any_call?(param0 = T.unsafe(nil)); end
1205
+
1206
+ private
1207
+
1208
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_any_with_nil.rb#52
1209
+ def build_replacement(non_nil_args); end
1210
+ end
1211
+
1212
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_any_with_nil.rb#22
1213
+ RuboCop::Cop::Sorbet::ForbidTAnyWithNil::MSG = T.let(T.unsafe(nil), String)
1214
+
1215
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_any_with_nil.rb#23
1216
+ RuboCop::Cop::Sorbet::ForbidTAnyWithNil::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1217
+
1218
+ # Disallows using `T.bind` anywhere.
1219
+ #
1220
+ # @example
1221
+ #
1222
+ # # bad
1223
+ # T.bind(self, Integer)
1224
+ #
1225
+ # # good
1226
+ # #: self as Integer
1227
+ #
1228
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_bind.rb#17
1229
+ class RuboCop::Cop::Sorbet::ForbidTBind < ::RuboCop::Cop::Base
1230
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_bind.rb#24
1231
+ def on_csend(node); end
1232
+
1233
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_bind.rb#24
1234
+ def on_send(node); end
1235
+
1236
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_bind.rb#22
1237
+ def t_bind?(param0 = T.unsafe(nil)); end
1238
+ end
1239
+
1240
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_bind.rb#18
1241
+ RuboCop::Cop::Sorbet::ForbidTBind::MSG = T.let(T.unsafe(nil), String)
1242
+
1243
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_bind.rb#19
1244
+ RuboCop::Cop::Sorbet::ForbidTBind::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1245
+
1246
+ # Disallows using `T.cast` anywhere.
1247
+ #
1248
+ # @example
1249
+ #
1250
+ # # bad
1251
+ # T.cast(foo, Integer)
1252
+ #
1253
+ # # good
1254
+ # foo #: as Integer
1255
+ #
1256
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_cast.rb#17
1257
+ class RuboCop::Cop::Sorbet::ForbidTCast < ::RuboCop::Cop::Base
1258
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_cast.rb#24
1259
+ def on_csend(node); end
1260
+
1261
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_cast.rb#24
1262
+ def on_send(node); end
1263
+
1264
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_cast.rb#22
1265
+ def t_cast?(param0 = T.unsafe(nil)); end
1266
+ end
1267
+
1268
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_cast.rb#18
1269
+ RuboCop::Cop::Sorbet::ForbidTCast::MSG = T.let(T.unsafe(nil), String)
1270
+
1271
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_cast.rb#19
1272
+ RuboCop::Cop::Sorbet::ForbidTCast::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1273
+
1274
+ # Disallow using `T::Enum`.
1275
+ #
1276
+ # @example
1277
+ #
1278
+ # # bad
1279
+ # class MyEnum < T::Enum
1280
+ # enums do
1281
+ # A = new
1282
+ # B = new
1283
+ # end
1284
+ # end
1285
+ #
1286
+ # # good
1287
+ # class MyEnum
1288
+ # A = "a"
1289
+ # B = "b"
1290
+ # C = "c"
1291
+ # end
1292
+ #
1293
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_enum.rb#26
1294
+ class RuboCop::Cop::Sorbet::ForbidTEnum < ::RuboCop::Cop::Base
1295
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_enum.rb#34
1296
+ def on_class(node); end
1297
+
1298
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_enum.rb#30
1299
+ def t_enum?(param0 = T.unsafe(nil)); end
1300
+ end
1301
+
1302
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_enum.rb#27
1303
+ RuboCop::Cop::Sorbet::ForbidTEnum::MSG = T.let(T.unsafe(nil), String)
1304
+
1305
+ # Forbids `extend T::Helpers` and `include T::Helpers` in classes and modules.
1306
+ #
1307
+ # This is useful when using RBS or RBS-inline syntax for type signatures,
1308
+ # where `T::Helpers` is not needed and including it is redundant.
1309
+ #
1310
+ # @example
1311
+ #
1312
+ # # bad
1313
+ # class Example
1314
+ # extend T::Helpers
1315
+ # end
1316
+ #
1317
+ # # bad
1318
+ # module Example
1319
+ # include T::Helpers
1320
+ # end
1321
+ #
1322
+ # # good
1323
+ # class Example
1324
+ # end
1325
+ #
1326
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_helpers.rb#26
1327
+ class RuboCop::Cop::Sorbet::ForbidTHelpers < ::RuboCop::Cop::Base
1328
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_helpers.rb#35
1329
+ def on_csend(node); end
1330
+
1331
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_helpers.rb#35
1332
+ def on_send(node); end
1333
+
1334
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_helpers.rb#31
1335
+ def t_helpers?(param0 = T.unsafe(nil)); end
1336
+ end
1337
+
1338
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_helpers.rb#27
1339
+ RuboCop::Cop::Sorbet::ForbidTHelpers::MSG = T.let(T.unsafe(nil), String)
1340
+
1341
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_helpers.rb#28
1342
+ RuboCop::Cop::Sorbet::ForbidTHelpers::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1343
+
1344
+ # Disallows using `T.let` anywhere.
1345
+ #
1346
+ # @example
1347
+ #
1348
+ # # bad
1349
+ # T.let(foo, Integer)
1350
+ #
1351
+ # # good
1352
+ # foo #: Integer
1353
+ #
1354
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_let.rb#17
1355
+ class RuboCop::Cop::Sorbet::ForbidTLet < ::RuboCop::Cop::Base
1356
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_let.rb#24
1357
+ def on_csend(node); end
1358
+
1359
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_let.rb#24
1360
+ def on_send(node); end
1361
+
1362
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_let.rb#22
1363
+ def t_let?(param0 = T.unsafe(nil)); end
1364
+ end
1365
+
1366
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_let.rb#18
1367
+ RuboCop::Cop::Sorbet::ForbidTLet::MSG = T.let(T.unsafe(nil), String)
1368
+
1369
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_let.rb#19
1370
+ RuboCop::Cop::Sorbet::ForbidTLet::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1371
+
1372
+ # Disallows using `T.must` anywhere.
1373
+ #
1374
+ # @example
1375
+ #
1376
+ # # bad
1377
+ # T.must(foo)
1378
+ #
1379
+ # # good
1380
+ # foo #: as !nil
1381
+ #
1382
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_must.rb#17
1383
+ class RuboCop::Cop::Sorbet::ForbidTMust < ::RuboCop::Cop::Base
1384
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_must.rb#24
1385
+ def on_csend(node); end
1386
+
1387
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_must.rb#24
1388
+ def on_send(node); end
1389
+
1390
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_must.rb#22
1391
+ def t_must?(param0 = T.unsafe(nil)); end
1392
+ end
1393
+
1394
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_must.rb#18
1395
+ RuboCop::Cop::Sorbet::ForbidTMust::MSG = T.let(T.unsafe(nil), String)
1396
+
1397
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_must.rb#19
1398
+ RuboCop::Cop::Sorbet::ForbidTMust::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1399
+
1400
+ # Forbids `extend T::Sig` and `include T::Sig` in classes and modules.
1401
+ #
1402
+ # This is useful when using RBS or RBS-inline syntax for type signatures,
1403
+ # where `T::Sig` is not needed and including it is redundant.
1404
+ #
1405
+ # @example
1406
+ #
1407
+ # # bad
1408
+ # class Example
1409
+ # extend T::Sig
1410
+ # end
1411
+ #
1412
+ # # bad
1413
+ # module Example
1414
+ # include T::Sig
1415
+ # end
1416
+ #
1417
+ # # good
1418
+ # class Example
1419
+ # end
1420
+ #
1421
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_sig.rb#26
1422
+ class RuboCop::Cop::Sorbet::ForbidTSig < ::RuboCop::Cop::Base
1423
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_sig.rb#35
1424
+ def on_csend(node); end
1425
+
1426
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_sig.rb#35
1427
+ def on_send(node); end
1428
+
1429
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_sig.rb#31
1430
+ def t_sig?(param0 = T.unsafe(nil)); end
1431
+ end
1432
+
1433
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_sig.rb#27
1434
+ RuboCop::Cop::Sorbet::ForbidTSig::MSG = T.let(T.unsafe(nil), String)
1435
+
1436
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_sig.rb#28
1437
+ RuboCop::Cop::Sorbet::ForbidTSig::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1438
+
1439
+ # Disallow using `T::Struct` and `T::Props`.
1440
+ #
1441
+ # @example
1442
+ #
1443
+ # # bad
1444
+ # class MyStruct < T::Struct
1445
+ # const :foo, String
1446
+ # prop :bar, Integer, default: 0
1447
+ #
1448
+ # def some_method; end
1449
+ # end
1450
+ #
1451
+ # # good
1452
+ # class MyStruct
1453
+ # extend T::Sig
1454
+ #
1455
+ # sig { returns(String) }
1456
+ # attr_reader :foo
1457
+ #
1458
+ # sig { returns(Integer) }
1459
+ # attr_accessor :bar
1460
+ #
1461
+ # sig { params(foo: String, bar: Integer) }
1462
+ # def initialize(foo:, bar: 0)
1463
+ # @foo = foo
1464
+ # @bar = bar
1465
+ # end
1466
+ #
1467
+ # def some_method; end
1468
+ # end
1469
+ #
1470
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#38
1471
+ class RuboCop::Cop::Sorbet::ForbidTStruct < ::RuboCop::Cop::Base
1472
+ include ::RuboCop::Cop::Alignment
1473
+ include ::RuboCop::Cop::RangeHelp
1474
+ include ::RuboCop::Cop::CommentsHelp
1475
+ extend ::RuboCop::Cop::AutoCorrector
1476
+
1477
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#169
1478
+ def on_class(node); end
1479
+
1480
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#210
1481
+ def on_send(node); end
1482
+
1483
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#167
1484
+ def t_props?(param0 = T.unsafe(nil)); end
1485
+
1486
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#162
1487
+ def t_struct?(param0 = T.unsafe(nil)); end
1488
+
1489
+ private
1490
+
1491
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#218
1492
+ def initialize_method(indent, props); end
1493
+
1494
+ # @return [Boolean]
1495
+ #
1496
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#258
1497
+ def previous_line_blank?(node); end
1498
+ end
1499
+
1500
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#47
1501
+ RuboCop::Cop::Sorbet::ForbidTStruct::MSG_PROPS = T.let(T.unsafe(nil), String)
1502
+
1503
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#46
1504
+ RuboCop::Cop::Sorbet::ForbidTStruct::MSG_STRUCT = T.let(T.unsafe(nil), String)
1505
+
1506
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#104
1507
+ class RuboCop::Cop::Sorbet::ForbidTStruct::Property
1508
+ # @return [Property] a new instance of Property
1509
+ #
1510
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#107
1511
+ def initialize(node, kind, name, type, default:, factory:); end
1512
+
1513
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#123
1514
+ def attr_accessor; end
1515
+
1516
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#119
1517
+ def attr_sig; end
1518
+
1519
+ # Returns the value of attribute default.
1520
+ #
1521
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#105
1522
+ def default; end
1523
+
1524
+ # Returns the value of attribute factory.
1525
+ #
1526
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#105
1527
+ def factory; end
1528
+
1529
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#144
1530
+ def initialize_assign; end
1531
+
1532
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#131
1533
+ def initialize_param; end
1534
+
1535
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#127
1536
+ def initialize_sig_param; end
1537
+
1538
+ # Returns the value of attribute kind.
1539
+ #
1540
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#105
1541
+ def kind; end
1542
+
1543
+ # Returns the value of attribute name.
1544
+ #
1545
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#105
1546
+ def name; end
1547
+
1548
+ # @return [Boolean]
1549
+ #
1550
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#151
1551
+ def nilable?; end
1552
+
1553
+ # Returns the value of attribute node.
1554
+ #
1555
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#105
1556
+ def node; end
1557
+
1558
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#155
1559
+ def type; end
1560
+ end
1561
+
1562
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#44
1563
+ RuboCop::Cop::Sorbet::ForbidTStruct::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1564
+
1565
+ # This class walks down the class body of a T::Struct and collects all the properties that will need to be
1566
+ # translated into `attr_reader` and `attr_accessor` methods.
1567
+ #
1568
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#51
1569
+ class RuboCop::Cop::Sorbet::ForbidTStruct::TStructWalker
1570
+ include ::RuboCop::AST::Traversal
1571
+ extend ::RuboCop::AST::NodePattern::Macros
1572
+
1573
+ # @return [TStructWalker] a new instance of TStructWalker
1574
+ #
1575
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#57
1576
+ def initialize; end
1577
+
1578
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#63
1579
+ def extend_t_sig?(param0 = T.unsafe(nil)); end
1580
+
1581
+ # Returns the value of attribute has_extend_t_sig.
1582
+ #
1583
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#55
1584
+ def has_extend_t_sig; end
1585
+
1586
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#72
1587
+ def on_send(node); end
1588
+
1589
+ # Returns the value of attribute props.
1590
+ #
1591
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#55
1592
+ def props; end
1593
+
1594
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#68
1595
+ def t_struct_prop?(param0 = T.unsafe(nil)); end
1596
+ end
1597
+
1598
+ # Disallows using `T.type_alias` anywhere.
1599
+ #
1600
+ # @example
1601
+ #
1602
+ # # bad
1603
+ # STRING_OR_INTEGER = T.type_alias { T.any(Integer, String) }
1604
+ #
1605
+ # # good
1606
+ # #: type string_or_integer = Integer | String
1607
+ #
1608
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_type_alias.rb#17
1609
+ class RuboCop::Cop::Sorbet::ForbidTTypeAlias < ::RuboCop::Cop::Base
1610
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_type_alias.rb#23
1611
+ def on_block(node); end
1612
+
1613
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_type_alias.rb#23
1614
+ def on_numblock(node); end
1615
+
1616
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_type_alias.rb#21
1617
+ def t_type_alias?(param0 = T.unsafe(nil)); end
1618
+ end
1619
+
1620
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_type_alias.rb#18
1621
+ RuboCop::Cop::Sorbet::ForbidTTypeAlias::MSG = T.let(T.unsafe(nil), String)
1622
+
1623
+ # Disallows using `T.unsafe` anywhere.
1624
+ #
1625
+ # @example
1626
+ #
1627
+ # # bad
1628
+ # T.unsafe(foo)
1629
+ #
1630
+ # # good
1631
+ # foo
1632
+ #
1633
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_unsafe.rb#17
1634
+ class RuboCop::Cop::Sorbet::ForbidTUnsafe < ::RuboCop::Cop::Base
1635
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_unsafe.rb#24
1636
+ def on_csend(node); end
1637
+
1638
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_unsafe.rb#24
1639
+ def on_send(node); end
1640
+
1641
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_unsafe.rb#22
1642
+ def t_unsafe?(param0 = T.unsafe(nil)); end
1643
+ end
1644
+
1645
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_unsafe.rb#18
1646
+ RuboCop::Cop::Sorbet::ForbidTUnsafe::MSG = T.let(T.unsafe(nil), String)
1647
+
1648
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_unsafe.rb#19
1649
+ RuboCop::Cop::Sorbet::ForbidTUnsafe::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1650
+
1651
+ # Disallows using `T.untyped` anywhere.
1652
+ #
1653
+ # @example
1654
+ #
1655
+ # # bad
1656
+ # sig { params(my_argument: T.untyped).void }
1657
+ # def foo(my_argument); end
1658
+ #
1659
+ # # good
1660
+ # sig { params(my_argument: String).void }
1661
+ # def foo(my_argument); end
1662
+ #
1663
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_untyped.rb#20
1664
+ class RuboCop::Cop::Sorbet::ForbidTUntyped < ::RuboCop::Cop::Base
1665
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_untyped.rb#27
1666
+ def on_send(node); end
1667
+
1668
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_untyped.rb#25
1669
+ def t_untyped?(param0 = T.unsafe(nil)); end
1670
+ end
1671
+
1672
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_untyped.rb#21
1673
+ RuboCop::Cop::Sorbet::ForbidTUntyped::MSG = T.let(T.unsafe(nil), String)
1674
+
1675
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_untyped.rb#22
1676
+ RuboCop::Cop::Sorbet::ForbidTUntyped::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1677
+
1678
+ # Disallows defining type aliases that contain shapes
1679
+ #
1680
+ # @example
1681
+ #
1682
+ # # bad
1683
+ # Foo = T.type_alias { { foo: Integer } }
1684
+ #
1685
+ # # good
1686
+ # class Foo
1687
+ # extend T::Sig
1688
+ #
1689
+ # sig { params(foo: Integer).void }
1690
+ # def initialize(foo)
1691
+ # @foo = foo
1692
+ # end
1693
+ # end
1694
+ #
1695
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_type_aliased_shapes.rb#24
1696
+ class RuboCop::Cop::Sorbet::ForbidTypeAliasedShapes < ::RuboCop::Cop::Base
1697
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_type_aliased_shapes.rb#36
1698
+ def on_block(node); end
1699
+
1700
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_type_aliased_shapes.rb#36
1701
+ def on_numblock(node); end
1702
+
1703
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_type_aliased_shapes.rb#28
1704
+ def shape_type_alias?(param0 = T.unsafe(nil)); end
1705
+ end
1706
+
1707
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_type_aliased_shapes.rb#25
1708
+ RuboCop::Cop::Sorbet::ForbidTypeAliasedShapes::MSG = T.let(T.unsafe(nil), String)
1709
+
1710
+ # Disallows use of `T.untyped` or `T.nilable(T.untyped)`
1711
+ # as a prop type for `T::Struct` or `T::ImmutableStruct`.
1712
+ #
1713
+ # @example
1714
+ #
1715
+ # # bad
1716
+ # class SomeClass < T::Struct
1717
+ # const :foo, T.untyped
1718
+ # prop :bar, T.nilable(T.untyped)
1719
+ # end
1720
+ #
1721
+ # # good
1722
+ # class SomeClass < T::Struct
1723
+ # const :foo, Integer
1724
+ # prop :bar, T.nilable(String)
1725
+ # end
1726
+ #
1727
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#25
1728
+ class RuboCop::Cop::Sorbet::ForbidUntypedStructProps < ::RuboCop::Cop::Base
1729
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#54
1730
+ def on_class(node); end
1731
+
1732
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#44
1733
+ def subclass_of_t_struct?(param0 = T.unsafe(nil)); end
1734
+
1735
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#39
1736
+ def t_nilable_untyped(param0 = T.unsafe(nil)); end
1737
+
1738
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#29
1739
+ def t_struct(param0 = T.unsafe(nil)); end
1740
+
1741
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#34
1742
+ def t_untyped(param0 = T.unsafe(nil)); end
1743
+
1744
+ # Search for untyped prop/const declarations and capture their types
1745
+ #
1746
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#50
1747
+ def untyped_props(param0); end
1748
+ end
1749
+
1750
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#26
1751
+ RuboCop::Cop::Sorbet::ForbidUntypedStructProps::MSG = T.let(T.unsafe(nil), String)
1752
+
1753
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi_versioning/gem_version_annotation_helper.rb#6
1754
+ module RuboCop::Cop::Sorbet::GemVersionAnnotationHelper
1755
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi_versioning/gem_version_annotation_helper.rb#9
1756
+ def gem_version_annotations; end
1757
+
1758
+ private
1759
+
1760
+ # @return [Boolean]
1761
+ #
1762
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi_versioning/gem_version_annotation_helper.rb#17
1763
+ def gem_version_annotation?(comment); end
1764
+
1765
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi_versioning/gem_version_annotation_helper.rb#21
1766
+ def gem_versions(comment); end
1767
+ end
1768
+
1769
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi_versioning/gem_version_annotation_helper.rb#7
1770
+ RuboCop::Cop::Sorbet::GemVersionAnnotationHelper::VERSION_PREFIX = T.let(T.unsafe(nil), String)
1771
+
1772
+ # Makes the Sorbet typed sigil mandatory in all files.
1773
+ #
1774
+ # Options:
1775
+ #
1776
+ # * `SuggestedStrictness`: Sorbet strictness level suggested in offense messages (default: 'false')
1777
+ # * `MinimumStrictness`: If set, make offense if the strictness level in the file is below this one
1778
+ #
1779
+ # If a `SuggestedStrictness` level is specified, it will be used in autocorrect.
1780
+ # If a `MinimumStrictness` level is specified, it will be used in offense messages and autocorrect.
1781
+ #
1782
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/has_sigil.rb#18
1783
+ class RuboCop::Cop::Sorbet::HasSigil < ::RuboCop::Cop::Sorbet::ValidSigil
1784
+ # @return [Boolean]
1785
+ #
1786
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/has_sigil.rb#19
1787
+ def require_sigil_on_all_files?; end
1788
+ end
1789
+
1790
+ # Makes the Sorbet `ignore` sigil mandatory in all files.
1791
+ #
1792
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/ignore_sigil.rb#10
1793
+ class RuboCop::Cop::Sorbet::IgnoreSigil < ::RuboCop::Cop::Sorbet::HasSigil
1794
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/ignore_sigil.rb#11
1795
+ def minimum_strictness; end
1796
+ end
1797
+
1798
+ # Disallows declaring implicit conversion methods.
1799
+ # Since Sorbet is a nominal (not structural) type system,
1800
+ # implicit conversion is currently unsupported.
1801
+ #
1802
+ # @example
1803
+ #
1804
+ # # bad
1805
+ # def to_str; end
1806
+ #
1807
+ # # good
1808
+ # def to_str(x); end
1809
+ #
1810
+ # # bad
1811
+ # def self.to_str; end
1812
+ #
1813
+ # # good
1814
+ # def self.to_str(x); end
1815
+ #
1816
+ # # bad
1817
+ # alias to_str to_s
1818
+ # @note Since the arity of aliased methods is not checked, false positives may result.
1819
+ # @see https://docs.ruby-lang.org/en/master/implicit_conversion_rdoc.html
1820
+ #
1821
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/implicit_conversion_method.rb#31
1822
+ class RuboCop::Cop::Sorbet::ImplicitConversionMethod < ::RuboCop::Cop::Base
1823
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/implicit_conversion_method.rb#37
1824
+ def on_alias(node); end
1825
+
1826
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/implicit_conversion_method.rb#42
1827
+ def on_def(node); end
1828
+
1829
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/implicit_conversion_method.rb#42
1830
+ def on_defs(node); end
1831
+
1832
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/implicit_conversion_method.rb#50
1833
+ def on_send(node); end
1834
+ end
1835
+
1836
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/implicit_conversion_method.rb#32
1837
+ RuboCop::Cop::Sorbet::ImplicitConversionMethod::IMPLICIT_CONVERSION_METHODS = T.let(T.unsafe(nil), Array)
1838
+
1839
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/implicit_conversion_method.rb#33
1840
+ RuboCop::Cop::Sorbet::ImplicitConversionMethod::MSG = T.let(T.unsafe(nil), String)
1841
+
1842
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/implicit_conversion_method.rb#35
1843
+ RuboCop::Cop::Sorbet::ImplicitConversionMethod::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1844
+
1845
+ # Checks for the ordering of keyword arguments required by
1846
+ # sorbet-runtime. The ordering requires that all keyword arguments
1847
+ # are at the end of the parameters list, and all keyword arguments
1848
+ # with a default value must be after those without default values.
1849
+ #
1850
+ # @example
1851
+ #
1852
+ # # bad
1853
+ # sig { params(a: Integer, b: String).void }
1854
+ # def foo(a: 1, b:); end
1855
+ #
1856
+ # # good
1857
+ # sig { params(b: String, a: Integer).void }
1858
+ # def foo(b:, a: 1); end
1859
+ #
1860
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/keyword_argument_ordering.rb#20
1861
+ class RuboCop::Cop::Sorbet::KeywordArgumentOrdering < ::RuboCop::Cop::Base
1862
+ include ::RuboCop::Cop::Sorbet::SignatureHelp
1863
+
1864
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/keyword_argument_ordering.rb#23
1865
+ def on_signature(node); end
1866
+
1867
+ private
1868
+
1869
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/keyword_argument_ordering.rb#34
1870
+ def check_order_for_kwoptargs(parameters); end
1871
+ end
1872
+
1873
+ # Disallow creating a `T::Enum` with less than two values.
1874
+ #
1875
+ # @example
1876
+ #
1877
+ # # bad
1878
+ # class ErrorMessages < T::Enum
1879
+ # enums do
1880
+ # ServerError = new("There was a server error.")
1881
+ # end
1882
+ # end
1883
+ #
1884
+ # # good
1885
+ # class ErrorMessages < T::Enum
1886
+ # enums do
1887
+ # ServerError = new("There was a server error.")
1888
+ # NotFound = new("The resource was not found.")
1889
+ # end
1890
+ # end
1891
+ #
1892
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/t_enum/multiple_t_enum_values.rb#24
1893
+ class RuboCop::Cop::Sorbet::MultipleTEnumValues < ::RuboCop::Cop::Base
1894
+ include ::RuboCop::Cop::Sorbet::TEnum
1895
+
1896
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/t_enum/multiple_t_enum_values.rb#30
1897
+ def enums_block?(param0 = T.unsafe(nil)); end
1898
+
1899
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/t_enum/multiple_t_enum_values.rb#40
1900
+ def on_block(node); end
1901
+
1902
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/t_enum/multiple_t_enum_values.rb#34
1903
+ def on_class(node); end
1904
+ end
1905
+
1906
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/t_enum/multiple_t_enum_values.rb#27
1907
+ RuboCop::Cop::Sorbet::MultipleTEnumValues::MSG = T.let(T.unsafe(nil), String)
1908
+
1909
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#8
1910
+ module RuboCop::Cop::Sorbet::MutableConstantSorbetAwareBehaviour
1911
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#18
1912
+ def on_assignment(value); end
1913
+
1914
+ class << self
1915
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#10
1916
+ def prepended(base); end
1917
+ end
1918
+ end
1919
+
1920
+ # Checks for the obsolete pattern for initializing instance variables that was required for older Sorbet
1921
+ #
1922
+ # It's no longer required, as of Sorbet 0.5.10210
1923
+ # See https://sorbet.org/docs/type-assertions#put-type-assertions-behind-memoization
1924
+ #
1925
+ # @example
1926
+ #
1927
+ # # bad
1928
+ # sig { returns(Foo) }
1929
+ # def foo
1930
+ # @foo = T.let(@foo, T.nilable(Foo))
1931
+ # @foo ||= Foo.new
1932
+ # end
1933
+ #
1934
+ # # bad
1935
+ # sig { returns(Foo) }
1936
+ # def foo
1937
+ # # This would have been a mistake, causing the memoized value to be discarded and recomputed on every call.
1938
+ # @foo = T.let(nil, T.nilable(Foo))
1939
+ # @foo ||= Foo.new
1940
+ # end
1941
+ #
1942
+ # # good
1943
+ # sig { returns(Foo) }
1944
+ # def foo
1945
+ # @foo ||= T.let(Foo.new, T.nilable(Foo))
1946
+ # end
1947
+ #
1948
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/obsolete_strict_memoization.rb#37
1949
+ class RuboCop::Cop::Sorbet::ObsoleteStrictMemoization < ::RuboCop::Cop::Base
1950
+ include ::RuboCop::Cop::RangeHelp
1951
+ include ::RuboCop::Cop::MatchRange
1952
+ include ::RuboCop::Cop::Alignment
1953
+ include ::RuboCop::Cop::LineLengthHelp
1954
+ include ::RuboCop::Cop::Sorbet::TargetSorbetVersion
1955
+ extend ::RuboCop::Cop::AutoCorrector
1956
+ extend ::RuboCop::Cop::Sorbet::TargetSorbetVersion::ClassMethods
1957
+
1958
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/obsolete_strict_memoization.rb#51
1959
+ def legacy_memoization_pattern?(param0 = T.unsafe(nil)); end
1960
+
1961
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/obsolete_strict_memoization.rb#62
1962
+ def on_begin(node); end
1963
+
1964
+ # @return [Boolean]
1965
+ #
1966
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/obsolete_strict_memoization.rb#86
1967
+ def relevant_file?(file); end
1968
+ end
1969
+
1970
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/obsolete_strict_memoization.rb#47
1971
+ RuboCop::Cop::Sorbet::ObsoleteStrictMemoization::MSG = T.let(T.unsafe(nil), String)
1972
+
1973
+ # Forbids the use of redundant `extend T::Sig`. Only for use in
1974
+ # applications that monkey patch `Module.include(T::Sig)` globally,
1975
+ # which would make it redundant.
1976
+ #
1977
+ # @example
1978
+ # # bad
1979
+ # class Example
1980
+ # extend T::Sig
1981
+ # sig { void }
1982
+ # def no_op; end
1983
+ # end
1984
+ #
1985
+ # # good
1986
+ # class Example
1987
+ # sig { void }
1988
+ # def no_op; end
1989
+ # end
1990
+ #
1991
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb#28
1992
+ class RuboCop::Cop::Sorbet::RedundantExtendTSig < ::RuboCop::Cop::Base
1993
+ include ::RuboCop::Cop::RangeHelp
1994
+ extend ::RuboCop::Cop::AutoCorrector
1995
+
1996
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb#36
1997
+ def extend_t_sig?(param0 = T.unsafe(nil)); end
1998
+
1999
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb#40
2000
+ def on_send(node); end
2001
+ end
2002
+
2003
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb#32
2004
+ RuboCop::Cop::Sorbet::RedundantExtendTSig::MSG = T.let(T.unsafe(nil), String)
2005
+
2006
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb#33
2007
+ RuboCop::Cop::Sorbet::RedundantExtendTSig::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
2008
+
2009
+ # Checks for the use of Ruby Refinements library. Refinements add
2010
+ # complexity and incur a performance penalty that can be significant
2011
+ # for large code bases. Good examples are cases of unrelated
2012
+ # methods that happen to have the same name as these module methods.
2013
+ #
2014
+ # @example
2015
+ # # bad
2016
+ # module Foo
2017
+ # refine(Date) do
2018
+ # end
2019
+ # end
2020
+ #
2021
+ # # bad
2022
+ # module Foo
2023
+ # using(Date) do
2024
+ # end
2025
+ # end
2026
+ #
2027
+ # # good
2028
+ # module Foo
2029
+ # bar.refine(Date)
2030
+ # end
2031
+ #
2032
+ # # good
2033
+ # module Foo
2034
+ # bar.using(Date)
2035
+ # end
2036
+ #
2037
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/refinement.rb#34
2038
+ class RuboCop::Cop::Sorbet::Refinement < ::RuboCop::Cop::Base
2039
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/refinement.rb#38
2040
+ def on_send(node); end
2041
+ end
2042
+
2043
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/refinement.rb#35
2044
+ RuboCop::Cop::Sorbet::Refinement::MSG = T.let(T.unsafe(nil), String)
2045
+
2046
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/refinement.rb#36
2047
+ RuboCop::Cop::Sorbet::Refinement::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
2048
+
2049
+ # Suggests using `grep` over `select` when using it only for type narrowing.
2050
+ #
2051
+ # @example
2052
+ #
2053
+ # # bad
2054
+ # strings_or_integers.select { |e| e.is_a?(String) }
2055
+ # strings_or_integers.filter { |e| e.is_a?(String) }
2056
+ # strings_or_integers.select { |e| e.kind_of?(String) }
2057
+ #
2058
+ # # good
2059
+ # strings_or_integers.grep(String)
2060
+ #
2061
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/select_by_is_a.rb#19
2062
+ class RuboCop::Cop::Sorbet::SelectByIsA < ::RuboCop::Cop::Base
2063
+ extend ::RuboCop::Cop::AutoCorrector
2064
+
2065
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/select_by_is_a.rb#43
2066
+ def on_csend(node); end
2067
+
2068
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/select_by_is_a.rb#43
2069
+ def on_send(node); end
2070
+
2071
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/select_by_is_a.rb#26
2072
+ def type_narrowing_select?(param0 = T.unsafe(nil)); end
2073
+ end
2074
+
2075
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/select_by_is_a.rb#22
2076
+ RuboCop::Cop::Sorbet::SelectByIsA::MSG = T.let(T.unsafe(nil), String)
2077
+
2078
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/select_by_is_a.rb#23
2079
+ RuboCop::Cop::Sorbet::SelectByIsA::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
2080
+
2081
+ # Checks for the correct order of `sig` builder methods.
2082
+ #
2083
+ # Options:
2084
+ #
2085
+ # * `Order`: The order in which to enforce the builder methods are called.
2086
+ #
2087
+ # @example
2088
+ # # bad
2089
+ # sig { void.abstract }
2090
+ #
2091
+ # # good
2092
+ # sig { abstract.void }
2093
+ #
2094
+ # # bad
2095
+ # sig { returns(Integer).params(x: Integer) }
2096
+ #
2097
+ # # good
2098
+ # sig { params(x: Integer).returns(Integer) }
2099
+ #
2100
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#24
2101
+ class RuboCop::Cop::Sorbet::SignatureBuildOrder < ::RuboCop::Cop::Base
2102
+ include ::RuboCop::Cop::Sorbet::SignatureHelp
2103
+ extend ::RuboCop::Cop::AutoCorrector
2104
+
2105
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#33
2106
+ def on_signature(node); end
2107
+
2108
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#29
2109
+ def root_call(param0); end
2110
+
2111
+ private
2112
+
2113
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#96
2114
+ def builder_method_indexes; end
2115
+
2116
+ # Split foo.bar.baz into [foo, foo.bar, foo.bar.baz]
2117
+ #
2118
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#83
2119
+ def call_chain(node); end
2120
+
2121
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#70
2122
+ def expected_source(expected_calls_and_indexes); end
2123
+ end
2124
+
2125
+ # Mixin for writing cops for signatures, providing a `signature?` node matcher and an `on_signature` trigger.
2126
+ #
2127
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/signature_help.rb#7
2128
+ module RuboCop::Cop::Sorbet::SignatureHelp
2129
+ extend ::RuboCop::AST::NodePattern::Macros
2130
+
2131
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/signature_help.rb#16
2132
+ def bare_sig?(param0 = T.unsafe(nil)); end
2133
+
2134
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/signature_help.rb#42
2135
+ def on_block(node); end
2136
+
2137
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/signature_help.rb#42
2138
+ def on_numblock(node); end
2139
+
2140
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/signature_help.rb#48
2141
+ def on_signature(_node); end
2142
+
2143
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/signature_help.rb#25
2144
+ def sig_with_runtime?(param0 = T.unsafe(nil)); end
2145
+
2146
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/signature_help.rb#34
2147
+ def sig_without_runtime?(param0 = T.unsafe(nil)); end
2148
+
2149
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/signature_help.rb#11
2150
+ def signature?(param0 = T.unsafe(nil)); end
2151
+ end
2152
+
2153
+ # Ensures empty class/module definitions in RBI files are
2154
+ # done on a single line rather than being split across multiple lines.
2155
+ #
2156
+ # @example
2157
+ #
2158
+ # # bad
2159
+ # module SomeModule
2160
+ # end
2161
+ #
2162
+ # # good
2163
+ # module SomeModule; end
2164
+ #
2165
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#17
2166
+ class RuboCop::Cop::Sorbet::SingleLineRbiClassModuleDefinitions < ::RuboCop::Cop::Base
2167
+ extend ::RuboCop::Cop::AutoCorrector
2168
+
2169
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#22
2170
+ def on_class(node); end
2171
+
2172
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#22
2173
+ def on_module(node); end
2174
+
2175
+ private
2176
+
2177
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#34
2178
+ def convert_newlines_to_semicolons(source); end
2179
+ end
2180
+
2181
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#20
2182
+ RuboCop::Cop::Sorbet::SingleLineRbiClassModuleDefinitions::MSG = T.let(T.unsafe(nil), String)
2183
+
2184
+ # Makes the Sorbet `strict` sigil mandatory in all files.
2185
+ #
2186
+ # @example
2187
+ #
2188
+ # # bad
2189
+ # # typed: true
2190
+ #
2191
+ # # bad
2192
+ # # typed: false
2193
+ #
2194
+ # # good
2195
+ # # typed: strict
2196
+ #
2197
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/strict_sigil.rb#25
2198
+ class RuboCop::Cop::Sorbet::StrictSigil < ::RuboCop::Cop::Sorbet::HasSigil
2199
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/strict_sigil.rb#26
2200
+ def minimum_strictness; end
2201
+ end
2202
+
2203
+ # Makes the Sorbet `strong` sigil mandatory in all files.
2204
+ #
2205
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/strong_sigil.rb#10
2206
+ class RuboCop::Cop::Sorbet::StrongSigil < ::RuboCop::Cop::Sorbet::HasSigil
2207
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/strong_sigil.rb#11
2208
+ def minimum_strictness; end
2209
+ end
2210
+
2211
+ # Mixing for writing cops that deal with `T::Enum`s
2212
+ #
2213
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/t_enum.rb#7
2214
+ module RuboCop::Cop::Sorbet::TEnum
2215
+ extend ::RuboCop::AST::NodePattern::Macros
2216
+
2217
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/t_enum.rb#9
2218
+ def initialize(*_arg0); end
2219
+
2220
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/t_enum.rb#23
2221
+ def after_class(node); end
2222
+
2223
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/t_enum.rb#19
2224
+ def on_class(node); end
2225
+
2226
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/t_enum.rb#15
2227
+ def t_enum?(param0 = T.unsafe(nil)); end
2228
+
2229
+ private
2230
+
2231
+ # @return [Boolean]
2232
+ #
2233
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/t_enum.rb#29
2234
+ def in_t_enum_class?; end
2235
+ end
2236
+
2237
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#6
2238
+ module RuboCop::Cop::Sorbet::TargetSorbetVersion
2239
+ mixes_in_class_methods ::RuboCop::Cop::Sorbet::TargetSorbetVersion::ClassMethods
2240
+
2241
+ # @return [Boolean]
2242
+ #
2243
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#28
2244
+ def enabled_for_sorbet_static_version?; end
2245
+
2246
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#44
2247
+ def read_sorbet_static_version_from_bundler_lock_file; end
2248
+
2249
+ # @return [Boolean]
2250
+ #
2251
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#24
2252
+ def sorbet_enabled?; end
2253
+
2254
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#35
2255
+ def target_sorbet_static_version_from_bundler_lock_file; end
2256
+
2257
+ class << self
2258
+ # @private
2259
+ #
2260
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#8
2261
+ def included(target); end
2262
+ end
2263
+ end
2264
+
2265
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#13
2266
+ module RuboCop::Cop::Sorbet::TargetSorbetVersion::ClassMethods
2267
+ # Sets the version of the Sorbet static type checker required by this cop
2268
+ #
2269
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#15
2270
+ def minimum_target_sorbet_static_version(version); end
2271
+
2272
+ # @return [Boolean]
2273
+ #
2274
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#19
2275
+ def supports_target_sorbet_static_version?(version); end
2276
+ end
2277
+
2278
+ # Makes the Sorbet `true` sigil mandatory in all files.
2279
+ #
2280
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/true_sigil.rb#10
2281
+ class RuboCop::Cop::Sorbet::TrueSigil < ::RuboCop::Cop::Sorbet::HasSigil
2282
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/true_sigil.rb#11
2283
+ def minimum_strictness; end
2284
+ end
2285
+
2286
+ # Ensures all constants used as `T.type_alias` are using CamelCase.
2287
+ #
2288
+ # @example
2289
+ #
2290
+ # # bad
2291
+ # FOO_OR_BAR = T.type_alias { T.any(Foo, Bar) }
2292
+ #
2293
+ # # good
2294
+ # FooOrBar = T.type_alias { T.any(Foo, Bar) }
2295
+ #
2296
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/type_alias_name.rb#17
2297
+ class RuboCop::Cop::Sorbet::TypeAliasName < ::RuboCop::Cop::Base
2298
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/type_alias_name.rb#32
2299
+ def on_casgn(node); end
2300
+
2301
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/type_alias_name.rb#21
2302
+ def underscored_type_alias?(param0 = T.unsafe(nil)); end
2303
+ end
2304
+
2305
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/type_alias_name.rb#18
2306
+ RuboCop::Cop::Sorbet::TypeAliasName::MSG = T.let(T.unsafe(nil), String)
2307
+
2308
+ # Checks that gem versions in RBI annotations are properly formatted per the Bundler gem specification.
2309
+ #
2310
+ # @example
2311
+ # # bad
2312
+ # # @version > not a version number
2313
+ #
2314
+ # # good
2315
+ # # @version = 1
2316
+ #
2317
+ # # good
2318
+ # # @version > 1.2.3
2319
+ #
2320
+ # # good
2321
+ # # @version <= 4.3-preview
2322
+ #
2323
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi_versioning/valid_gem_version_annotations.rb#21
2324
+ class RuboCop::Cop::Sorbet::ValidGemVersionAnnotations < ::RuboCop::Cop::Base
2325
+ include ::RuboCop::Cop::Sorbet::GemVersionAnnotationHelper
2326
+
2327
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi_versioning/valid_gem_version_annotations.rb#27
2328
+ def on_new_investigation; end
2329
+
2330
+ private
2331
+
2332
+ # @return [Boolean]
2333
+ #
2334
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi_versioning/valid_gem_version_annotations.rb#50
2335
+ def valid_version?(version_string); end
2336
+ end
2337
+
2338
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi_versioning/valid_gem_version_annotations.rb#24
2339
+ RuboCop::Cop::Sorbet::ValidGemVersionAnnotations::MSG = T.let(T.unsafe(nil), String)
2340
+
2341
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi_versioning/valid_gem_version_annotations.rb#25
2342
+ RuboCop::Cop::Sorbet::ValidGemVersionAnnotations::VALID_OPERATORS = T.let(T.unsafe(nil), Array)
2343
+
2344
+ # Checks that every Ruby file contains a valid Sorbet sigil.
2345
+ # Adapted from: https://gist.github.com/clarkdave/85aca4e16f33fd52aceb6a0a29936e52
2346
+ #
2347
+ # Options:
2348
+ #
2349
+ # * `RequireSigilOnAllFiles`: make offense if the Sorbet typed is not found in the file (default: false)
2350
+ # * `SuggestedStrictness`: Sorbet strictness level suggested in offense messages (default: 'false')
2351
+ # * `MinimumStrictness`: If set, make offense if the strictness level in the file is below this one
2352
+ # * `ExactStrictness`: If set, make offense if the strictness level in the file is different than this one
2353
+ #
2354
+ # If an `ExactStrictness` level is specified, it will be used in offense messages and autocorrect.
2355
+ # If a `SuggestedStrictness` level is specified, it will be used in autocorrect.
2356
+ # Otherwise, if a `MinimumStrictness` level is specified, it will be used in offense messages and autocorrect.
2357
+ #
2358
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#21
2359
+ class RuboCop::Cop::Sorbet::ValidSigil < ::RuboCop::Cop::Base
2360
+ extend ::RuboCop::Cop::AutoCorrector
2361
+
2362
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#24
2363
+ def on_new_investigation; end
2364
+
2365
+ protected
2366
+
2367
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#169
2368
+ def autocorrect(corrector); end
2369
+
2370
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#110
2371
+ def check_double_commented_sigil(sigil, strictness); end
2372
+
2373
+ # checks
2374
+ #
2375
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#59
2376
+ def check_sigil_present(sigil); end
2377
+
2378
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#137
2379
+ def check_strictness_level(sigil, strictness); end
2380
+
2381
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#98
2382
+ def check_strictness_not_empty(sigil, strictness); end
2383
+
2384
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#125
2385
+ def check_strictness_valid(sigil, strictness); end
2386
+
2387
+ # Default is `nil`
2388
+ #
2389
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#203
2390
+ def exact_strictness; end
2391
+
2392
+ # extraction
2393
+ #
2394
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#47
2395
+ def extract_sigil(processed_source); end
2396
+
2397
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#53
2398
+ def extract_strictness(sigil); end
2399
+
2400
+ # Default is `nil`
2401
+ #
2402
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#197
2403
+ def minimum_strictness; end
2404
+
2405
+ # Default is `false`
2406
+ #
2407
+ # @return [Boolean]
2408
+ #
2409
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#186
2410
+ def require_sigil_on_all_files?; end
2411
+
2412
+ # Default is `'false'`
2413
+ #
2414
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#191
2415
+ def suggested_strictness; end
2416
+
2417
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#76
2418
+ def suggested_strictness_level; end
2419
+ end
2420
+
2421
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#43
2422
+ RuboCop::Cop::Sorbet::ValidSigil::INVALID_SIGIL_MSG = T.let(T.unsafe(nil), String)
2423
+
2424
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#42
2425
+ RuboCop::Cop::Sorbet::ValidSigil::SIGIL_REGEX = T.let(T.unsafe(nil), Regexp)
2426
+
2427
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#41
2428
+ RuboCop::Cop::Sorbet::ValidSigil::STRICTNESS_LEVELS = T.let(T.unsafe(nil), Array)
2429
+
2430
+ # Disallows the usage of `.void.checked(:tests)`.
2431
+ #
2432
+ # Using `.void` changes the value returned from the method, but only if
2433
+ # runtime type checking is enabled for the method. Methods marked `.void`
2434
+ # will return different values in tests compared with non-test
2435
+ # environments. This is particularly troublesome if branching on the
2436
+ # result of a `.void` method, because the returned value in test code
2437
+ # will be the truthy `VOID` value, while the non-test return value may be
2438
+ # falsy depending on the method's implementation.
2439
+ #
2440
+ # - Use `.returns(T.anything).checked(:tests)` to keep the runtime type
2441
+ # checking for the rest of the parameters.
2442
+ # - Use `.void.checked(:never)` if you are on an older version of Sorbet
2443
+ # which does not have `T.anything` (meaning versions 0.5.10781 or
2444
+ # earlier. Versions released after 2023-04-14 include `T.anything`.)
2445
+ #
2446
+ # @example
2447
+ #
2448
+ # # bad
2449
+ # sig { void.checked(:tests) }
2450
+ #
2451
+ # # good
2452
+ # sig { void }
2453
+ # sig { returns(T.anything).checked(:tests) }
2454
+ # sig { void.checked(:never) }
2455
+ #
2456
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/void_checked_tests.rb#31
2457
+ class RuboCop::Cop::Sorbet::VoidCheckedTests < ::RuboCop::Cop::Base
2458
+ include ::RuboCop::Cop::RangeHelp
2459
+ include ::RuboCop::Cop::Sorbet::SignatureHelp
2460
+ extend ::RuboCop::Cop::AutoCorrector
2461
+
2462
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/void_checked_tests.rb#37
2463
+ def checked_tests(param0); end
2464
+
2465
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/void_checked_tests.rb#58
2466
+ def on_signature(node); end
2467
+
2468
+ private
2469
+
2470
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/void_checked_tests.rb#48
2471
+ def top_level_void(node); end
2472
+ end
2473
+
2474
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/void_checked_tests.rb#41
2475
+ RuboCop::Cop::Sorbet::VoidCheckedTests::MESSAGE = T.let(T.unsafe(nil), String)
2476
+
2477
+ module RuboCop::Cop::Style; end
2478
+
2479
+ class RuboCop::Cop::Style::MutableConstant < ::RuboCop::Cop::Base
2480
+ include ::RuboCop::Cop::Sorbet::MutableConstantSorbetAwareBehaviour
2481
+ end
2482
+
2483
+ # source://rubocop-sorbet//lib/rubocop/sorbet/version.rb#4
2484
+ module RuboCop::Sorbet; end
2485
+
2486
+ # source://rubocop-sorbet//lib/rubocop/sorbet.rb#11
2487
+ class RuboCop::Sorbet::Error < ::StandardError; end
2488
+
2489
+ # A plugin that integrates RuboCop Sorbet with RuboCop's plugin system.
2490
+ #
2491
+ # source://rubocop-sorbet//lib/rubocop/sorbet/plugin.rb#10
2492
+ class RuboCop::Sorbet::Plugin < ::LintRoller::Plugin
2493
+ # source://rubocop-sorbet//lib/rubocop/sorbet/plugin.rb#11
2494
+ def about; end
2495
+
2496
+ # source://rubocop-sorbet//lib/rubocop/sorbet/plugin.rb#24
2497
+ def rules(_context); end
2498
+
2499
+ # @return [Boolean]
2500
+ #
2501
+ # source://rubocop-sorbet//lib/rubocop/sorbet/plugin.rb#20
2502
+ def supported?(context); end
2503
+ end
2504
+
2505
+ # source://rubocop-sorbet//lib/rubocop/sorbet/version.rb#5
2506
+ RuboCop::Sorbet::VERSION = T.let(T.unsafe(nil), String)