sorbet-http 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rubocop.yml +52 -0
- data/.ruby-version +1 -0
- data/.tool-versions +1 -0
- data/CHANGELOG.md +13 -0
- data/CODE_OF_CONDUCT.md +84 -0
- data/Gemfile +24 -0
- data/Gemfile.lock +110 -0
- data/LICENSE.txt +21 -0
- data/README.md +61 -0
- data/Rakefile +24 -0
- data/lib/sorbet-http.rb +15 -0
- data/lib/typed/http/method.rb +21 -0
- data/lib/typed/http/status_code.rb +366 -0
- data/sorbet/config +4 -0
- data/sorbet/rbi/annotations/rainbow.rbi +269 -0
- data/sorbet/rbi/gems/ast@2.4.2.rbi +584 -0
- data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +1083 -0
- data/sorbet/rbi/gems/io-console@0.6.0.rbi +8 -0
- data/sorbet/rbi/gems/irb@1.7.0.rbi +342 -0
- data/sorbet/rbi/gems/json@2.6.3.rbi +1533 -0
- data/sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi +14237 -0
- data/sorbet/rbi/gems/minitest@5.18.1.rbi +1491 -0
- data/sorbet/rbi/gems/netrc@0.11.0.rbi +158 -0
- data/sorbet/rbi/gems/parallel@1.23.0.rbi +273 -0
- data/sorbet/rbi/gems/parser@3.2.2.3.rbi +7253 -0
- data/sorbet/rbi/gems/racc@1.7.1.rbi +161 -0
- data/sorbet/rbi/gems/rainbow@3.1.1.rbi +402 -0
- data/sorbet/rbi/gems/rake@13.0.6.rbi +3024 -0
- data/sorbet/rbi/gems/rbi@0.0.16.rbi +3049 -0
- data/sorbet/rbi/gems/regexp_parser@2.8.1.rbi +3749 -0
- data/sorbet/rbi/gems/reline@0.3.5.rbi +8 -0
- data/sorbet/rbi/gems/rexml@3.2.5.rbi +4717 -0
- data/sorbet/rbi/gems/rubocop-ast@1.29.0.rbi +7006 -0
- data/sorbet/rbi/gems/rubocop-minitest@0.31.0.rbi +2528 -0
- data/sorbet/rbi/gems/rubocop-rake@0.6.0.rbi +328 -0
- data/sorbet/rbi/gems/rubocop-sorbet@0.7.0.rbi +1043 -0
- data/sorbet/rbi/gems/rubocop@1.53.1.rbi +56123 -0
- data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1317 -0
- data/sorbet/rbi/gems/spoom@1.2.1.rbi +2497 -0
- data/sorbet/rbi/gems/tapioca@0.11.7.rbi +3349 -0
- data/sorbet/rbi/gems/thor@1.2.2.rbi +3965 -0
- data/sorbet/rbi/gems/unicode-display_width@2.4.2.rbi +65 -0
- data/sorbet/rbi/gems/unparser@0.6.8.rbi +4525 -0
- data/sorbet/rbi/gems/yard-sorbet@0.8.1.rbi +428 -0
- data/sorbet/rbi/gems/yard@0.9.34.rbi +18219 -0
- data/sorbet/rbi/gems/zeitwerk@2.6.8.rbi +986 -0
- data/sorbet/tapioca/config.yml +2 -0
- data/sorbet/tapioca/require.rb +7 -0
- metadata +124 -0
@@ -0,0 +1,1043 @@
|
|
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
|
+
# source://rubocop-sorbet//lib/rubocop/sorbet/version.rb#2
|
8
|
+
module RuboCop; end
|
9
|
+
|
10
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb#6
|
11
|
+
module RuboCop::Cop; end
|
12
|
+
|
13
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb#7
|
14
|
+
module RuboCop::Cop::Sorbet; end
|
15
|
+
|
16
|
+
# This cop disallows using `.override(allow_incompatible: true)`.
|
17
|
+
# Using `allow_incompatible` suggests a violation of the Liskov
|
18
|
+
# Substitution Principle, meaning that a subclass is not a valid
|
19
|
+
# subtype of it's superclass. This Cop prevents these design smells
|
20
|
+
# from occurring.
|
21
|
+
#
|
22
|
+
# @example
|
23
|
+
#
|
24
|
+
# # bad
|
25
|
+
# sig.override(allow_incompatible: true)
|
26
|
+
#
|
27
|
+
# # good
|
28
|
+
# sig.override
|
29
|
+
#
|
30
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb#21
|
31
|
+
class RuboCop::Cop::Sorbet::AllowIncompatibleOverride < ::RuboCop::Cop::Cop
|
32
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb#35
|
33
|
+
def allow_incompatible?(param0); end
|
34
|
+
|
35
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb#39
|
36
|
+
def allow_incompatible_override?(param0 = T.unsafe(nil)); end
|
37
|
+
|
38
|
+
# @return [Boolean]
|
39
|
+
#
|
40
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb#31
|
41
|
+
def not_nil?(node); end
|
42
|
+
|
43
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb#48
|
44
|
+
def on_send(node); end
|
45
|
+
|
46
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb#22
|
47
|
+
def sig?(param0); end
|
48
|
+
end
|
49
|
+
|
50
|
+
# This cop disallows binding the return value of `T.any`, `T.all`, `T.enum`
|
51
|
+
# to a constant directly. To bind the value, one must use `T.type_alias`.
|
52
|
+
#
|
53
|
+
# @example
|
54
|
+
#
|
55
|
+
# # bad
|
56
|
+
# FooOrBar = T.any(Foo, Bar)
|
57
|
+
#
|
58
|
+
# # good
|
59
|
+
# FooOrBar = T.type_alias { T.any(Foo, Bar) }
|
60
|
+
#
|
61
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb#18
|
62
|
+
class RuboCop::Cop::Sorbet::BindingConstantWithoutTypeAlias < ::RuboCop::Cop::Cop
|
63
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb#116
|
64
|
+
def autocorrect(node); end
|
65
|
+
|
66
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb#19
|
67
|
+
def binding_unaliased_type?(param0 = T.unsafe(nil)); end
|
68
|
+
|
69
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb#51
|
70
|
+
def dynamic_type_creation_with_block?(param0 = T.unsafe(nil)); end
|
71
|
+
|
72
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb#66
|
73
|
+
def generic_parameter_decl_block_call?(param0 = T.unsafe(nil)); end
|
74
|
+
|
75
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb#60
|
76
|
+
def generic_parameter_decl_call?(param0 = T.unsafe(nil)); end
|
77
|
+
|
78
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb#72
|
79
|
+
def method_needing_aliasing_on_t?(param0); end
|
80
|
+
|
81
|
+
# @return [Boolean]
|
82
|
+
#
|
83
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb#85
|
84
|
+
def not_dynamic_type_creation_with_block?(node); end
|
85
|
+
|
86
|
+
# @return [Boolean]
|
87
|
+
#
|
88
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb#89
|
89
|
+
def not_generic_parameter_decl?(node); end
|
90
|
+
|
91
|
+
# @return [Boolean]
|
92
|
+
#
|
93
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb#93
|
94
|
+
def not_nil?(node); end
|
95
|
+
|
96
|
+
# @return [Boolean]
|
97
|
+
#
|
98
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb#81
|
99
|
+
def not_t_let?(node); end
|
100
|
+
|
101
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb#97
|
102
|
+
def on_casgn(node); end
|
103
|
+
|
104
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb#41
|
105
|
+
def t_let?(param0 = T.unsafe(nil)); end
|
106
|
+
|
107
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb#32
|
108
|
+
def using_deprecated_type_alias_syntax?(param0 = T.unsafe(nil)); end
|
109
|
+
|
110
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb#23
|
111
|
+
def using_type_alias?(param0 = T.unsafe(nil)); end
|
112
|
+
end
|
113
|
+
|
114
|
+
# This cop ensures that callback conditionals are bound to the right type
|
115
|
+
# so that they are type checked properly.
|
116
|
+
#
|
117
|
+
# Auto-correction is unsafe because other libraries define similar style callbacks as Rails, but don't always need
|
118
|
+
# binding to the attached class. Auto-correcting those usages can lead to false positives and auto-correction
|
119
|
+
# introduces new typing errors.
|
120
|
+
#
|
121
|
+
# @example
|
122
|
+
#
|
123
|
+
# # bad
|
124
|
+
# class Post < ApplicationRecord
|
125
|
+
# before_create :do_it, if: -> { should_do_it? }
|
126
|
+
#
|
127
|
+
# def should_do_it?
|
128
|
+
# true
|
129
|
+
# end
|
130
|
+
# end
|
131
|
+
#
|
132
|
+
# # good
|
133
|
+
# class Post < ApplicationRecord
|
134
|
+
# before_create :do_it, if: -> {
|
135
|
+
# T.bind(self, Post)
|
136
|
+
# should_do_it?
|
137
|
+
# }
|
138
|
+
#
|
139
|
+
# def should_do_it?
|
140
|
+
# true
|
141
|
+
# end
|
142
|
+
# end
|
143
|
+
#
|
144
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#35
|
145
|
+
class RuboCop::Cop::Sorbet::CallbackConditionalsBinding < ::RuboCop::Cop::Cop
|
146
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#47
|
147
|
+
def autocorrect(node); end
|
148
|
+
|
149
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#99
|
150
|
+
def on_send(node); end
|
151
|
+
end
|
152
|
+
|
153
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#36
|
154
|
+
RuboCop::Cop::Sorbet::CallbackConditionalsBinding::CALLBACKS = T.let(T.unsafe(nil), Array)
|
155
|
+
|
156
|
+
# This cop disallows the usage of `checked(true)`. This usage could cause
|
157
|
+
# confusion; it could lead some people to believe that a method would be checked
|
158
|
+
# even if runtime checks have not been enabled on the class or globally.
|
159
|
+
# Additionally, in the event where checks are enabled, `checked(true)` would
|
160
|
+
# be redundant; only `checked(false)` or `soft` would change the behaviour.
|
161
|
+
#
|
162
|
+
# @example
|
163
|
+
#
|
164
|
+
# # bad
|
165
|
+
# sig { void.checked(true) }
|
166
|
+
#
|
167
|
+
# # good
|
168
|
+
# sig { void }
|
169
|
+
#
|
170
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb#22
|
171
|
+
class RuboCop::Cop::Sorbet::CheckedTrueInSignature < ::RuboCop::Cop::Sorbet::SignatureCop
|
172
|
+
include ::RuboCop::Cop::RangeHelp
|
173
|
+
|
174
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb#25
|
175
|
+
def offending_node(param0); end
|
176
|
+
|
177
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb#36
|
178
|
+
def on_signature(node); end
|
179
|
+
end
|
180
|
+
|
181
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb#29
|
182
|
+
RuboCop::Cop::Sorbet::CheckedTrueInSignature::MESSAGE = T.let(T.unsafe(nil), String)
|
183
|
+
|
184
|
+
# This cop disallows the calls that are used to get constants fom Strings
|
185
|
+
# such as +constantize+, +const_get+, and +constants+.
|
186
|
+
#
|
187
|
+
# The goal of this cop is to make the code easier to statically analyze,
|
188
|
+
# more IDE-friendly, and more predictable. It leads to code that clearly
|
189
|
+
# expresses which values the constant can have.
|
190
|
+
#
|
191
|
+
# @example
|
192
|
+
#
|
193
|
+
# # bad
|
194
|
+
# class_name.constantize
|
195
|
+
#
|
196
|
+
# # bad
|
197
|
+
# constants.detect { |c| c.name == "User" }
|
198
|
+
#
|
199
|
+
# # bad
|
200
|
+
# const_get(class_name)
|
201
|
+
#
|
202
|
+
# # good
|
203
|
+
# case class_name
|
204
|
+
# when "User"
|
205
|
+
# User
|
206
|
+
# else
|
207
|
+
# raise ArgumentError
|
208
|
+
# end
|
209
|
+
#
|
210
|
+
# # good
|
211
|
+
# { "User" => User }.fetch(class_name)
|
212
|
+
#
|
213
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/constants_from_strings.rb#36
|
214
|
+
class RuboCop::Cop::Sorbet::ConstantsFromStrings < ::RuboCop::Cop::Cop
|
215
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/constants_from_strings.rb#37
|
216
|
+
def constant_from_string?(param0 = T.unsafe(nil)); end
|
217
|
+
|
218
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/constants_from_strings.rb#41
|
219
|
+
def on_send(node); end
|
220
|
+
end
|
221
|
+
|
222
|
+
# This cop checks for blank lines after signatures.
|
223
|
+
#
|
224
|
+
# It also suggests an autocorrect
|
225
|
+
#
|
226
|
+
# @example
|
227
|
+
#
|
228
|
+
# # bad
|
229
|
+
# sig { void }
|
230
|
+
#
|
231
|
+
# def foo; end
|
232
|
+
#
|
233
|
+
# # good
|
234
|
+
# sig { void }
|
235
|
+
# def foo; end
|
236
|
+
#
|
237
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb#23
|
238
|
+
class RuboCop::Cop::Sorbet::EmptyLineAfterSig < ::RuboCop::Cop::Sorbet::SignatureCop
|
239
|
+
include ::RuboCop::Cop::RangeHelp
|
240
|
+
|
241
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb#33
|
242
|
+
def autocorrect(node); end
|
243
|
+
|
244
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb#26
|
245
|
+
def on_signature(node); end
|
246
|
+
|
247
|
+
private
|
248
|
+
|
249
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb#48
|
250
|
+
def next_method(node); end
|
251
|
+
end
|
252
|
+
|
253
|
+
# This cop checks that the Sorbet sigil comes as the first magic comment in the file.
|
254
|
+
#
|
255
|
+
# The expected order for magic comments is: (en)?coding, typed, warn_indent then frozen_string_literal.
|
256
|
+
#
|
257
|
+
# For example, the following bad ordering:
|
258
|
+
#
|
259
|
+
# ```ruby
|
260
|
+
# class Foo; end
|
261
|
+
# ```
|
262
|
+
#
|
263
|
+
# Will be corrected as:
|
264
|
+
#
|
265
|
+
# ```ruby
|
266
|
+
# class Foo; end
|
267
|
+
# ```
|
268
|
+
#
|
269
|
+
# Only `(en)?coding`, `typed`, `warn_indent` and `frozen_string_literal` magic comments are considered,
|
270
|
+
# other comments or magic comments are left in the same place.
|
271
|
+
#
|
272
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#30
|
273
|
+
class RuboCop::Cop::Sorbet::EnforceSigilOrder < ::RuboCop::Cop::Sorbet::ValidSigil
|
274
|
+
include ::RuboCop::Cop::RangeHelp
|
275
|
+
|
276
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#42
|
277
|
+
def autocorrect(_node); end
|
278
|
+
|
279
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#33
|
280
|
+
def investigate(processed_source); end
|
281
|
+
|
282
|
+
protected
|
283
|
+
|
284
|
+
# checks
|
285
|
+
#
|
286
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#91
|
287
|
+
def check_magic_comments_order(tokens); end
|
288
|
+
|
289
|
+
# Get all the tokens in `processed_source` that match `MAGIC_REGEX`
|
290
|
+
#
|
291
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#83
|
292
|
+
def extract_magic_comments(processed_source); end
|
293
|
+
end
|
294
|
+
|
295
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#67
|
296
|
+
RuboCop::Cop::Sorbet::EnforceSigilOrder::CODING_REGEX = T.let(T.unsafe(nil), Regexp)
|
297
|
+
|
298
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#69
|
299
|
+
RuboCop::Cop::Sorbet::EnforceSigilOrder::FROZEN_REGEX = T.let(T.unsafe(nil), Regexp)
|
300
|
+
|
301
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#68
|
302
|
+
RuboCop::Cop::Sorbet::EnforceSigilOrder::INDENT_REGEX = T.let(T.unsafe(nil), Regexp)
|
303
|
+
|
304
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#78
|
305
|
+
RuboCop::Cop::Sorbet::EnforceSigilOrder::MAGIC_REGEX = T.let(T.unsafe(nil), Regexp)
|
306
|
+
|
307
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#71
|
308
|
+
RuboCop::Cop::Sorbet::EnforceSigilOrder::PREFERRED_ORDER = T.let(T.unsafe(nil), Hash)
|
309
|
+
|
310
|
+
# This cop checks that every method definition and attribute accessor has a Sorbet signature.
|
311
|
+
#
|
312
|
+
# It also suggest an autocorrect with placeholders so the following code:
|
313
|
+
#
|
314
|
+
# ```
|
315
|
+
# def foo(a, b, c); end
|
316
|
+
# ```
|
317
|
+
#
|
318
|
+
# Will be corrected as:
|
319
|
+
#
|
320
|
+
# ```
|
321
|
+
# sig { params(a: T.untyped, b: T.untyped, c: T.untyped).returns(T.untyped)
|
322
|
+
# def foo(a, b, c); end
|
323
|
+
# ```
|
324
|
+
#
|
325
|
+
# You can configure the placeholders used by changing the following options:
|
326
|
+
#
|
327
|
+
# * `ParameterTypePlaceholder`: placeholders used for parameter types (default: 'T.untyped')
|
328
|
+
# * `ReturnTypePlaceholder`: placeholders used for return types (default: 'T.untyped')
|
329
|
+
#
|
330
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#29
|
331
|
+
class RuboCop::Cop::Sorbet::EnforceSignatures < ::RuboCop::Cop::Sorbet::SignatureCop
|
332
|
+
# @return [EnforceSignatures] a new instance of EnforceSignatures
|
333
|
+
#
|
334
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#30
|
335
|
+
def initialize(config = T.unsafe(nil), options = T.unsafe(nil)); end
|
336
|
+
|
337
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#35
|
338
|
+
def accessor?(param0 = T.unsafe(nil)); end
|
339
|
+
|
340
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#55
|
341
|
+
def autocorrect(node); end
|
342
|
+
|
343
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#39
|
344
|
+
def on_def(node); end
|
345
|
+
|
346
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#43
|
347
|
+
def on_defs(node); end
|
348
|
+
|
349
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#47
|
350
|
+
def on_send(node); end
|
351
|
+
|
352
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#51
|
353
|
+
def on_signature(node); end
|
354
|
+
|
355
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#74
|
356
|
+
def scope(node); end
|
357
|
+
|
358
|
+
private
|
359
|
+
|
360
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#82
|
361
|
+
def check_node(node); end
|
362
|
+
|
363
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#93
|
364
|
+
def param_type_placeholder; end
|
365
|
+
|
366
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#97
|
367
|
+
def return_type_placeholder; end
|
368
|
+
end
|
369
|
+
|
370
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#101
|
371
|
+
class RuboCop::Cop::Sorbet::EnforceSignatures::SigSuggestion
|
372
|
+
# @return [SigSuggestion] a new instance of SigSuggestion
|
373
|
+
#
|
374
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#104
|
375
|
+
def initialize(indent, param_placeholder, return_placeholder); end
|
376
|
+
|
377
|
+
# Returns the value of attribute params.
|
378
|
+
#
|
379
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#102
|
380
|
+
def params; end
|
381
|
+
|
382
|
+
# Sets the attribute params
|
383
|
+
#
|
384
|
+
# @param value the value to set the attribute params to.
|
385
|
+
#
|
386
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#102
|
387
|
+
def params=(_arg0); end
|
388
|
+
|
389
|
+
# Returns the value of attribute returns.
|
390
|
+
#
|
391
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#102
|
392
|
+
def returns; end
|
393
|
+
|
394
|
+
# Sets the attribute returns
|
395
|
+
#
|
396
|
+
# @param value the value to set the attribute returns to.
|
397
|
+
#
|
398
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#102
|
399
|
+
def returns=(_arg0); end
|
400
|
+
|
401
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#112
|
402
|
+
def to_autocorrect; end
|
403
|
+
|
404
|
+
private
|
405
|
+
|
406
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#124
|
407
|
+
def generate_params; end
|
408
|
+
|
409
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#135
|
410
|
+
def generate_return; end
|
411
|
+
end
|
412
|
+
|
413
|
+
# This cop checks that there is only one Sorbet sigil in a given file
|
414
|
+
#
|
415
|
+
# For example, the following class with two sigils
|
416
|
+
#
|
417
|
+
# ```ruby
|
418
|
+
# class Foo; end
|
419
|
+
# ```
|
420
|
+
#
|
421
|
+
# Will be corrected as:
|
422
|
+
#
|
423
|
+
# ```ruby
|
424
|
+
# class Foo; end
|
425
|
+
# ```
|
426
|
+
#
|
427
|
+
# Other comments or magic comments are left in place.
|
428
|
+
#
|
429
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb#26
|
430
|
+
class RuboCop::Cop::Sorbet::EnforceSingleSigil < ::RuboCop::Cop::Sorbet::ValidSigil
|
431
|
+
include ::RuboCop::Cop::RangeHelp
|
432
|
+
|
433
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb#39
|
434
|
+
def autocorrect(_node); end
|
435
|
+
|
436
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb#29
|
437
|
+
def investigate(processed_source); end
|
438
|
+
|
439
|
+
protected
|
440
|
+
|
441
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb#55
|
442
|
+
def extract_all_sigils(processed_source); end
|
443
|
+
end
|
444
|
+
|
445
|
+
# This cop makes the Sorbet `false` sigil mandatory in all files.
|
446
|
+
#
|
447
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/false_sigil.rb#10
|
448
|
+
class RuboCop::Cop::Sorbet::FalseSigil < ::RuboCop::Cop::Sorbet::HasSigil
|
449
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/false_sigil.rb#11
|
450
|
+
def minimum_strictness; end
|
451
|
+
end
|
452
|
+
|
453
|
+
# This cop ensures RBI shims do not include a call to extend T::Sig
|
454
|
+
# or to extend T::Helpers
|
455
|
+
#
|
456
|
+
# @example
|
457
|
+
#
|
458
|
+
# # bad
|
459
|
+
# module SomeModule
|
460
|
+
# extend T::Sig
|
461
|
+
# extend T::Helpers
|
462
|
+
#
|
463
|
+
# sig { returns(String) }
|
464
|
+
# def foo; end
|
465
|
+
# end
|
466
|
+
#
|
467
|
+
# # good
|
468
|
+
# module SomeModule
|
469
|
+
# sig { returns(String) }
|
470
|
+
# def foo; end
|
471
|
+
# end
|
472
|
+
#
|
473
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb#25
|
474
|
+
class RuboCop::Cop::Sorbet::ForbidExtendTSigHelpersInShims < ::RuboCop::Cop::Cop
|
475
|
+
include ::RuboCop::Cop::RangeHelp
|
476
|
+
|
477
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb#39
|
478
|
+
def autocorrect(node); end
|
479
|
+
|
480
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb#35
|
481
|
+
def extend_t_helpers?(param0 = T.unsafe(nil)); end
|
482
|
+
|
483
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb#31
|
484
|
+
def extend_t_sig?(param0 = T.unsafe(nil)); end
|
485
|
+
|
486
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb#47
|
487
|
+
def on_send(node); end
|
488
|
+
end
|
489
|
+
|
490
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb#28
|
491
|
+
RuboCop::Cop::Sorbet::ForbidExtendTSigHelpersInShims::MSG = T.let(T.unsafe(nil), String)
|
492
|
+
|
493
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb#29
|
494
|
+
RuboCop::Cop::Sorbet::ForbidExtendTSigHelpersInShims::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
495
|
+
|
496
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#29
|
497
|
+
class RuboCop::Cop::Sorbet::ForbidIncludeConstLiteral < ::RuboCop::Cop::Cop
|
498
|
+
# @return [ForbidIncludeConstLiteral] a new instance of ForbidIncludeConstLiteral
|
499
|
+
#
|
500
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#40
|
501
|
+
def initialize(*_arg0); end
|
502
|
+
|
503
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#56
|
504
|
+
def autocorrect(node); end
|
505
|
+
|
506
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#34
|
507
|
+
def not_lit_const_include?(param0 = T.unsafe(nil)); end
|
508
|
+
|
509
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#45
|
510
|
+
def on_send(node); end
|
511
|
+
|
512
|
+
# Returns the value of attribute used_names.
|
513
|
+
#
|
514
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#32
|
515
|
+
def used_names; end
|
516
|
+
|
517
|
+
# Sets the attribute used_names
|
518
|
+
#
|
519
|
+
# @param value the value to set the attribute used_names to.
|
520
|
+
#
|
521
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#32
|
522
|
+
def used_names=(_arg0); end
|
523
|
+
end
|
524
|
+
|
525
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#30
|
526
|
+
RuboCop::Cop::Sorbet::ForbidIncludeConstLiteral::MSG = T.let(T.unsafe(nil), String)
|
527
|
+
|
528
|
+
# This cop makes sure that RBI files are always located under the defined allowed paths.
|
529
|
+
#
|
530
|
+
# Options:
|
531
|
+
#
|
532
|
+
# * `AllowedPaths`: A list of the paths where RBI files are allowed (default: ["rbi/**", "sorbet/rbi/**"])
|
533
|
+
#
|
534
|
+
# @example
|
535
|
+
# # bad
|
536
|
+
# # lib/some_file.rbi
|
537
|
+
# # other_file.rbi
|
538
|
+
#
|
539
|
+
# # good
|
540
|
+
# # rbi/external_interface.rbi
|
541
|
+
# # sorbet/rbi/some_file.rbi
|
542
|
+
# # sorbet/rbi/any/path/for/file.rbi
|
543
|
+
#
|
544
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_rbi_outside_of_allowed_paths.rb#23
|
545
|
+
class RuboCop::Cop::Sorbet::ForbidRBIOutsideOfAllowedPaths < ::RuboCop::Cop::Cop
|
546
|
+
include ::RuboCop::Cop::RangeHelp
|
547
|
+
|
548
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_rbi_outside_of_allowed_paths.rb#26
|
549
|
+
def investigate(processed_source); end
|
550
|
+
|
551
|
+
private
|
552
|
+
|
553
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_rbi_outside_of_allowed_paths.rb#58
|
554
|
+
def allowed_paths; end
|
555
|
+
end
|
556
|
+
|
557
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_superclass_const_literal.rb#27
|
558
|
+
class RuboCop::Cop::Sorbet::ForbidSuperclassConstLiteral < ::RuboCop::Cop::Cop
|
559
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_superclass_const_literal.rb#30
|
560
|
+
def not_lit_const_superclass?(param0 = T.unsafe(nil)); end
|
561
|
+
|
562
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_superclass_const_literal.rb#38
|
563
|
+
def on_class(node); end
|
564
|
+
end
|
565
|
+
|
566
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_superclass_const_literal.rb#28
|
567
|
+
RuboCop::Cop::Sorbet::ForbidSuperclassConstLiteral::MSG = T.let(T.unsafe(nil), String)
|
568
|
+
|
569
|
+
# This cop disallows using `T.unsafe` anywhere.
|
570
|
+
#
|
571
|
+
# @example
|
572
|
+
#
|
573
|
+
# # bad
|
574
|
+
# T.unsafe(foo)
|
575
|
+
#
|
576
|
+
# # good
|
577
|
+
# foo
|
578
|
+
#
|
579
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_unsafe.rb#17
|
580
|
+
class RuboCop::Cop::Sorbet::ForbidTUnsafe < ::RuboCop::Cop::Cop
|
581
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_unsafe.rb#20
|
582
|
+
def on_send(node); end
|
583
|
+
|
584
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_unsafe.rb#18
|
585
|
+
def t_unsafe?(param0 = T.unsafe(nil)); end
|
586
|
+
end
|
587
|
+
|
588
|
+
# This cop disallows using `T.untyped` anywhere.
|
589
|
+
#
|
590
|
+
# @example
|
591
|
+
#
|
592
|
+
# # bad
|
593
|
+
# sig { params(my_argument: T.untyped).void }
|
594
|
+
# def foo(my_argument); end
|
595
|
+
#
|
596
|
+
# # good
|
597
|
+
# sig { params(my_argument: String).void }
|
598
|
+
# def foo(my_argument); end
|
599
|
+
#
|
600
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_untyped.rb#20
|
601
|
+
class RuboCop::Cop::Sorbet::ForbidTUntyped < ::RuboCop::Cop::Cop
|
602
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_untyped.rb#23
|
603
|
+
def on_send(node); end
|
604
|
+
|
605
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_untyped.rb#21
|
606
|
+
def t_untyped?(param0 = T.unsafe(nil)); end
|
607
|
+
end
|
608
|
+
|
609
|
+
# This cop disallows use of `T.untyped` or `T.nilable(T.untyped)`
|
610
|
+
# as a prop type for `T::Struct` or `T::ImmutableStruct`.
|
611
|
+
#
|
612
|
+
# @example
|
613
|
+
#
|
614
|
+
# # bad
|
615
|
+
# class SomeClass < T::Struct
|
616
|
+
# const :foo, T.untyped
|
617
|
+
# prop :bar, T.nilable(T.untyped)
|
618
|
+
# end
|
619
|
+
#
|
620
|
+
# # good
|
621
|
+
# class SomeClass < T::Struct
|
622
|
+
# const :foo, Integer
|
623
|
+
# prop :bar, T.nilable(String)
|
624
|
+
# end
|
625
|
+
#
|
626
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#25
|
627
|
+
class RuboCop::Cop::Sorbet::ForbidUntypedStructProps < ::RuboCop::Cop::Cop
|
628
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#52
|
629
|
+
def on_class(node); end
|
630
|
+
|
631
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#44
|
632
|
+
def subclass_of_t_struct?(param0 = T.unsafe(nil)); end
|
633
|
+
|
634
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#32
|
635
|
+
def t_immutable_struct(param0 = T.unsafe(nil)); end
|
636
|
+
|
637
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#40
|
638
|
+
def t_nilable_untyped(param0 = T.unsafe(nil)); end
|
639
|
+
|
640
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#28
|
641
|
+
def t_struct(param0 = T.unsafe(nil)); end
|
642
|
+
|
643
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#36
|
644
|
+
def t_untyped(param0 = T.unsafe(nil)); end
|
645
|
+
|
646
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#48
|
647
|
+
def untyped_props(param0); end
|
648
|
+
end
|
649
|
+
|
650
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#26
|
651
|
+
RuboCop::Cop::Sorbet::ForbidUntypedStructProps::MSG = T.let(T.unsafe(nil), String)
|
652
|
+
|
653
|
+
# This cop makes the Sorbet typed sigil mandatory in all files.
|
654
|
+
#
|
655
|
+
# Options:
|
656
|
+
#
|
657
|
+
# * `SuggestedStrictness`: Sorbet strictness level suggested in offense messages (default: 'false')
|
658
|
+
# * `MinimumStrictness`: If set, make offense if the strictness level in the file is below this one
|
659
|
+
#
|
660
|
+
# If a `MinimumStrictness` level is specified, it will be used in offense messages and autocorrect.
|
661
|
+
#
|
662
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/has_sigil.rb#17
|
663
|
+
class RuboCop::Cop::Sorbet::HasSigil < ::RuboCop::Cop::Sorbet::ValidSigil
|
664
|
+
# @return [Boolean]
|
665
|
+
#
|
666
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/has_sigil.rb#20
|
667
|
+
def require_sigil_on_all_files?; end
|
668
|
+
end
|
669
|
+
|
670
|
+
# This cop makes the Sorbet `ignore` sigil mandatory in all files.
|
671
|
+
#
|
672
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/ignore_sigil.rb#10
|
673
|
+
class RuboCop::Cop::Sorbet::IgnoreSigil < ::RuboCop::Cop::Sorbet::HasSigil
|
674
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/ignore_sigil.rb#11
|
675
|
+
def minimum_strictness; end
|
676
|
+
end
|
677
|
+
|
678
|
+
# This cop checks for the ordering of keyword arguments required by
|
679
|
+
# sorbet-runtime. The ordering requires that all keyword arguments
|
680
|
+
# are at the end of the parameters list, and all keyword arguments
|
681
|
+
# with a default value must be after those without default values.
|
682
|
+
#
|
683
|
+
# @example
|
684
|
+
#
|
685
|
+
# # bad
|
686
|
+
# sig { params(a: Integer, b: String).void }
|
687
|
+
# def foo(a: 1, b:); end
|
688
|
+
#
|
689
|
+
# # good
|
690
|
+
# sig { params(b: String, a: Integer).void }
|
691
|
+
# def foo(b:, a: 1); end
|
692
|
+
#
|
693
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/keyword_argument_ordering.rb#23
|
694
|
+
class RuboCop::Cop::Sorbet::KeywordArgumentOrdering < ::RuboCop::Cop::Sorbet::SignatureCop
|
695
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/keyword_argument_ordering.rb#24
|
696
|
+
def on_signature(node); end
|
697
|
+
|
698
|
+
private
|
699
|
+
|
700
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/keyword_argument_ordering.rb#34
|
701
|
+
def check_order_for_kwoptargs(parameters); end
|
702
|
+
end
|
703
|
+
|
704
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#8
|
705
|
+
module RuboCop::Cop::Sorbet::MutableConstantSorbetAwareBehaviour
|
706
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#15
|
707
|
+
def on_assignment(value); end
|
708
|
+
|
709
|
+
class << self
|
710
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#9
|
711
|
+
def prepended(base); end
|
712
|
+
end
|
713
|
+
end
|
714
|
+
|
715
|
+
# This cop ensures one ancestor per requires_ancestor line
|
716
|
+
# rather than chaining them as a comma-separated list.
|
717
|
+
#
|
718
|
+
# @example
|
719
|
+
#
|
720
|
+
# # bad
|
721
|
+
# module SomeModule
|
722
|
+
# requires_ancestor Kernel, Minitest::Assertions
|
723
|
+
# end
|
724
|
+
#
|
725
|
+
# # good
|
726
|
+
# module SomeModule
|
727
|
+
# requires_ancestor Kernel
|
728
|
+
# requires_ancestor Minitest::Assertions
|
729
|
+
# end
|
730
|
+
#
|
731
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#24
|
732
|
+
class RuboCop::Cop::Sorbet::OneAncestorPerLine < ::RuboCop::Cop::Cop
|
733
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#35
|
734
|
+
def abstract?(param0); end
|
735
|
+
|
736
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#51
|
737
|
+
def autocorrect(node); end
|
738
|
+
|
739
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#31
|
740
|
+
def more_than_one_ancestor(param0 = T.unsafe(nil)); end
|
741
|
+
|
742
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#45
|
743
|
+
def on_class(node); end
|
744
|
+
|
745
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#39
|
746
|
+
def on_module(node); end
|
747
|
+
|
748
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#27
|
749
|
+
def requires_ancestors(param0); end
|
750
|
+
|
751
|
+
private
|
752
|
+
|
753
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#67
|
754
|
+
def new_ra_line(indent_count); end
|
755
|
+
|
756
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#61
|
757
|
+
def process_node(node); end
|
758
|
+
end
|
759
|
+
|
760
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#25
|
761
|
+
RuboCop::Cop::Sorbet::OneAncestorPerLine::MSG = T.let(T.unsafe(nil), String)
|
762
|
+
|
763
|
+
# Forbids the use of redundant `extend T::Sig`. Only for use in
|
764
|
+
# applications that monkey patch `Module.include(T::Sig)` globally,
|
765
|
+
# which would make it redundant.
|
766
|
+
#
|
767
|
+
# @example
|
768
|
+
# # bad
|
769
|
+
# class Example
|
770
|
+
# extend T::Sig
|
771
|
+
# sig { void }
|
772
|
+
# def no_op; end
|
773
|
+
# end
|
774
|
+
#
|
775
|
+
# # good
|
776
|
+
# class Example
|
777
|
+
# sig { void }
|
778
|
+
# def no_op; end
|
779
|
+
# end
|
780
|
+
#
|
781
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb#28
|
782
|
+
class RuboCop::Cop::Sorbet::RedundantExtendTSig < ::RuboCop::Cop::Cop
|
783
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb#42
|
784
|
+
def autocorrect(node); end
|
785
|
+
|
786
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb#32
|
787
|
+
def extend_t_sig?(param0 = T.unsafe(nil)); end
|
788
|
+
|
789
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb#36
|
790
|
+
def on_send(node); end
|
791
|
+
end
|
792
|
+
|
793
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb#29
|
794
|
+
RuboCop::Cop::Sorbet::RedundantExtendTSig::MSG = T.let(T.unsafe(nil), String)
|
795
|
+
|
796
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb#30
|
797
|
+
RuboCop::Cop::Sorbet::RedundantExtendTSig::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
798
|
+
|
799
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#15
|
800
|
+
class RuboCop::Cop::Sorbet::SignatureBuildOrder < ::RuboCop::Cop::Sorbet::SignatureCop
|
801
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#54
|
802
|
+
def autocorrect(node); end
|
803
|
+
|
804
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#34
|
805
|
+
def on_signature(node); end
|
806
|
+
|
807
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#30
|
808
|
+
def root_call(param0); end
|
809
|
+
|
810
|
+
private
|
811
|
+
|
812
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#96
|
813
|
+
def call_chain(sig_child_node); end
|
814
|
+
|
815
|
+
# @return [Boolean]
|
816
|
+
#
|
817
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#92
|
818
|
+
def can_autocorrect?; end
|
819
|
+
|
820
|
+
# This method exists to reparse the current node with modern features enabled.
|
821
|
+
# Modern features include "index send" emitting, which is necessary to unparse
|
822
|
+
# "index sends" (i.e. `[]` calls) back to index accessors (i.e. as `foo[bar]``).
|
823
|
+
# Otherwise, we would get the unparsed node as `foo.[](bar)`.
|
824
|
+
#
|
825
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#83
|
826
|
+
def node_reparsed_with_modern_features(node); end
|
827
|
+
end
|
828
|
+
|
829
|
+
# Create a subclass of AST Builder that has modern features turned on
|
830
|
+
#
|
831
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#72
|
832
|
+
class RuboCop::Cop::Sorbet::SignatureBuildOrder::ModernBuilder < ::RuboCop::AST::Builder; end
|
833
|
+
|
834
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#16
|
835
|
+
RuboCop::Cop::Sorbet::SignatureBuildOrder::ORDER = T.let(T.unsafe(nil), Hash)
|
836
|
+
|
837
|
+
# Abstract cop specific to Sorbet signatures
|
838
|
+
#
|
839
|
+
# You can subclass it to use the `on_signature` trigger and the `signature?` node matcher.
|
840
|
+
#
|
841
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_cop.rb#11
|
842
|
+
class RuboCop::Cop::Sorbet::SignatureCop < ::RuboCop::Cop::Cop
|
843
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_cop.rb#30
|
844
|
+
def on_block(node); end
|
845
|
+
|
846
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_cop.rb#34
|
847
|
+
def on_signature(_); end
|
848
|
+
|
849
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_cop.rb#14
|
850
|
+
def signature?(param0 = T.unsafe(nil)); end
|
851
|
+
|
852
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_cop.rb#22
|
853
|
+
def with_runtime?(param0 = T.unsafe(nil)); end
|
854
|
+
|
855
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_cop.rb#26
|
856
|
+
def without_runtime?(param0 = T.unsafe(nil)); end
|
857
|
+
end
|
858
|
+
|
859
|
+
# This cop ensures empty class/module definitions in RBI files are
|
860
|
+
# done on a single line rather than being split across multiple lines.
|
861
|
+
#
|
862
|
+
# @example
|
863
|
+
#
|
864
|
+
# # bad
|
865
|
+
# module SomeModule
|
866
|
+
# end
|
867
|
+
#
|
868
|
+
# # good
|
869
|
+
# module SomeModule; end
|
870
|
+
#
|
871
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#17
|
872
|
+
class RuboCop::Cop::Sorbet::SingleLineRbiClassModuleDefinitions < ::RuboCop::Cop::Cop
|
873
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#28
|
874
|
+
def autocorrect(node); end
|
875
|
+
|
876
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#24
|
877
|
+
def on_class(node); end
|
878
|
+
|
879
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#20
|
880
|
+
def on_module(node); end
|
881
|
+
|
882
|
+
protected
|
883
|
+
|
884
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#34
|
885
|
+
def convert_newlines(source); end
|
886
|
+
|
887
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#38
|
888
|
+
def process_node(node); end
|
889
|
+
end
|
890
|
+
|
891
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#18
|
892
|
+
RuboCop::Cop::Sorbet::SingleLineRbiClassModuleDefinitions::MSG = T.let(T.unsafe(nil), String)
|
893
|
+
|
894
|
+
# This cop makes the Sorbet `strict` sigil mandatory in all files.
|
895
|
+
#
|
896
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/strict_sigil.rb#10
|
897
|
+
class RuboCop::Cop::Sorbet::StrictSigil < ::RuboCop::Cop::Sorbet::HasSigil
|
898
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/strict_sigil.rb#11
|
899
|
+
def minimum_strictness; end
|
900
|
+
end
|
901
|
+
|
902
|
+
# This cop makes the Sorbet `strong` sigil mandatory in all files.
|
903
|
+
#
|
904
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/strong_sigil.rb#10
|
905
|
+
class RuboCop::Cop::Sorbet::StrongSigil < ::RuboCop::Cop::Sorbet::HasSigil
|
906
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/strong_sigil.rb#11
|
907
|
+
def minimum_strictness; end
|
908
|
+
end
|
909
|
+
|
910
|
+
# This cop makes the Sorbet `true` sigil mandatory in all files.
|
911
|
+
#
|
912
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/true_sigil.rb#10
|
913
|
+
class RuboCop::Cop::Sorbet::TrueSigil < ::RuboCop::Cop::Sorbet::HasSigil
|
914
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/true_sigil.rb#11
|
915
|
+
def minimum_strictness; end
|
916
|
+
end
|
917
|
+
|
918
|
+
# This cop ensures all constants used as `T.type_alias` are using CamelCase.
|
919
|
+
#
|
920
|
+
# @example
|
921
|
+
#
|
922
|
+
# # bad
|
923
|
+
# FOO_OR_BAR = T.type_alias { T.any(Foo, Bar) }
|
924
|
+
#
|
925
|
+
# # good
|
926
|
+
# FooOrBar = T.type_alias { T.any(Foo, Bar) }
|
927
|
+
#
|
928
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/type_alias_name.rb#17
|
929
|
+
class RuboCop::Cop::Sorbet::TypeAliasName < ::RuboCop::Cop::Cop
|
930
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/type_alias_name.rb#20
|
931
|
+
def casgn_type_alias?(param0 = T.unsafe(nil)); end
|
932
|
+
|
933
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/type_alias_name.rb#32
|
934
|
+
def on_casgn(node); end
|
935
|
+
end
|
936
|
+
|
937
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/type_alias_name.rb#18
|
938
|
+
RuboCop::Cop::Sorbet::TypeAliasName::MSG = T.let(T.unsafe(nil), String)
|
939
|
+
|
940
|
+
# This cop checks that every Ruby file contains a valid Sorbet sigil.
|
941
|
+
# Adapted from: https://gist.github.com/clarkdave/85aca4e16f33fd52aceb6a0a29936e52
|
942
|
+
#
|
943
|
+
# Options:
|
944
|
+
#
|
945
|
+
# * `RequireSigilOnAllFiles`: make offense if the Sorbet typed is not found in the file (default: false)
|
946
|
+
# * `SuggestedStrictness`: Sorbet strictness level suggested in offense messages (default: 'false')
|
947
|
+
# * `MinimumStrictness`: If set, make offense if the strictness level in the file is below this one
|
948
|
+
#
|
949
|
+
# If a `MinimumStrictness` level is specified, it will be used in offense messages and autocorrect.
|
950
|
+
#
|
951
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#18
|
952
|
+
class RuboCop::Cop::Sorbet::ValidSigil < ::RuboCop::Cop::Cop
|
953
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#33
|
954
|
+
def autocorrect(_node); end
|
955
|
+
|
956
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#21
|
957
|
+
def investigate(processed_source); end
|
958
|
+
|
959
|
+
protected
|
960
|
+
|
961
|
+
# checks
|
962
|
+
#
|
963
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#68
|
964
|
+
def check_sigil_present(sigil); end
|
965
|
+
|
966
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#125
|
967
|
+
def check_strictness_level(sigil, strictness); end
|
968
|
+
|
969
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#103
|
970
|
+
def check_strictness_not_empty(sigil, strictness); end
|
971
|
+
|
972
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#114
|
973
|
+
def check_strictness_valid(sigil, strictness); end
|
974
|
+
|
975
|
+
# extraction
|
976
|
+
#
|
977
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#56
|
978
|
+
def extract_sigil(processed_source); end
|
979
|
+
|
980
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#62
|
981
|
+
def extract_strictness(sigil); end
|
982
|
+
|
983
|
+
# Default is `nil`
|
984
|
+
#
|
985
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#155
|
986
|
+
def minimum_strictness; end
|
987
|
+
|
988
|
+
# Default is `false`
|
989
|
+
#
|
990
|
+
# @return [Boolean]
|
991
|
+
#
|
992
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#144
|
993
|
+
def require_sigil_on_all_files?; end
|
994
|
+
|
995
|
+
# Default is `'false'`
|
996
|
+
#
|
997
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#149
|
998
|
+
def suggested_strictness; end
|
999
|
+
|
1000
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#84
|
1001
|
+
def suggested_strictness_level(minimum_strictness, suggested_strictness); end
|
1002
|
+
end
|
1003
|
+
|
1004
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#52
|
1005
|
+
RuboCop::Cop::Sorbet::ValidSigil::SIGIL_REGEX = T.let(T.unsafe(nil), Regexp)
|
1006
|
+
|
1007
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#51
|
1008
|
+
RuboCop::Cop::Sorbet::ValidSigil::STRICTNESS_LEVELS = T.let(T.unsafe(nil), Array)
|
1009
|
+
|
1010
|
+
module RuboCop::Cop::Style; end
|
1011
|
+
|
1012
|
+
class RuboCop::Cop::Style::MutableConstant < ::RuboCop::Cop::Base
|
1013
|
+
include ::RuboCop::Cop::Sorbet::MutableConstantSorbetAwareBehaviour
|
1014
|
+
end
|
1015
|
+
|
1016
|
+
# source://rubocop-sorbet//lib/rubocop/sorbet/version.rb#3
|
1017
|
+
module RuboCop::Sorbet; end
|
1018
|
+
|
1019
|
+
# source://rubocop-sorbet//lib/rubocop/sorbet.rb#11
|
1020
|
+
RuboCop::Sorbet::CONFIG = T.let(T.unsafe(nil), Hash)
|
1021
|
+
|
1022
|
+
# source://rubocop-sorbet//lib/rubocop/sorbet.rb#10
|
1023
|
+
RuboCop::Sorbet::CONFIG_DEFAULT = T.let(T.unsafe(nil), Pathname)
|
1024
|
+
|
1025
|
+
# source://rubocop-sorbet//lib/rubocop/sorbet.rb#7
|
1026
|
+
class RuboCop::Sorbet::Error < ::StandardError; end
|
1027
|
+
|
1028
|
+
# Because RuboCop doesn't yet support plugins, we have to monkey patch in a
|
1029
|
+
# bit of our configuration.
|
1030
|
+
#
|
1031
|
+
# source://rubocop-sorbet//lib/rubocop/sorbet/inject.rb#9
|
1032
|
+
module RuboCop::Sorbet::Inject
|
1033
|
+
class << self
|
1034
|
+
# source://rubocop-sorbet//lib/rubocop/sorbet/inject.rb#10
|
1035
|
+
def defaults!; end
|
1036
|
+
end
|
1037
|
+
end
|
1038
|
+
|
1039
|
+
# source://rubocop-sorbet//lib/rubocop/sorbet.rb#9
|
1040
|
+
RuboCop::Sorbet::PROJECT_ROOT = T.let(T.unsafe(nil), Pathname)
|
1041
|
+
|
1042
|
+
# source://rubocop-sorbet//lib/rubocop/sorbet/version.rb#4
|
1043
|
+
RuboCop::Sorbet::VERSION = T.let(T.unsafe(nil), String)
|