ruby-lsp-i18n 0.3.0

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 (68) hide show
  1. checksums.yaml +7 -0
  2. data/.rubocop.yml +13 -0
  3. data/.ruby-version +1 -0
  4. data/.vscode/settings.json +12 -0
  5. data/CHANGELOG.md +36 -0
  6. data/CODE_OF_CONDUCT.md +84 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +73 -0
  9. data/Rakefile +16 -0
  10. data/es.yml +4 -0
  11. data/example/app/example.rb +14 -0
  12. data/example/config/locales/a/es.yml +4 -0
  13. data/example/config/locales/es.yml +6 -0
  14. data/lib/ruby_lsp/ruby_lsp_i18n/addon.rb +138 -0
  15. data/lib/ruby_lsp/ruby_lsp_i18n/i18n_index.rb +130 -0
  16. data/lib/ruby_lsp/ruby_lsp_i18n/listeners/completion.rb +65 -0
  17. data/lib/ruby_lsp/ruby_lsp_i18n/listeners/inlay_hints.rb +118 -0
  18. data/lib/ruby_lsp/ruby_lsp_i18n/prefix_tree.rb +158 -0
  19. data/lib/ruby_lsp/ruby_lsp_i18n/requests/inlay_hints.rb +36 -0
  20. data/lib/ruby_lsp_i18n/version.rb +7 -0
  21. data/lib/ruby_lsp_i18n.rb +9 -0
  22. data/media/demo.gif +0 -0
  23. data/ruby-lsp-i18n.gemspec +35 -0
  24. data/sorbet/config +4 -0
  25. data/sorbet/rbi/annotations/.gitattributes +1 -0
  26. data/sorbet/rbi/annotations/minitest.rbi +119 -0
  27. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  28. data/sorbet/rbi/dsl/.gitattributes +1 -0
  29. data/sorbet/rbi/gems/.gitattributes +1 -0
  30. data/sorbet/rbi/gems/ast@2.4.2.rbi +585 -0
  31. data/sorbet/rbi/gems/bump@0.10.0.rbi +9 -0
  32. data/sorbet/rbi/gems/concurrent-ruby@1.3.4.rbi +406 -0
  33. data/sorbet/rbi/gems/erubi@1.13.0.rbi +150 -0
  34. data/sorbet/rbi/gems/i18n@1.14.5.rbi +2208 -0
  35. data/sorbet/rbi/gems/json@2.7.2.rbi +1562 -0
  36. data/sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi +14238 -0
  37. data/sorbet/rbi/gems/logger@1.7.0.rbi +963 -0
  38. data/sorbet/rbi/gems/minitest@5.25.1.rbi +1546 -0
  39. data/sorbet/rbi/gems/netrc@0.11.0.rbi +159 -0
  40. data/sorbet/rbi/gems/parallel@1.26.3.rbi +291 -0
  41. data/sorbet/rbi/gems/parser@3.3.4.2.rbi +5519 -0
  42. data/sorbet/rbi/gems/prism@1.2.0.rbi +39085 -0
  43. data/sorbet/rbi/gems/racc@1.8.1.rbi +162 -0
  44. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +403 -0
  45. data/sorbet/rbi/gems/rake@13.2.1.rbi +3028 -0
  46. data/sorbet/rbi/gems/rbi@0.2.0.rbi +9 -0
  47. data/sorbet/rbi/gems/rbs@3.9.4.rbi +6976 -0
  48. data/sorbet/rbi/gems/regexp_parser@2.9.2.rbi +3772 -0
  49. data/sorbet/rbi/gems/rexml@3.3.6.rbi +4813 -0
  50. data/sorbet/rbi/gems/rubocop-ast@1.32.1.rbi +7079 -0
  51. data/sorbet/rbi/gems/rubocop-minitest@0.35.1.rbi +2613 -0
  52. data/sorbet/rbi/gems/rubocop-rake@0.6.0.rbi +329 -0
  53. data/sorbet/rbi/gems/rubocop-shopify@2.15.1.rbi +9 -0
  54. data/sorbet/rbi/gems/rubocop-sorbet@0.8.5.rbi +1665 -0
  55. data/sorbet/rbi/gems/rubocop@1.65.1.rbi +58100 -0
  56. data/sorbet/rbi/gems/ruby-lsp@0.24.1.rbi +7508 -0
  57. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1318 -0
  58. data/sorbet/rbi/gems/spoom@1.4.2.rbi +4932 -0
  59. data/sorbet/rbi/gems/strscan@3.1.0.rbi +9 -0
  60. data/sorbet/rbi/gems/tapioca@0.16.2.rbi +16 -0
  61. data/sorbet/rbi/gems/thor@1.3.2.rbi +4378 -0
  62. data/sorbet/rbi/gems/unicode-display_width@2.5.0.rbi +66 -0
  63. data/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi +435 -0
  64. data/sorbet/rbi/gems/yard@0.9.36.rbi +18221 -0
  65. data/sorbet/rbi/shims/gems/fast_trie@0.5.1.rbi +18 -0
  66. data/sorbet/tapioca/config.yml +13 -0
  67. data/sorbet/tapioca/require.rb +6 -0
  68. metadata +113 -0
@@ -0,0 +1,1665 @@
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
+ # Checks for the a mistaken variant of the "obsolete memoization pattern" that used to be required
110
+ # on every call, causing the memoized value to be discarded and recomputed on every call.
111
+ #
112
+ # This cop will correct it to read from the ivar instead of `nil`, which will memoize it correctly.
113
+ #
114
+ # The result of this correction will be the "obsolete memoization pattern", which can further be corrected by
115
+ # the `Sorbet/ObsoleteStrictMemoization` cop.
116
+ #
117
+ # See `Sorbet/ObsoleteStrictMemoization` for more details.
118
+ #
119
+ # @example
120
+ # # bad
121
+ # sig { returns(Foo) }
122
+ # def foo
123
+ # # This `nil` is likely a mistake, causing the memoized value to be discarded and recomputed on every call.
124
+ # @foo = T.let(nil, T.nilable(Foo))
125
+ # @foo ||= some_computation
126
+ # end
127
+ #
128
+ # # good
129
+ # sig { returns(Foo) }
130
+ # def foo
131
+ # # This will now memoize the value as was likely intended, so `some_computation` is only ever called once.
132
+ # # ⚠️If `some_computation` has side effects, this might be a breaking change!
133
+ # @foo = T.let(@foo, T.nilable(Foo))
134
+ # @foo ||= some_computation
135
+ # end
136
+ # @see Sorbet/ObsoleteStrictMemoization
137
+ #
138
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/buggy_obsolete_strict_memoization.rb#42
139
+ class RuboCop::Cop::Sorbet::BuggyObsoleteStrictMemoization < ::RuboCop::Cop::Base
140
+ include ::RuboCop::Cop::RangeHelp
141
+ include ::RuboCop::Cop::MatchRange
142
+ include ::RuboCop::Cop::Alignment
143
+ include ::RuboCop::Cop::LineLengthHelp
144
+ include ::RuboCop::Cop::Sorbet::TargetSorbetVersion
145
+ extend ::RuboCop::Cop::AutoCorrector
146
+ extend ::RuboCop::Cop::Sorbet::TargetSorbetVersion::ClassMethods
147
+
148
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/buggy_obsolete_strict_memoization.rb#55
149
+ def buggy_legacy_memoization_pattern?(param0 = T.unsafe(nil)); end
150
+
151
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/buggy_obsolete_strict_memoization.rb#66
152
+ def on_begin(node); end
153
+
154
+ # @return [Boolean]
155
+ #
156
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/buggy_obsolete_strict_memoization.rb#77
157
+ def relevant_file?(file); end
158
+ end
159
+
160
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/buggy_obsolete_strict_memoization.rb#51
161
+ RuboCop::Cop::Sorbet::BuggyObsoleteStrictMemoization::MSG = T.let(T.unsafe(nil), String)
162
+
163
+ # Ensures that callback conditionals are bound to the right type
164
+ # so that they are type checked properly.
165
+ #
166
+ # Auto-correction is unsafe because other libraries define similar style callbacks as Rails, but don't always need
167
+ # binding to the attached class. Auto-correcting those usages can lead to false positives and auto-correction
168
+ # introduces new typing errors.
169
+ #
170
+ # @example
171
+ #
172
+ # # bad
173
+ # class Post < ApplicationRecord
174
+ # before_create :do_it, if: -> { should_do_it? }
175
+ #
176
+ # def should_do_it?
177
+ # true
178
+ # end
179
+ # end
180
+ #
181
+ # # good
182
+ # class Post < ApplicationRecord
183
+ # before_create :do_it, if: -> {
184
+ # T.bind(self, Post)
185
+ # should_do_it?
186
+ # }
187
+ #
188
+ # def should_do_it?
189
+ # true
190
+ # end
191
+ # end
192
+ #
193
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#35
194
+ class RuboCop::Cop::Sorbet::CallbackConditionalsBinding < ::RuboCop::Cop::Base
195
+ include ::RuboCop::Cop::Alignment
196
+ extend ::RuboCop::Cop::AutoCorrector
197
+
198
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#81
199
+ def argumentless_unbound_callable_callback_conditional?(param0 = T.unsafe(nil)); end
200
+
201
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#91
202
+ def on_send(node); end
203
+
204
+ private
205
+
206
+ # Find the immediately enclosing class or module name.
207
+ # Returns `nil`` if the immediate parent (skipping begin if present) is not a class or module.
208
+ #
209
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#128
210
+ def immediately_enclosing_module_name(node); end
211
+ end
212
+
213
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#39
214
+ RuboCop::Cop::Sorbet::CallbackConditionalsBinding::MSG = T.let(T.unsafe(nil), String)
215
+
216
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#41
217
+ RuboCop::Cop::Sorbet::CallbackConditionalsBinding::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
218
+
219
+ # Disallows the usage of `checked(true)`. This usage could cause
220
+ # confusion; it could lead some people to believe that a method would be checked
221
+ # even if runtime checks have not been enabled on the class or globally.
222
+ # Additionally, in the event where checks are enabled, `checked(true)` would
223
+ # be redundant; only `checked(false)` or `soft` would change the behaviour.
224
+ #
225
+ # @example
226
+ #
227
+ # # bad
228
+ # sig { void.checked(true) }
229
+ #
230
+ # # good
231
+ # sig { void }
232
+ #
233
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb#19
234
+ class RuboCop::Cop::Sorbet::CheckedTrueInSignature < ::RuboCop::Cop::Base
235
+ include ::RuboCop::Cop::RangeHelp
236
+ include ::RuboCop::Cop::Sorbet::SignatureHelp
237
+
238
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb#24
239
+ def offending_node(param0); end
240
+
241
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb#35
242
+ def on_signature(node); end
243
+ end
244
+
245
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb#28
246
+ RuboCop::Cop::Sorbet::CheckedTrueInSignature::MESSAGE = T.let(T.unsafe(nil), String)
247
+
248
+ # Disallows the calls that are used to get constants fom Strings
249
+ # such as +constantize+, +const_get+, and +constants+.
250
+ #
251
+ # The goal of this cop is to make the code easier to statically analyze,
252
+ # more IDE-friendly, and more predictable. It leads to code that clearly
253
+ # expresses which values the constant can have.
254
+ #
255
+ # @example
256
+ #
257
+ # # bad
258
+ # class_name.constantize
259
+ #
260
+ # # bad
261
+ # constants.detect { |c| c.name == "User" }
262
+ #
263
+ # # bad
264
+ # const_get(class_name)
265
+ #
266
+ # # good
267
+ # case class_name
268
+ # when "User"
269
+ # User
270
+ # else
271
+ # raise ArgumentError
272
+ # end
273
+ #
274
+ # # good
275
+ # { "User" => User }.fetch(class_name)
276
+ #
277
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/constants_from_strings.rb#36
278
+ class RuboCop::Cop::Sorbet::ConstantsFromStrings < ::RuboCop::Cop::Base
279
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/constants_from_strings.rb#46
280
+ def on_send(node); end
281
+ end
282
+
283
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/constants_from_strings.rb#37
284
+ RuboCop::Cop::Sorbet::ConstantsFromStrings::MSG = T.let(T.unsafe(nil), String)
285
+
286
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/constants_from_strings.rb#40
287
+ RuboCop::Cop::Sorbet::ConstantsFromStrings::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
288
+
289
+ # Checks for blank lines after signatures.
290
+ #
291
+ # @example
292
+ # # bad
293
+ # sig { void }
294
+ #
295
+ # def foo; end
296
+ #
297
+ # # good
298
+ # sig { void }
299
+ # def foo; end
300
+ #
301
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb#17
302
+ class RuboCop::Cop::Sorbet::EmptyLineAfterSig < ::RuboCop::Cop::Base
303
+ include ::RuboCop::Cop::RangeHelp
304
+ include ::RuboCop::Cop::Sorbet::SignatureHelp
305
+ extend ::RuboCop::Cop::AutoCorrector
306
+
307
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb#34
308
+ def on_signature(sig); end
309
+
310
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb#25
311
+ def sig_or_signable_method_definition?(param0 = T.unsafe(nil)); end
312
+
313
+ private
314
+
315
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb#57
316
+ def lines_between(node1, node2, buffer: T.unsafe(nil)); end
317
+
318
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb#53
319
+ def next_sibling(node); end
320
+ end
321
+
322
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb#22
323
+ RuboCop::Cop::Sorbet::EmptyLineAfterSig::MSG = T.let(T.unsafe(nil), String)
324
+
325
+ # Checks that the Sorbet sigil comes as the first magic comment in the file, after the encoding comment if any.
326
+ #
327
+ # The expected order for magic comments is: (en)?coding, typed, warn_indent then frozen_string_literal.
328
+ #
329
+ # The ordering is for consistency only, except for the encoding comment which must be first, if present.
330
+ #
331
+ # For example, the following bad ordering:
332
+ #
333
+ # ```ruby
334
+ # class Foo; end
335
+ # ```
336
+ #
337
+ # Will be corrected as:
338
+ #
339
+ # ```ruby
340
+ # class Foo; end
341
+ # ```
342
+ #
343
+ # Only `(en)?coding`, `typed`, `warn_indent` and `frozen_string_literal` magic comments are considered,
344
+ # other comments or magic comments are left in the same place.
345
+ #
346
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#32
347
+ class RuboCop::Cop::Sorbet::EnforceSigilOrder < ::RuboCop::Cop::Sorbet::ValidSigil
348
+ include ::RuboCop::Cop::RangeHelp
349
+
350
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#35
351
+ def on_new_investigation; end
352
+
353
+ protected
354
+
355
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#93
356
+ def autocorrect(corrector); end
357
+
358
+ # checks
359
+ #
360
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#70
361
+ def check_magic_comments_order(tokens); end
362
+
363
+ # Get all the tokens in `processed_source` that match `MAGIC_REGEX`
364
+ #
365
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#62
366
+ def extract_magic_comments(processed_source); end
367
+ end
368
+
369
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#46
370
+ RuboCop::Cop::Sorbet::EnforceSigilOrder::CODING_REGEX = T.let(T.unsafe(nil), Regexp)
371
+
372
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#48
373
+ RuboCop::Cop::Sorbet::EnforceSigilOrder::FROZEN_REGEX = T.let(T.unsafe(nil), Regexp)
374
+
375
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#47
376
+ RuboCop::Cop::Sorbet::EnforceSigilOrder::INDENT_REGEX = T.let(T.unsafe(nil), Regexp)
377
+
378
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#57
379
+ RuboCop::Cop::Sorbet::EnforceSigilOrder::MAGIC_REGEX = T.let(T.unsafe(nil), Regexp)
380
+
381
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#50
382
+ RuboCop::Cop::Sorbet::EnforceSigilOrder::PREFERRED_ORDER = T.let(T.unsafe(nil), Hash)
383
+
384
+ # Checks that every method definition and attribute accessor has a Sorbet signature.
385
+ #
386
+ # It also suggest an autocorrect with placeholders so the following code:
387
+ #
388
+ # ```
389
+ # def foo(a, b, c); end
390
+ # ```
391
+ #
392
+ # Will be corrected as:
393
+ #
394
+ # ```
395
+ # sig { params(a: T.untyped, b: T.untyped, c: T.untyped).returns(T.untyped)
396
+ # def foo(a, b, c); end
397
+ # ```
398
+ #
399
+ # You can configure the placeholders used by changing the following options:
400
+ #
401
+ # * `ParameterTypePlaceholder`: placeholders used for parameter types (default: 'T.untyped')
402
+ # * `ReturnTypePlaceholder`: placeholders used for return types (default: 'T.untyped')
403
+ #
404
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#27
405
+ class RuboCop::Cop::Sorbet::EnforceSignatures < ::RuboCop::Cop::Base
406
+ include ::RuboCop::Cop::Sorbet::SignatureHelp
407
+ extend ::RuboCop::Cop::AutoCorrector
408
+
409
+ # @return [EnforceSignatures] a new instance of EnforceSignatures
410
+ #
411
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#31
412
+ def initialize(config = T.unsafe(nil), options = T.unsafe(nil)); end
413
+
414
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#37
415
+ def accessor?(param0 = T.unsafe(nil)); end
416
+
417
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#41
418
+ def on_def(node); end
419
+
420
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#45
421
+ def on_defs(node); end
422
+
423
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#49
424
+ def on_send(node); end
425
+
426
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#53
427
+ def on_signature(node); end
428
+
429
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#57
430
+ def scope(node); end
431
+
432
+ private
433
+
434
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#79
435
+ def autocorrect(corrector, node); end
436
+
437
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#66
438
+ def check_node(node); end
439
+
440
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#96
441
+ def param_type_placeholder; end
442
+
443
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#100
444
+ def return_type_placeholder; end
445
+ end
446
+
447
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#104
448
+ class RuboCop::Cop::Sorbet::EnforceSignatures::SigSuggestion
449
+ # @return [SigSuggestion] a new instance of SigSuggestion
450
+ #
451
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#107
452
+ def initialize(indent, param_placeholder, return_placeholder); end
453
+
454
+ # Returns the value of attribute params.
455
+ #
456
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#105
457
+ def params; end
458
+
459
+ # Sets the attribute params
460
+ #
461
+ # @param value the value to set the attribute params to.
462
+ #
463
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#105
464
+ def params=(_arg0); end
465
+
466
+ # Returns the value of attribute returns.
467
+ #
468
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#105
469
+ def returns; end
470
+
471
+ # Sets the attribute returns
472
+ #
473
+ # @param value the value to set the attribute returns to.
474
+ #
475
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#105
476
+ def returns=(_arg0); end
477
+
478
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#115
479
+ def to_autocorrect; end
480
+
481
+ private
482
+
483
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#127
484
+ def generate_params; end
485
+
486
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#139
487
+ def generate_return; end
488
+ end
489
+
490
+ # Checks that there is only one Sorbet sigil in a given file
491
+ #
492
+ # For example, the following class with two sigils
493
+ #
494
+ # ```ruby
495
+ # class Foo; end
496
+ # ```
497
+ #
498
+ # Will be corrected as:
499
+ #
500
+ # ```ruby
501
+ # class Foo; end
502
+ # ```
503
+ #
504
+ # Other comments or magic comments are left in place.
505
+ #
506
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb#26
507
+ class RuboCop::Cop::Sorbet::EnforceSingleSigil < ::RuboCop::Cop::Sorbet::ValidSigil
508
+ include ::RuboCop::Cop::RangeHelp
509
+
510
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb#29
511
+ def on_new_investigation; end
512
+
513
+ protected
514
+
515
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb#50
516
+ def autocorrect(corrector); end
517
+
518
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb#44
519
+ def extract_all_sigils(processed_source); end
520
+ end
521
+
522
+ # Makes the Sorbet `false` sigil mandatory in all files.
523
+ #
524
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/false_sigil.rb#10
525
+ class RuboCop::Cop::Sorbet::FalseSigil < ::RuboCop::Cop::Sorbet::HasSigil
526
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/false_sigil.rb#11
527
+ def minimum_strictness; end
528
+ end
529
+
530
+ # Disallow including the `Comparable` module in `T::Enum`.
531
+ #
532
+ # @example
533
+ #
534
+ # # bad
535
+ # class Priority < T::Enum
536
+ # include Comparable
537
+ #
538
+ # enums do
539
+ # High = new(3)
540
+ # Medium = new(2)
541
+ # Low = new(1)
542
+ # end
543
+ #
544
+ # def <=>(other)
545
+ # serialize <=> other.serialize
546
+ # end
547
+ # end
548
+ #
549
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/t_enum/forbid_comparable_t_enum.rb#24
550
+ class RuboCop::Cop::Sorbet::ForbidComparableTEnum < ::RuboCop::Cop::Base
551
+ include ::RuboCop::Cop::Sorbet::TEnum
552
+
553
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/t_enum/forbid_comparable_t_enum.rb#32
554
+ def mix_in_comparable?(param0 = T.unsafe(nil)); end
555
+
556
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/t_enum/forbid_comparable_t_enum.rb#36
557
+ def on_send(node); end
558
+ end
559
+
560
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/t_enum/forbid_comparable_t_enum.rb#27
561
+ RuboCop::Cop::Sorbet::ForbidComparableTEnum::MSG = T.let(T.unsafe(nil), String)
562
+
563
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/t_enum/forbid_comparable_t_enum.rb#29
564
+ RuboCop::Cop::Sorbet::ForbidComparableTEnum::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
565
+
566
+ # Ensures RBI shims do not include a call to extend T::Sig
567
+ # or to extend T::Helpers
568
+ #
569
+ # @example
570
+ #
571
+ # # bad
572
+ # module SomeModule
573
+ # extend T::Sig
574
+ # extend T::Helpers
575
+ #
576
+ # sig { returns(String) }
577
+ # def foo; end
578
+ # end
579
+ #
580
+ # # good
581
+ # module SomeModule
582
+ # sig { returns(String) }
583
+ # def foo; end
584
+ # end
585
+ #
586
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb#25
587
+ class RuboCop::Cop::Sorbet::ForbidExtendTSigHelpersInShims < ::RuboCop::Cop::Base
588
+ include ::RuboCop::Cop::RangeHelp
589
+ extend ::RuboCop::Cop::AutoCorrector
590
+
591
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb#33
592
+ def extend_t_sig_or_helpers?(param0 = T.unsafe(nil)); end
593
+
594
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb#37
595
+ def on_send(node); end
596
+ end
597
+
598
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb#29
599
+ RuboCop::Cop::Sorbet::ForbidExtendTSigHelpersInShims::MSG = T.let(T.unsafe(nil), String)
600
+
601
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb#30
602
+ RuboCop::Cop::Sorbet::ForbidExtendTSigHelpersInShims::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
603
+
604
+ # Correct `send` expressions in include statements by constant literals.
605
+ #
606
+ # Sorbet, the static checker, is not (yet) able to support constructs on the
607
+ # following form:
608
+ #
609
+ # ```ruby
610
+ # class MyClass
611
+ # include send_expr
612
+ # end
613
+ # ```
614
+ #
615
+ # Multiple occurences of this can be found in Shopify's code base like:
616
+ #
617
+ # ```ruby
618
+ # include Rails.application.routes.url_helpers
619
+ # ```
620
+ # or
621
+ # ```ruby
622
+ # include Polaris::Engine.helpers
623
+ # ```
624
+ #
625
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#29
626
+ class RuboCop::Cop::Sorbet::ForbidIncludeConstLiteral < ::RuboCop::Cop::Base
627
+ extend ::RuboCop::Cop::AutoCorrector
628
+
629
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#36
630
+ def dynamic_inclusion?(param0 = T.unsafe(nil)); end
631
+
632
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#40
633
+ def on_send(node); end
634
+
635
+ private
636
+
637
+ # @return [Boolean]
638
+ #
639
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#52
640
+ def neither_const_nor_self?(node); end
641
+
642
+ # Returns true if the node is within a module declaration that is not anonymous.
643
+ #
644
+ # @return [Boolean]
645
+ #
646
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#57
647
+ def within_onymous_module?(node); end
648
+ end
649
+
650
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#32
651
+ RuboCop::Cop::Sorbet::ForbidIncludeConstLiteral::MSG = T.let(T.unsafe(nil), String)
652
+
653
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#33
654
+ RuboCop::Cop::Sorbet::ForbidIncludeConstLiteral::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
655
+
656
+ # Makes sure that RBI files are always located under the defined allowed paths.
657
+ #
658
+ # Options:
659
+ #
660
+ # * `AllowedPaths`: A list of the paths where RBI files are allowed (default: ["rbi/**", "sorbet/rbi/**"])
661
+ #
662
+ # @example
663
+ # # bad
664
+ # # lib/some_file.rbi
665
+ # # other_file.rbi
666
+ #
667
+ # # good
668
+ # # rbi/external_interface.rbi
669
+ # # sorbet/rbi/some_file.rbi
670
+ # # sorbet/rbi/any/path/for/file.rbi
671
+ #
672
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi/forbid_rbi_outside_of_allowed_paths.rb#23
673
+ class RuboCop::Cop::Sorbet::ForbidRBIOutsideOfAllowedPaths < ::RuboCop::Cop::Base
674
+ include ::RuboCop::Cop::RangeHelp
675
+
676
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi/forbid_rbi_outside_of_allowed_paths.rb#26
677
+ def on_new_investigation; end
678
+
679
+ private
680
+
681
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi/forbid_rbi_outside_of_allowed_paths.rb#55
682
+ def allowed_paths; end
683
+ end
684
+
685
+ # Correct superclass `send` expressions by constant literals.
686
+ #
687
+ # Sorbet, the static checker, is not (yet) able to support constructs on the
688
+ # following form:
689
+ #
690
+ # ```ruby
691
+ # class Foo < send_expr; end
692
+ # ```
693
+ #
694
+ # Multiple occurences of this can be found in Shopify's code base like:
695
+ #
696
+ # ```ruby
697
+ # class ShopScope < Component::TrustedIdScope[ShopIdentity::ShopId]
698
+ # ```
699
+ # or
700
+ # ```ruby
701
+ # class ApiClientEligibility < Struct.new(:api_client, :match_results, :shop)
702
+ # ```
703
+ #
704
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_superclass_const_literal.rb#28
705
+ class RuboCop::Cop::Sorbet::ForbidSuperclassConstLiteral < ::RuboCop::Cop::Base
706
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_superclass_const_literal.rb#32
707
+ def dynamic_superclass?(param0 = T.unsafe(nil)); end
708
+
709
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_superclass_const_literal.rb#36
710
+ def on_class(node); end
711
+ end
712
+
713
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_superclass_const_literal.rb#29
714
+ RuboCop::Cop::Sorbet::ForbidSuperclassConstLiteral::MSG = T.let(T.unsafe(nil), String)
715
+
716
+ # Disallow using `T::Struct` and `T::Props`.
717
+ #
718
+ # @example
719
+ #
720
+ # # bad
721
+ # class MyStruct < T::Struct
722
+ # const :foo, String
723
+ # prop :bar, Integer, default: 0
724
+ #
725
+ # def some_method; end
726
+ # end
727
+ #
728
+ # # good
729
+ # class MyStruct
730
+ # extend T::Sig
731
+ #
732
+ # sig { returns(String) }
733
+ # attr_reader :foo
734
+ #
735
+ # sig { returns(Integer) }
736
+ # attr_accessor :bar
737
+ #
738
+ # sig { params(foo: String, bar: Integer) }
739
+ # def initialize(foo:, bar: 0)
740
+ # @foo = foo
741
+ # @bar = bar
742
+ # end
743
+ #
744
+ # def some_method; end
745
+ # end
746
+ #
747
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_struct.rb#38
748
+ class RuboCop::Cop::Sorbet::ForbidTStruct < ::RuboCop::Cop::Base
749
+ include ::RuboCop::Cop::Alignment
750
+ include ::RuboCop::Cop::RangeHelp
751
+ include ::RuboCop::Cop::CommentsHelp
752
+ extend ::RuboCop::Cop::AutoCorrector
753
+
754
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_struct.rb#169
755
+ def on_class(node); end
756
+
757
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_struct.rb#210
758
+ def on_send(node); end
759
+
760
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_struct.rb#167
761
+ def t_props?(param0 = T.unsafe(nil)); end
762
+
763
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_struct.rb#162
764
+ def t_struct?(param0 = T.unsafe(nil)); end
765
+
766
+ private
767
+
768
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_struct.rb#218
769
+ def initialize_method(indent, props); end
770
+
771
+ # @return [Boolean]
772
+ #
773
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_struct.rb#258
774
+ def previous_line_blank?(node); end
775
+ end
776
+
777
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_struct.rb#47
778
+ RuboCop::Cop::Sorbet::ForbidTStruct::MSG_PROPS = T.let(T.unsafe(nil), String)
779
+
780
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_struct.rb#46
781
+ RuboCop::Cop::Sorbet::ForbidTStruct::MSG_STRUCT = T.let(T.unsafe(nil), String)
782
+
783
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_struct.rb#104
784
+ class RuboCop::Cop::Sorbet::ForbidTStruct::Property
785
+ # @return [Property] a new instance of Property
786
+ #
787
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_struct.rb#107
788
+ def initialize(node, kind, name, type, default:, factory:); end
789
+
790
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_struct.rb#123
791
+ def attr_accessor; end
792
+
793
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_struct.rb#119
794
+ def attr_sig; end
795
+
796
+ # Returns the value of attribute default.
797
+ #
798
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_struct.rb#105
799
+ def default; end
800
+
801
+ # Returns the value of attribute factory.
802
+ #
803
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_struct.rb#105
804
+ def factory; end
805
+
806
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_struct.rb#144
807
+ def initialize_assign; end
808
+
809
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_struct.rb#131
810
+ def initialize_param; end
811
+
812
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_struct.rb#127
813
+ def initialize_sig_param; end
814
+
815
+ # Returns the value of attribute kind.
816
+ #
817
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_struct.rb#105
818
+ def kind; end
819
+
820
+ # Returns the value of attribute name.
821
+ #
822
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_struct.rb#105
823
+ def name; end
824
+
825
+ # @return [Boolean]
826
+ #
827
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_struct.rb#151
828
+ def nilable?; end
829
+
830
+ # Returns the value of attribute node.
831
+ #
832
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_struct.rb#105
833
+ def node; end
834
+
835
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_struct.rb#155
836
+ def type; end
837
+ end
838
+
839
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_struct.rb#44
840
+ RuboCop::Cop::Sorbet::ForbidTStruct::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
841
+
842
+ # This class walks down the class body of a T::Struct and collects all the properties that will need to be
843
+ # translated into `attr_reader` and `attr_accessor` methods.
844
+ #
845
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_struct.rb#51
846
+ class RuboCop::Cop::Sorbet::ForbidTStruct::TStructWalker
847
+ include ::RuboCop::AST::Traversal
848
+ extend ::RuboCop::AST::NodePattern::Macros
849
+
850
+ # @return [TStructWalker] a new instance of TStructWalker
851
+ #
852
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_struct.rb#57
853
+ def initialize; end
854
+
855
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_struct.rb#63
856
+ def extend_t_sig?(param0 = T.unsafe(nil)); end
857
+
858
+ # Returns the value of attribute has_extend_t_sig.
859
+ #
860
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_struct.rb#55
861
+ def has_extend_t_sig; end
862
+
863
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_struct.rb#72
864
+ def on_send(node); end
865
+
866
+ # Returns the value of attribute props.
867
+ #
868
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_struct.rb#55
869
+ def props; end
870
+
871
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_struct.rb#68
872
+ def t_struct_prop?(param0 = T.unsafe(nil)); end
873
+ end
874
+
875
+ # Disallows using `T.unsafe` anywhere.
876
+ #
877
+ # @example
878
+ #
879
+ # # bad
880
+ # T.unsafe(foo)
881
+ #
882
+ # # good
883
+ # foo
884
+ #
885
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_unsafe.rb#17
886
+ class RuboCop::Cop::Sorbet::ForbidTUnsafe < ::RuboCop::Cop::Base
887
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_unsafe.rb#24
888
+ def on_send(node); end
889
+
890
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_unsafe.rb#22
891
+ def t_unsafe?(param0 = T.unsafe(nil)); end
892
+ end
893
+
894
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_unsafe.rb#18
895
+ RuboCop::Cop::Sorbet::ForbidTUnsafe::MSG = T.let(T.unsafe(nil), String)
896
+
897
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_unsafe.rb#19
898
+ RuboCop::Cop::Sorbet::ForbidTUnsafe::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
899
+
900
+ # Disallows using `T.untyped` anywhere.
901
+ #
902
+ # @example
903
+ #
904
+ # # bad
905
+ # sig { params(my_argument: T.untyped).void }
906
+ # def foo(my_argument); end
907
+ #
908
+ # # good
909
+ # sig { params(my_argument: String).void }
910
+ # def foo(my_argument); end
911
+ #
912
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_untyped.rb#20
913
+ class RuboCop::Cop::Sorbet::ForbidTUntyped < ::RuboCop::Cop::Base
914
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_untyped.rb#27
915
+ def on_send(node); end
916
+
917
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_untyped.rb#25
918
+ def t_untyped?(param0 = T.unsafe(nil)); end
919
+ end
920
+
921
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_untyped.rb#21
922
+ RuboCop::Cop::Sorbet::ForbidTUntyped::MSG = T.let(T.unsafe(nil), String)
923
+
924
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_t_untyped.rb#22
925
+ RuboCop::Cop::Sorbet::ForbidTUntyped::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
926
+
927
+ # Disallows defining type aliases that contain shapes
928
+ #
929
+ # @example
930
+ #
931
+ # # bad
932
+ # Foo = T.type_alias { { foo: Integer } }
933
+ #
934
+ # # good
935
+ # class Foo
936
+ # extend T::Sig
937
+ #
938
+ # sig { params(foo: Integer).void }
939
+ # def initialize(foo)
940
+ # @foo = foo
941
+ # end
942
+ # end
943
+ #
944
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_type_aliased_shapes.rb#24
945
+ class RuboCop::Cop::Sorbet::ForbidTypeAliasedShapes < ::RuboCop::Cop::Base
946
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_type_aliased_shapes.rb#36
947
+ def on_block(node); end
948
+
949
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_type_aliased_shapes.rb#36
950
+ def on_numblock(node); end
951
+
952
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_type_aliased_shapes.rb#28
953
+ def shape_type_alias?(param0 = T.unsafe(nil)); end
954
+ end
955
+
956
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_type_aliased_shapes.rb#25
957
+ RuboCop::Cop::Sorbet::ForbidTypeAliasedShapes::MSG = T.let(T.unsafe(nil), String)
958
+
959
+ # Disallows use of `T.untyped` or `T.nilable(T.untyped)`
960
+ # as a prop type for `T::Struct` or `T::ImmutableStruct`.
961
+ #
962
+ # @example
963
+ #
964
+ # # bad
965
+ # class SomeClass < T::Struct
966
+ # const :foo, T.untyped
967
+ # prop :bar, T.nilable(T.untyped)
968
+ # end
969
+ #
970
+ # # good
971
+ # class SomeClass < T::Struct
972
+ # const :foo, Integer
973
+ # prop :bar, T.nilable(String)
974
+ # end
975
+ #
976
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#25
977
+ class RuboCop::Cop::Sorbet::ForbidUntypedStructProps < ::RuboCop::Cop::Base
978
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#54
979
+ def on_class(node); end
980
+
981
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#44
982
+ def subclass_of_t_struct?(param0 = T.unsafe(nil)); end
983
+
984
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#39
985
+ def t_nilable_untyped(param0 = T.unsafe(nil)); end
986
+
987
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#29
988
+ def t_struct(param0 = T.unsafe(nil)); end
989
+
990
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#34
991
+ def t_untyped(param0 = T.unsafe(nil)); end
992
+
993
+ # Search for untyped prop/const declarations and capture their types
994
+ #
995
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#50
996
+ def untyped_props(param0); end
997
+ end
998
+
999
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#26
1000
+ RuboCop::Cop::Sorbet::ForbidUntypedStructProps::MSG = T.let(T.unsafe(nil), String)
1001
+
1002
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi_versioning/gem_version_annotation_helper.rb#6
1003
+ module RuboCop::Cop::Sorbet::GemVersionAnnotationHelper
1004
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi_versioning/gem_version_annotation_helper.rb#9
1005
+ def gem_version_annotations; end
1006
+
1007
+ private
1008
+
1009
+ # @return [Boolean]
1010
+ #
1011
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi_versioning/gem_version_annotation_helper.rb#17
1012
+ def gem_version_annotation?(comment); end
1013
+
1014
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi_versioning/gem_version_annotation_helper.rb#21
1015
+ def gem_versions(comment); end
1016
+ end
1017
+
1018
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi_versioning/gem_version_annotation_helper.rb#7
1019
+ RuboCop::Cop::Sorbet::GemVersionAnnotationHelper::VERSION_PREFIX = T.let(T.unsafe(nil), String)
1020
+
1021
+ # Makes the Sorbet typed sigil mandatory in all files.
1022
+ #
1023
+ # Options:
1024
+ #
1025
+ # * `SuggestedStrictness`: Sorbet strictness level suggested in offense messages (default: 'false')
1026
+ # * `MinimumStrictness`: If set, make offense if the strictness level in the file is below this one
1027
+ #
1028
+ # If a `MinimumStrictness` level is specified, it will be used in offense messages and autocorrect.
1029
+ #
1030
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/has_sigil.rb#17
1031
+ class RuboCop::Cop::Sorbet::HasSigil < ::RuboCop::Cop::Sorbet::ValidSigil
1032
+ # @return [Boolean]
1033
+ #
1034
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/has_sigil.rb#18
1035
+ def require_sigil_on_all_files?; end
1036
+ end
1037
+
1038
+ # Makes the Sorbet `ignore` sigil mandatory in all files.
1039
+ #
1040
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/ignore_sigil.rb#10
1041
+ class RuboCop::Cop::Sorbet::IgnoreSigil < ::RuboCop::Cop::Sorbet::HasSigil
1042
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/ignore_sigil.rb#11
1043
+ def minimum_strictness; end
1044
+ end
1045
+
1046
+ # Disallows declaring implicit conversion methods.
1047
+ # Since Sorbet is a nominal (not structural) type system,
1048
+ # implicit conversion is currently unsupported.
1049
+ #
1050
+ # @example
1051
+ #
1052
+ # # bad
1053
+ # def to_str; end
1054
+ #
1055
+ # # good
1056
+ # def to_str(x); end
1057
+ #
1058
+ # # bad
1059
+ # def self.to_str; end
1060
+ #
1061
+ # # good
1062
+ # def self.to_str(x); end
1063
+ #
1064
+ # # bad
1065
+ # alias to_str to_s
1066
+ # @note Since the arity of aliased methods is not checked, false positives may result.
1067
+ # @see https://docs.ruby-lang.org/en/master/implicit_conversion_rdoc.html
1068
+ #
1069
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/implicit_conversion_method.rb#31
1070
+ class RuboCop::Cop::Sorbet::ImplicitConversionMethod < ::RuboCop::Cop::Base
1071
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/implicit_conversion_method.rb#37
1072
+ def on_alias(node); end
1073
+
1074
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/implicit_conversion_method.rb#42
1075
+ def on_def(node); end
1076
+
1077
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/implicit_conversion_method.rb#42
1078
+ def on_defs(node); end
1079
+
1080
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/implicit_conversion_method.rb#50
1081
+ def on_send(node); end
1082
+ end
1083
+
1084
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/implicit_conversion_method.rb#32
1085
+ RuboCop::Cop::Sorbet::ImplicitConversionMethod::IMPLICIT_CONVERSION_METHODS = T.let(T.unsafe(nil), Array)
1086
+
1087
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/implicit_conversion_method.rb#33
1088
+ RuboCop::Cop::Sorbet::ImplicitConversionMethod::MSG = T.let(T.unsafe(nil), String)
1089
+
1090
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/implicit_conversion_method.rb#35
1091
+ RuboCop::Cop::Sorbet::ImplicitConversionMethod::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1092
+
1093
+ # Checks for the ordering of keyword arguments required by
1094
+ # sorbet-runtime. The ordering requires that all keyword arguments
1095
+ # are at the end of the parameters list, and all keyword arguments
1096
+ # with a default value must be after those without default values.
1097
+ #
1098
+ # @example
1099
+ #
1100
+ # # bad
1101
+ # sig { params(a: Integer, b: String).void }
1102
+ # def foo(a: 1, b:); end
1103
+ #
1104
+ # # good
1105
+ # sig { params(b: String, a: Integer).void }
1106
+ # def foo(b:, a: 1); end
1107
+ #
1108
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/keyword_argument_ordering.rb#20
1109
+ class RuboCop::Cop::Sorbet::KeywordArgumentOrdering < ::RuboCop::Cop::Base
1110
+ include ::RuboCop::Cop::Sorbet::SignatureHelp
1111
+
1112
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/keyword_argument_ordering.rb#23
1113
+ def on_signature(node); end
1114
+
1115
+ private
1116
+
1117
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/keyword_argument_ordering.rb#34
1118
+ def check_order_for_kwoptargs(parameters); end
1119
+ end
1120
+
1121
+ # Disallow creating a `T::Enum` with less than two values.
1122
+ #
1123
+ # @example
1124
+ #
1125
+ # # bad
1126
+ # class ErrorMessages < T::Enum
1127
+ # enums do
1128
+ # ServerError = new("There was a server error.")
1129
+ # end
1130
+ # end
1131
+ #
1132
+ # # good
1133
+ # class ErrorMessages < T::Enum
1134
+ # enums do
1135
+ # ServerError = new("There was a server error.")
1136
+ # NotFound = new("The resource was not found.")
1137
+ # end
1138
+ # end
1139
+ #
1140
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/t_enum/multiple_t_enum_values.rb#24
1141
+ class RuboCop::Cop::Sorbet::MultipleTEnumValues < ::RuboCop::Cop::Base
1142
+ include ::RuboCop::Cop::Sorbet::TEnum
1143
+
1144
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/t_enum/multiple_t_enum_values.rb#30
1145
+ def enums_block?(param0 = T.unsafe(nil)); end
1146
+
1147
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/t_enum/multiple_t_enum_values.rb#40
1148
+ def on_block(node); end
1149
+
1150
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/t_enum/multiple_t_enum_values.rb#34
1151
+ def on_class(node); end
1152
+ end
1153
+
1154
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/t_enum/multiple_t_enum_values.rb#27
1155
+ RuboCop::Cop::Sorbet::MultipleTEnumValues::MSG = T.let(T.unsafe(nil), String)
1156
+
1157
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#8
1158
+ module RuboCop::Cop::Sorbet::MutableConstantSorbetAwareBehaviour
1159
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#18
1160
+ def on_assignment(value); end
1161
+
1162
+ class << self
1163
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#10
1164
+ def prepended(base); end
1165
+ end
1166
+ end
1167
+
1168
+ # Checks for the obsolete pattern for initializing instance variables that was required for older Sorbet
1169
+ #
1170
+ # It's no longer required, as of Sorbet 0.5.10210
1171
+ # See https://sorbet.org/docs/type-assertions#put-type-assertions-behind-memoization
1172
+ #
1173
+ # @example
1174
+ #
1175
+ # # bad
1176
+ # sig { returns(Foo) }
1177
+ # def foo
1178
+ # @foo = T.let(@foo, T.nilable(Foo))
1179
+ # @foo ||= Foo.new
1180
+ # end
1181
+ #
1182
+ # # bad
1183
+ # sig { returns(Foo) }
1184
+ # def foo
1185
+ # # This would have been a mistake, causing the memoized value to be discarded and recomputed on every call.
1186
+ # @foo = T.let(nil, T.nilable(Foo))
1187
+ # @foo ||= Foo.new
1188
+ # end
1189
+ #
1190
+ # # good
1191
+ # sig { returns(Foo) }
1192
+ # def foo
1193
+ # @foo ||= T.let(Foo.new, T.nilable(Foo))
1194
+ # end
1195
+ #
1196
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/obsolete_strict_memoization.rb#37
1197
+ class RuboCop::Cop::Sorbet::ObsoleteStrictMemoization < ::RuboCop::Cop::Base
1198
+ include ::RuboCop::Cop::RangeHelp
1199
+ include ::RuboCop::Cop::MatchRange
1200
+ include ::RuboCop::Cop::Alignment
1201
+ include ::RuboCop::Cop::LineLengthHelp
1202
+ include ::RuboCop::Cop::Sorbet::TargetSorbetVersion
1203
+ extend ::RuboCop::Cop::AutoCorrector
1204
+ extend ::RuboCop::Cop::Sorbet::TargetSorbetVersion::ClassMethods
1205
+
1206
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/obsolete_strict_memoization.rb#51
1207
+ def legacy_memoization_pattern?(param0 = T.unsafe(nil)); end
1208
+
1209
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/obsolete_strict_memoization.rb#62
1210
+ def on_begin(node); end
1211
+
1212
+ # @return [Boolean]
1213
+ #
1214
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/obsolete_strict_memoization.rb#86
1215
+ def relevant_file?(file); end
1216
+ end
1217
+
1218
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/obsolete_strict_memoization.rb#47
1219
+ RuboCop::Cop::Sorbet::ObsoleteStrictMemoization::MSG = T.let(T.unsafe(nil), String)
1220
+
1221
+ # Forbids the use of redundant `extend T::Sig`. Only for use in
1222
+ # applications that monkey patch `Module.include(T::Sig)` globally,
1223
+ # which would make it redundant.
1224
+ #
1225
+ # @example
1226
+ # # bad
1227
+ # class Example
1228
+ # extend T::Sig
1229
+ # sig { void }
1230
+ # def no_op; end
1231
+ # end
1232
+ #
1233
+ # # good
1234
+ # class Example
1235
+ # sig { void }
1236
+ # def no_op; end
1237
+ # end
1238
+ #
1239
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb#28
1240
+ class RuboCop::Cop::Sorbet::RedundantExtendTSig < ::RuboCop::Cop::Base
1241
+ include ::RuboCop::Cop::RangeHelp
1242
+ extend ::RuboCop::Cop::AutoCorrector
1243
+
1244
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb#36
1245
+ def extend_t_sig?(param0 = T.unsafe(nil)); end
1246
+
1247
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb#40
1248
+ def on_send(node); end
1249
+ end
1250
+
1251
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb#32
1252
+ RuboCop::Cop::Sorbet::RedundantExtendTSig::MSG = T.let(T.unsafe(nil), String)
1253
+
1254
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb#33
1255
+ RuboCop::Cop::Sorbet::RedundantExtendTSig::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1256
+
1257
+ # Checks for the correct order of `sig` builder methods.
1258
+ #
1259
+ # Options:
1260
+ #
1261
+ # * `Order`: The order in which to enforce the builder methods are called.
1262
+ #
1263
+ # @example
1264
+ # # bad
1265
+ # sig { void.abstract }
1266
+ #
1267
+ # # good
1268
+ # sig { abstract.void }
1269
+ #
1270
+ # # bad
1271
+ # sig { returns(Integer).params(x: Integer) }
1272
+ #
1273
+ # # good
1274
+ # sig { params(x: Integer).returns(Integer) }
1275
+ #
1276
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#24
1277
+ class RuboCop::Cop::Sorbet::SignatureBuildOrder < ::RuboCop::Cop::Base
1278
+ include ::RuboCop::Cop::Sorbet::SignatureHelp
1279
+ extend ::RuboCop::Cop::AutoCorrector
1280
+
1281
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#33
1282
+ def on_signature(node); end
1283
+
1284
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#29
1285
+ def root_call(param0); end
1286
+
1287
+ private
1288
+
1289
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#96
1290
+ def builder_method_indexes; end
1291
+
1292
+ # Split foo.bar.baz into [foo, foo.bar, foo.bar.baz]
1293
+ #
1294
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#83
1295
+ def call_chain(node); end
1296
+
1297
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#70
1298
+ def expected_source(expected_calls_and_indexes); end
1299
+ end
1300
+
1301
+ # Mixin for writing cops for signatures, providing a `signature?` node matcher and an `on_signature` trigger.
1302
+ #
1303
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/mixin/signature_help.rb#7
1304
+ module RuboCop::Cop::Sorbet::SignatureHelp
1305
+ extend ::RuboCop::AST::NodePattern::Macros
1306
+
1307
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/mixin/signature_help.rb#29
1308
+ def on_block(node); end
1309
+
1310
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/mixin/signature_help.rb#29
1311
+ def on_numblock(node); end
1312
+
1313
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/mixin/signature_help.rb#35
1314
+ def on_signature(_node); end
1315
+
1316
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/mixin/signature_help.rb#11
1317
+ def signature?(param0 = T.unsafe(nil)); end
1318
+
1319
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/mixin/signature_help.rb#20
1320
+ def with_runtime?(param0 = T.unsafe(nil)); end
1321
+
1322
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/mixin/signature_help.rb#25
1323
+ def without_runtime?(param0 = T.unsafe(nil)); end
1324
+ end
1325
+
1326
+ # Ensures empty class/module definitions in RBI files are
1327
+ # done on a single line rather than being split across multiple lines.
1328
+ #
1329
+ # @example
1330
+ #
1331
+ # # bad
1332
+ # module SomeModule
1333
+ # end
1334
+ #
1335
+ # # good
1336
+ # module SomeModule; end
1337
+ #
1338
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#17
1339
+ class RuboCop::Cop::Sorbet::SingleLineRbiClassModuleDefinitions < ::RuboCop::Cop::Base
1340
+ extend ::RuboCop::Cop::AutoCorrector
1341
+
1342
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#22
1343
+ def on_class(node); end
1344
+
1345
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#22
1346
+ def on_module(node); end
1347
+
1348
+ private
1349
+
1350
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#34
1351
+ def convert_newlines_to_semicolons(source); end
1352
+ end
1353
+
1354
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#20
1355
+ RuboCop::Cop::Sorbet::SingleLineRbiClassModuleDefinitions::MSG = T.let(T.unsafe(nil), String)
1356
+
1357
+ # Makes the Sorbet `strict` sigil mandatory in all files.
1358
+ #
1359
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/strict_sigil.rb#10
1360
+ class RuboCop::Cop::Sorbet::StrictSigil < ::RuboCop::Cop::Sorbet::HasSigil
1361
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/strict_sigil.rb#11
1362
+ def minimum_strictness; end
1363
+ end
1364
+
1365
+ # Makes the Sorbet `strong` sigil mandatory in all files.
1366
+ #
1367
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/strong_sigil.rb#10
1368
+ class RuboCop::Cop::Sorbet::StrongSigil < ::RuboCop::Cop::Sorbet::HasSigil
1369
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/strong_sigil.rb#11
1370
+ def minimum_strictness; end
1371
+ end
1372
+
1373
+ # Mixing for writing cops that deal with `T::Enum`s
1374
+ #
1375
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/mixin/t_enum.rb#7
1376
+ module RuboCop::Cop::Sorbet::TEnum
1377
+ extend ::RuboCop::AST::NodePattern::Macros
1378
+
1379
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/mixin/t_enum.rb#9
1380
+ def initialize(*_arg0); end
1381
+
1382
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/mixin/t_enum.rb#23
1383
+ def after_class(node); end
1384
+
1385
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/mixin/t_enum.rb#19
1386
+ def on_class(node); end
1387
+
1388
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/mixin/t_enum.rb#15
1389
+ def t_enum?(param0 = T.unsafe(nil)); end
1390
+
1391
+ private
1392
+
1393
+ # @return [Boolean]
1394
+ #
1395
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/mixin/t_enum.rb#29
1396
+ def in_t_enum_class?; end
1397
+ end
1398
+
1399
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#6
1400
+ module RuboCop::Cop::Sorbet::TargetSorbetVersion
1401
+ mixes_in_class_methods ::RuboCop::Cop::Sorbet::TargetSorbetVersion::ClassMethods
1402
+
1403
+ # @return [Boolean]
1404
+ #
1405
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#28
1406
+ def enabled_for_sorbet_static_version?; end
1407
+
1408
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#44
1409
+ def read_sorbet_static_version_from_bundler_lock_file; end
1410
+
1411
+ # @return [Boolean]
1412
+ #
1413
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#24
1414
+ def sorbet_enabled?; end
1415
+
1416
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#35
1417
+ def target_sorbet_static_version_from_bundler_lock_file; end
1418
+
1419
+ class << self
1420
+ # @private
1421
+ #
1422
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#8
1423
+ def included(target); end
1424
+ end
1425
+ end
1426
+
1427
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#13
1428
+ module RuboCop::Cop::Sorbet::TargetSorbetVersion::ClassMethods
1429
+ # Sets the version of the Sorbet static type checker required by this cop
1430
+ #
1431
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#15
1432
+ def minimum_target_sorbet_static_version(version); end
1433
+
1434
+ # @return [Boolean]
1435
+ #
1436
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#19
1437
+ def supports_target_sorbet_static_version?(version); end
1438
+ end
1439
+
1440
+ # Makes the Sorbet `true` sigil mandatory in all files.
1441
+ #
1442
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/true_sigil.rb#10
1443
+ class RuboCop::Cop::Sorbet::TrueSigil < ::RuboCop::Cop::Sorbet::HasSigil
1444
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/true_sigil.rb#11
1445
+ def minimum_strictness; end
1446
+ end
1447
+
1448
+ # Ensures all constants used as `T.type_alias` are using CamelCase.
1449
+ #
1450
+ # @example
1451
+ #
1452
+ # # bad
1453
+ # FOO_OR_BAR = T.type_alias { T.any(Foo, Bar) }
1454
+ #
1455
+ # # good
1456
+ # FooOrBar = T.type_alias { T.any(Foo, Bar) }
1457
+ #
1458
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/type_alias_name.rb#17
1459
+ class RuboCop::Cop::Sorbet::TypeAliasName < ::RuboCop::Cop::Base
1460
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/type_alias_name.rb#32
1461
+ def on_casgn(node); end
1462
+
1463
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/type_alias_name.rb#21
1464
+ def underscored_type_alias?(param0 = T.unsafe(nil)); end
1465
+ end
1466
+
1467
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/type_alias_name.rb#18
1468
+ RuboCop::Cop::Sorbet::TypeAliasName::MSG = T.let(T.unsafe(nil), String)
1469
+
1470
+ # Checks that gem versions in RBI annotations are properly formatted per the Bundler gem specification.
1471
+ #
1472
+ # @example
1473
+ # # bad
1474
+ # # @version > not a version number
1475
+ #
1476
+ # # good
1477
+ # # @version = 1
1478
+ #
1479
+ # # good
1480
+ # # @version > 1.2.3
1481
+ #
1482
+ # # good
1483
+ # # @version <= 4.3-preview
1484
+ #
1485
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi_versioning/valid_gem_version_annotations.rb#21
1486
+ class RuboCop::Cop::Sorbet::ValidGemVersionAnnotations < ::RuboCop::Cop::Base
1487
+ include ::RuboCop::Cop::Sorbet::GemVersionAnnotationHelper
1488
+
1489
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi_versioning/valid_gem_version_annotations.rb#27
1490
+ def on_new_investigation; end
1491
+
1492
+ private
1493
+
1494
+ # @return [Boolean]
1495
+ #
1496
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi_versioning/valid_gem_version_annotations.rb#50
1497
+ def valid_version?(version_string); end
1498
+ end
1499
+
1500
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi_versioning/valid_gem_version_annotations.rb#24
1501
+ RuboCop::Cop::Sorbet::ValidGemVersionAnnotations::MSG = T.let(T.unsafe(nil), String)
1502
+
1503
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/rbi_versioning/valid_gem_version_annotations.rb#25
1504
+ RuboCop::Cop::Sorbet::ValidGemVersionAnnotations::VALID_OPERATORS = T.let(T.unsafe(nil), Array)
1505
+
1506
+ # Checks that every Ruby file contains a valid Sorbet sigil.
1507
+ # Adapted from: https://gist.github.com/clarkdave/85aca4e16f33fd52aceb6a0a29936e52
1508
+ #
1509
+ # Options:
1510
+ #
1511
+ # * `RequireSigilOnAllFiles`: make offense if the Sorbet typed is not found in the file (default: false)
1512
+ # * `SuggestedStrictness`: Sorbet strictness level suggested in offense messages (default: 'false')
1513
+ # * `MinimumStrictness`: If set, make offense if the strictness level in the file is below this one
1514
+ # * `ExactStrictness`: If set, make offense if the strictness level in the file is different than this one
1515
+ #
1516
+ # If an `ExactStrictness` level is specified, it will be used in offense messages and autocorrect.
1517
+ # Otherwise, if a `MinimumStrictness` level is specified, it will be used in offense messages and autocorrect.
1518
+ #
1519
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#20
1520
+ class RuboCop::Cop::Sorbet::ValidSigil < ::RuboCop::Cop::Base
1521
+ extend ::RuboCop::Cop::AutoCorrector
1522
+
1523
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#23
1524
+ def on_new_investigation; end
1525
+
1526
+ protected
1527
+
1528
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#150
1529
+ def autocorrect(corrector); end
1530
+
1531
+ # checks
1532
+ #
1533
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#55
1534
+ def check_sigil_present(sigil); end
1535
+
1536
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#118
1537
+ def check_strictness_level(sigil, strictness); end
1538
+
1539
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#94
1540
+ def check_strictness_not_empty(sigil, strictness); end
1541
+
1542
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#106
1543
+ def check_strictness_valid(sigil, strictness); end
1544
+
1545
+ # Default is `nil`
1546
+ #
1547
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#184
1548
+ def exact_strictness; end
1549
+
1550
+ # extraction
1551
+ #
1552
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#43
1553
+ def extract_sigil(processed_source); end
1554
+
1555
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#49
1556
+ def extract_strictness(sigil); end
1557
+
1558
+ # Default is `nil`
1559
+ #
1560
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#178
1561
+ def minimum_strictness; end
1562
+
1563
+ # Default is `false`
1564
+ #
1565
+ # @return [Boolean]
1566
+ #
1567
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#167
1568
+ def require_sigil_on_all_files?; end
1569
+
1570
+ # Default is `'false'`
1571
+ #
1572
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#172
1573
+ def suggested_strictness; end
1574
+
1575
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#72
1576
+ def suggested_strictness_level; end
1577
+ end
1578
+
1579
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#39
1580
+ RuboCop::Cop::Sorbet::ValidSigil::SIGIL_REGEX = T.let(T.unsafe(nil), Regexp)
1581
+
1582
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#38
1583
+ RuboCop::Cop::Sorbet::ValidSigil::STRICTNESS_LEVELS = T.let(T.unsafe(nil), Array)
1584
+
1585
+ # Disallows the usage of `.void.checked(:tests)`.
1586
+ #
1587
+ # Using `.void` changes the value returned from the method, but only if
1588
+ # runtime type checking is enabled for the method. Methods marked `.void`
1589
+ # will return different values in tests compared with non-test
1590
+ # environments. This is particularly troublesome if branching on the
1591
+ # result of a `.void` method, because the returned value in test code
1592
+ # will be the truthy `VOID` value, while the non-test return value may be
1593
+ # falsy depending on the method's implementation.
1594
+ #
1595
+ # - Use `.returns(T.anything).checked(:tests)` to keep the runtime type
1596
+ # checking for the rest of the parameters.
1597
+ # - Use `.void.checked(:never)` if you are on an older version of Sorbet
1598
+ # which does not have `T.anything` (meaning versions 0.5.10781 or
1599
+ # earlier. Versions released after 2023-04-14 include `T.anything`.)
1600
+ #
1601
+ # @example
1602
+ #
1603
+ # # bad
1604
+ # sig { void.checked(:tests) }
1605
+ #
1606
+ # # good
1607
+ # sig { void }
1608
+ # sig { returns(T.anything).checked(:tests) }
1609
+ # sig { void.checked(:never) }
1610
+ #
1611
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/void_checked_tests.rb#31
1612
+ class RuboCop::Cop::Sorbet::VoidCheckedTests < ::RuboCop::Cop::Base
1613
+ include ::RuboCop::Cop::RangeHelp
1614
+ include ::RuboCop::Cop::Sorbet::SignatureHelp
1615
+ extend ::RuboCop::Cop::AutoCorrector
1616
+
1617
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/void_checked_tests.rb#37
1618
+ def checked_tests(param0); end
1619
+
1620
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/void_checked_tests.rb#58
1621
+ def on_signature(node); end
1622
+
1623
+ private
1624
+
1625
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/void_checked_tests.rb#48
1626
+ def top_level_void(node); end
1627
+ end
1628
+
1629
+ # source://rubocop-sorbet/lib/rubocop/cop/sorbet/signatures/void_checked_tests.rb#41
1630
+ RuboCop::Cop::Sorbet::VoidCheckedTests::MESSAGE = T.let(T.unsafe(nil), String)
1631
+
1632
+ module RuboCop::Cop::Style; end
1633
+
1634
+ class RuboCop::Cop::Style::MutableConstant < ::RuboCop::Cop::Base
1635
+ include ::RuboCop::Cop::Sorbet::MutableConstantSorbetAwareBehaviour
1636
+ end
1637
+
1638
+ # source://rubocop-sorbet/lib/rubocop/sorbet/version.rb#4
1639
+ module RuboCop::Sorbet; end
1640
+
1641
+ # source://rubocop-sorbet/lib/rubocop/sorbet.rb#12
1642
+ RuboCop::Sorbet::CONFIG = T.let(T.unsafe(nil), Hash)
1643
+
1644
+ # source://rubocop-sorbet/lib/rubocop/sorbet.rb#11
1645
+ RuboCop::Sorbet::CONFIG_DEFAULT = T.let(T.unsafe(nil), Pathname)
1646
+
1647
+ # source://rubocop-sorbet/lib/rubocop/sorbet.rb#8
1648
+ class RuboCop::Sorbet::Error < ::StandardError; end
1649
+
1650
+ # Because RuboCop doesn't yet support plugins, we have to monkey patch in a
1651
+ # bit of our configuration.
1652
+ #
1653
+ # source://rubocop-sorbet/lib/rubocop/sorbet/inject.rb#9
1654
+ module RuboCop::Sorbet::Inject
1655
+ class << self
1656
+ # source://rubocop-sorbet/lib/rubocop/sorbet/inject.rb#11
1657
+ def defaults!; end
1658
+ end
1659
+ end
1660
+
1661
+ # source://rubocop-sorbet/lib/rubocop/sorbet.rb#10
1662
+ RuboCop::Sorbet::PROJECT_ROOT = T.let(T.unsafe(nil), Pathname)
1663
+
1664
+ # source://rubocop-sorbet/lib/rubocop/sorbet/version.rb#5
1665
+ RuboCop::Sorbet::VERSION = T.let(T.unsafe(nil), String)