tsumanne 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rspec +3 -0
- data/.rubocop.yml +32 -0
- data/.ruby-version +1 -0
- data/LICENSE.txt +21 -0
- data/README.md +31 -0
- data/Rakefile +45 -0
- data/lib/tsumanne/version.rb +7 -0
- data/lib/tsumanne.rb +128 -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/base64@0.1.1.rbi +172 -0
- data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +1083 -0
- data/sorbet/rbi/gems/erubi@1.12.0.rbi +145 -0
- data/sorbet/rbi/gems/ffi-compiler@1.0.1.rbi +206 -0
- data/sorbet/rbi/gems/ffi@1.15.5.rbi +1994 -0
- data/sorbet/rbi/gems/http-parser@1.2.3.rbi +422 -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/mhtml@0.1.6.rbi +353 -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/prettier_print@1.2.1.rbi +951 -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.17.rbi +2967 -0
- data/sorbet/rbi/gems/regexp_parser@2.8.1.rbi +3749 -0
- data/sorbet/rbi/gems/rexml@3.2.6.rbi +4781 -0
- data/sorbet/rbi/gems/rspec-core@3.12.2.rbi +10805 -0
- data/sorbet/rbi/gems/rspec-expectations@3.12.3.rbi +8100 -0
- data/sorbet/rbi/gems/rspec-mocks@3.12.6.rbi +5310 -0
- data/sorbet/rbi/gems/rspec-support@3.12.1.rbi +1609 -0
- data/sorbet/rbi/gems/rspec@3.12.0.rbi +82 -0
- data/sorbet/rbi/gems/rubocop-ast@1.29.0.rbi +7144 -0
- data/sorbet/rbi/gems/rubocop-capybara@2.18.0.rbi +827 -0
- data/sorbet/rbi/gems/rubocop-factory_bot@2.23.1.rbi +812 -0
- data/sorbet/rbi/gems/rubocop-performance@1.19.0.rbi +3157 -0
- data/sorbet/rbi/gems/rubocop-rake@0.6.0.rbi +328 -0
- data/sorbet/rbi/gems/rubocop-rspec@2.23.2.rbi +7691 -0
- data/sorbet/rbi/gems/rubocop-sorbet@0.7.3.rbi +1226 -0
- data/sorbet/rbi/gems/rubocop@1.56.2.rbi +56541 -0
- data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1317 -0
- data/sorbet/rbi/gems/spoom@1.2.3.rbi +3199 -0
- data/sorbet/rbi/gems/syntax_tree@6.1.1.rbi +22855 -0
- data/sorbet/rbi/gems/tapioca@0.11.8.rbi +3329 -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 +425 -0
- data/sorbet/rbi/gems/yard@0.9.34.rbi +18219 -0
- data/sorbet/tapioca/config.yml +13 -0
- data/sorbet/tapioca/require.rb +4 -0
- metadata +254 -0
@@ -0,0 +1,1226 @@
|
|
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#3
|
8
|
+
module RuboCop; end
|
9
|
+
|
10
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#4
|
11
|
+
module RuboCop::Cop; end
|
12
|
+
|
13
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#5
|
14
|
+
module RuboCop::Cop::Sorbet; end
|
15
|
+
|
16
|
+
# 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 its 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::Base
|
32
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb#55
|
33
|
+
def on_block(node); end
|
34
|
+
|
35
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb#55
|
36
|
+
def on_numblock(node); end
|
37
|
+
|
38
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb#49
|
39
|
+
def on_send(node); end
|
40
|
+
|
41
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb#41
|
42
|
+
def override?(param0 = T.unsafe(nil)); end
|
43
|
+
|
44
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb#36
|
45
|
+
def sig?(param0); end
|
46
|
+
|
47
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb#27
|
48
|
+
def sig_dot_override?(param0 = T.unsafe(nil)); end
|
49
|
+
end
|
50
|
+
|
51
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb#22
|
52
|
+
RuboCop::Cop::Sorbet::AllowIncompatibleOverride::MSG = T.let(T.unsafe(nil), String)
|
53
|
+
|
54
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb#24
|
55
|
+
RuboCop::Cop::Sorbet::AllowIncompatibleOverride::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
56
|
+
|
57
|
+
# Disallows binding the return value of `T.any`, `T.all`, `T.enum`
|
58
|
+
# to a constant directly. To bind the value, one must use `T.type_alias`.
|
59
|
+
#
|
60
|
+
# @example
|
61
|
+
#
|
62
|
+
# # bad
|
63
|
+
# FooOrBar = T.any(Foo, Bar)
|
64
|
+
#
|
65
|
+
# # good
|
66
|
+
# FooOrBar = T.type_alias { T.any(Foo, Bar) }
|
67
|
+
#
|
68
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constant_without_type_alias.rb#18
|
69
|
+
class RuboCop::Cop::Sorbet::BindingConstantWithoutTypeAlias < ::RuboCop::Cop::Base
|
70
|
+
extend ::RuboCop::Cop::AutoCorrector
|
71
|
+
|
72
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constant_without_type_alias.rb#65
|
73
|
+
def on_casgn(node); end
|
74
|
+
|
75
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constant_without_type_alias.rb#48
|
76
|
+
def requires_type_alias?(param0 = T.unsafe(nil)); end
|
77
|
+
|
78
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constant_without_type_alias.rb#38
|
79
|
+
def type_alias_with_block?(param0 = T.unsafe(nil)); end
|
80
|
+
|
81
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constant_without_type_alias.rb#29
|
82
|
+
def type_alias_without_block(param0 = T.unsafe(nil)); end
|
83
|
+
|
84
|
+
private
|
85
|
+
|
86
|
+
# Given nested send nodes, returns the leaf with explicit receiver.
|
87
|
+
#
|
88
|
+
# i.e. in Ruby
|
89
|
+
#
|
90
|
+
# a.b.c.d.e.f
|
91
|
+
# ^^^
|
92
|
+
#
|
93
|
+
# i.e. in AST
|
94
|
+
#
|
95
|
+
# (send (send (send (send (send (send nil :a) :b) :c) :d) :e) :f)
|
96
|
+
# ^^^^^^^^^^^^^^^^^^^^^^^
|
97
|
+
#
|
98
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constant_without_type_alias.rb#98
|
99
|
+
def send_leaf(node); end
|
100
|
+
end
|
101
|
+
|
102
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constant_without_type_alias.rb#21
|
103
|
+
RuboCop::Cop::Sorbet::BindingConstantWithoutTypeAlias::MSG = T.let(T.unsafe(nil), String)
|
104
|
+
|
105
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constant_without_type_alias.rb#23
|
106
|
+
RuboCop::Cop::Sorbet::BindingConstantWithoutTypeAlias::WITHOUT_BLOCK_MSG = T.let(T.unsafe(nil), String)
|
107
|
+
|
108
|
+
# Ensures that callback conditionals are bound to the right type
|
109
|
+
# so that they are type checked properly.
|
110
|
+
#
|
111
|
+
# Auto-correction is unsafe because other libraries define similar style callbacks as Rails, but don't always need
|
112
|
+
# binding to the attached class. Auto-correcting those usages can lead to false positives and auto-correction
|
113
|
+
# introduces new typing errors.
|
114
|
+
#
|
115
|
+
# @example
|
116
|
+
#
|
117
|
+
# # bad
|
118
|
+
# class Post < ApplicationRecord
|
119
|
+
# before_create :do_it, if: -> { should_do_it? }
|
120
|
+
#
|
121
|
+
# def should_do_it?
|
122
|
+
# true
|
123
|
+
# end
|
124
|
+
# end
|
125
|
+
#
|
126
|
+
# # good
|
127
|
+
# class Post < ApplicationRecord
|
128
|
+
# before_create :do_it, if: -> {
|
129
|
+
# T.bind(self, Post)
|
130
|
+
# should_do_it?
|
131
|
+
# }
|
132
|
+
#
|
133
|
+
# def should_do_it?
|
134
|
+
# true
|
135
|
+
# end
|
136
|
+
# end
|
137
|
+
#
|
138
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#35
|
139
|
+
class RuboCop::Cop::Sorbet::CallbackConditionalsBinding < ::RuboCop::Cop::Cop
|
140
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#75
|
141
|
+
def autocorrect(node); end
|
142
|
+
|
143
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#127
|
144
|
+
def on_send(node); end
|
145
|
+
end
|
146
|
+
|
147
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#36
|
148
|
+
RuboCop::Cop::Sorbet::CallbackConditionalsBinding::CALLBACKS = T.let(T.unsafe(nil), Array)
|
149
|
+
|
150
|
+
# Disallows the usage of `checked(true)`. This usage could cause
|
151
|
+
# confusion; it could lead some people to believe that a method would be checked
|
152
|
+
# even if runtime checks have not been enabled on the class or globally.
|
153
|
+
# Additionally, in the event where checks are enabled, `checked(true)` would
|
154
|
+
# be redundant; only `checked(false)` or `soft` would change the behaviour.
|
155
|
+
#
|
156
|
+
# @example
|
157
|
+
#
|
158
|
+
# # bad
|
159
|
+
# sig { void.checked(true) }
|
160
|
+
#
|
161
|
+
# # good
|
162
|
+
# sig { void }
|
163
|
+
#
|
164
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb#22
|
165
|
+
class RuboCop::Cop::Sorbet::CheckedTrueInSignature < ::RuboCop::Cop::Sorbet::SignatureCop
|
166
|
+
include ::RuboCop::Cop::RangeHelp
|
167
|
+
|
168
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb#26
|
169
|
+
def offending_node(param0); end
|
170
|
+
|
171
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb#37
|
172
|
+
def on_signature(node); end
|
173
|
+
end
|
174
|
+
|
175
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb#30
|
176
|
+
RuboCop::Cop::Sorbet::CheckedTrueInSignature::MESSAGE = T.let(T.unsafe(nil), String)
|
177
|
+
|
178
|
+
# Disallows the calls that are used to get constants fom Strings
|
179
|
+
# such as +constantize+, +const_get+, and +constants+.
|
180
|
+
#
|
181
|
+
# The goal of this cop is to make the code easier to statically analyze,
|
182
|
+
# more IDE-friendly, and more predictable. It leads to code that clearly
|
183
|
+
# expresses which values the constant can have.
|
184
|
+
#
|
185
|
+
# @example
|
186
|
+
#
|
187
|
+
# # bad
|
188
|
+
# class_name.constantize
|
189
|
+
#
|
190
|
+
# # bad
|
191
|
+
# constants.detect { |c| c.name == "User" }
|
192
|
+
#
|
193
|
+
# # bad
|
194
|
+
# const_get(class_name)
|
195
|
+
#
|
196
|
+
# # good
|
197
|
+
# case class_name
|
198
|
+
# when "User"
|
199
|
+
# User
|
200
|
+
# else
|
201
|
+
# raise ArgumentError
|
202
|
+
# end
|
203
|
+
#
|
204
|
+
# # good
|
205
|
+
# { "User" => User }.fetch(class_name)
|
206
|
+
#
|
207
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/constants_from_strings.rb#37
|
208
|
+
class RuboCop::Cop::Sorbet::ConstantsFromStrings < ::RuboCop::Cop::Cop
|
209
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/constants_from_strings.rb#38
|
210
|
+
def constant_from_string?(param0 = T.unsafe(nil)); end
|
211
|
+
|
212
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/constants_from_strings.rb#42
|
213
|
+
def on_send(node); end
|
214
|
+
end
|
215
|
+
|
216
|
+
# Checks for blank lines after signatures.
|
217
|
+
#
|
218
|
+
# It also suggests an autocorrect
|
219
|
+
#
|
220
|
+
# @example
|
221
|
+
#
|
222
|
+
# # bad
|
223
|
+
# sig { void }
|
224
|
+
#
|
225
|
+
# def foo; end
|
226
|
+
#
|
227
|
+
# # good
|
228
|
+
# sig { void }
|
229
|
+
# def foo; end
|
230
|
+
#
|
231
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb#23
|
232
|
+
class RuboCop::Cop::Sorbet::EmptyLineAfterSig < ::RuboCop::Cop::Sorbet::SignatureCop
|
233
|
+
include ::RuboCop::Cop::RangeHelp
|
234
|
+
|
235
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb#33
|
236
|
+
def autocorrect(node); end
|
237
|
+
|
238
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb#26
|
239
|
+
def on_signature(node); end
|
240
|
+
|
241
|
+
private
|
242
|
+
|
243
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb#48
|
244
|
+
def next_method(node); end
|
245
|
+
end
|
246
|
+
|
247
|
+
# Checks that the Sorbet sigil comes as the first magic comment in the file.
|
248
|
+
#
|
249
|
+
# The expected order for magic comments is: (en)?coding, typed, warn_indent then frozen_string_literal.
|
250
|
+
#
|
251
|
+
# For example, the following bad ordering:
|
252
|
+
#
|
253
|
+
# ```ruby
|
254
|
+
# class Foo; end
|
255
|
+
# ```
|
256
|
+
#
|
257
|
+
# Will be corrected as:
|
258
|
+
#
|
259
|
+
# ```ruby
|
260
|
+
# class Foo; end
|
261
|
+
# ```
|
262
|
+
#
|
263
|
+
# Only `(en)?coding`, `typed`, `warn_indent` and `frozen_string_literal` magic comments are considered,
|
264
|
+
# other comments or magic comments are left in the same place.
|
265
|
+
#
|
266
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#30
|
267
|
+
class RuboCop::Cop::Sorbet::EnforceSigilOrder < ::RuboCop::Cop::Sorbet::ValidSigil
|
268
|
+
include ::RuboCop::Cop::RangeHelp
|
269
|
+
|
270
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#42
|
271
|
+
def autocorrect(_node); end
|
272
|
+
|
273
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#33
|
274
|
+
def investigate(processed_source); end
|
275
|
+
|
276
|
+
protected
|
277
|
+
|
278
|
+
# checks
|
279
|
+
#
|
280
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#92
|
281
|
+
def check_magic_comments_order(tokens); end
|
282
|
+
|
283
|
+
# Get all the tokens in `processed_source` that match `MAGIC_REGEX`
|
284
|
+
#
|
285
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#84
|
286
|
+
def extract_magic_comments(processed_source); end
|
287
|
+
end
|
288
|
+
|
289
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#68
|
290
|
+
RuboCop::Cop::Sorbet::EnforceSigilOrder::CODING_REGEX = T.let(T.unsafe(nil), Regexp)
|
291
|
+
|
292
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#70
|
293
|
+
RuboCop::Cop::Sorbet::EnforceSigilOrder::FROZEN_REGEX = T.let(T.unsafe(nil), Regexp)
|
294
|
+
|
295
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#69
|
296
|
+
RuboCop::Cop::Sorbet::EnforceSigilOrder::INDENT_REGEX = T.let(T.unsafe(nil), Regexp)
|
297
|
+
|
298
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#79
|
299
|
+
RuboCop::Cop::Sorbet::EnforceSigilOrder::MAGIC_REGEX = T.let(T.unsafe(nil), Regexp)
|
300
|
+
|
301
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#72
|
302
|
+
RuboCop::Cop::Sorbet::EnforceSigilOrder::PREFERRED_ORDER = T.let(T.unsafe(nil), Hash)
|
303
|
+
|
304
|
+
# Checks that every method definition and attribute accessor has a Sorbet signature.
|
305
|
+
#
|
306
|
+
# It also suggest an autocorrect with placeholders so the following code:
|
307
|
+
#
|
308
|
+
# ```
|
309
|
+
# def foo(a, b, c); end
|
310
|
+
# ```
|
311
|
+
#
|
312
|
+
# Will be corrected as:
|
313
|
+
#
|
314
|
+
# ```
|
315
|
+
# sig { params(a: T.untyped, b: T.untyped, c: T.untyped).returns(T.untyped)
|
316
|
+
# def foo(a, b, c); end
|
317
|
+
# ```
|
318
|
+
#
|
319
|
+
# You can configure the placeholders used by changing the following options:
|
320
|
+
#
|
321
|
+
# * `ParameterTypePlaceholder`: placeholders used for parameter types (default: 'T.untyped')
|
322
|
+
# * `ReturnTypePlaceholder`: placeholders used for return types (default: 'T.untyped')
|
323
|
+
#
|
324
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#29
|
325
|
+
class RuboCop::Cop::Sorbet::EnforceSignatures < ::RuboCop::Cop::Sorbet::SignatureCop
|
326
|
+
# @return [EnforceSignatures] a new instance of EnforceSignatures
|
327
|
+
#
|
328
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#30
|
329
|
+
def initialize(config = T.unsafe(nil), options = T.unsafe(nil)); end
|
330
|
+
|
331
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#36
|
332
|
+
def accessor?(param0 = T.unsafe(nil)); end
|
333
|
+
|
334
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#56
|
335
|
+
def autocorrect(node); end
|
336
|
+
|
337
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#40
|
338
|
+
def on_def(node); end
|
339
|
+
|
340
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#44
|
341
|
+
def on_defs(node); end
|
342
|
+
|
343
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#48
|
344
|
+
def on_send(node); end
|
345
|
+
|
346
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#52
|
347
|
+
def on_signature(node); end
|
348
|
+
|
349
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#75
|
350
|
+
def scope(node); end
|
351
|
+
|
352
|
+
private
|
353
|
+
|
354
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#84
|
355
|
+
def check_node(node); end
|
356
|
+
|
357
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#95
|
358
|
+
def param_type_placeholder; end
|
359
|
+
|
360
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#99
|
361
|
+
def return_type_placeholder; end
|
362
|
+
end
|
363
|
+
|
364
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#103
|
365
|
+
class RuboCop::Cop::Sorbet::EnforceSignatures::SigSuggestion
|
366
|
+
# @return [SigSuggestion] a new instance of SigSuggestion
|
367
|
+
#
|
368
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#106
|
369
|
+
def initialize(indent, param_placeholder, return_placeholder); end
|
370
|
+
|
371
|
+
# Returns the value of attribute params.
|
372
|
+
#
|
373
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#104
|
374
|
+
def params; end
|
375
|
+
|
376
|
+
# Sets the attribute params
|
377
|
+
#
|
378
|
+
# @param value the value to set the attribute params to.
|
379
|
+
#
|
380
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#104
|
381
|
+
def params=(_arg0); end
|
382
|
+
|
383
|
+
# Returns the value of attribute returns.
|
384
|
+
#
|
385
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#104
|
386
|
+
def returns; end
|
387
|
+
|
388
|
+
# Sets the attribute returns
|
389
|
+
#
|
390
|
+
# @param value the value to set the attribute returns to.
|
391
|
+
#
|
392
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#104
|
393
|
+
def returns=(_arg0); end
|
394
|
+
|
395
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#114
|
396
|
+
def to_autocorrect; end
|
397
|
+
|
398
|
+
private
|
399
|
+
|
400
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#126
|
401
|
+
def generate_params; end
|
402
|
+
|
403
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#138
|
404
|
+
def generate_return; end
|
405
|
+
end
|
406
|
+
|
407
|
+
# Checks that there is only one Sorbet sigil in a given file
|
408
|
+
#
|
409
|
+
# For example, the following class with two sigils
|
410
|
+
#
|
411
|
+
# ```ruby
|
412
|
+
# class Foo; end
|
413
|
+
# ```
|
414
|
+
#
|
415
|
+
# Will be corrected as:
|
416
|
+
#
|
417
|
+
# ```ruby
|
418
|
+
# class Foo; end
|
419
|
+
# ```
|
420
|
+
#
|
421
|
+
# Other comments or magic comments are left in place.
|
422
|
+
#
|
423
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb#26
|
424
|
+
class RuboCop::Cop::Sorbet::EnforceSingleSigil < ::RuboCop::Cop::Sorbet::ValidSigil
|
425
|
+
include ::RuboCop::Cop::RangeHelp
|
426
|
+
|
427
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb#40
|
428
|
+
def autocorrect(_node); end
|
429
|
+
|
430
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb#29
|
431
|
+
def investigate(processed_source); end
|
432
|
+
|
433
|
+
protected
|
434
|
+
|
435
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb#56
|
436
|
+
def extract_all_sigils(processed_source); end
|
437
|
+
end
|
438
|
+
|
439
|
+
# Makes the Sorbet `false` sigil mandatory in all files.
|
440
|
+
#
|
441
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/false_sigil.rb#10
|
442
|
+
class RuboCop::Cop::Sorbet::FalseSigil < ::RuboCop::Cop::Sorbet::HasSigil
|
443
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/false_sigil.rb#11
|
444
|
+
def minimum_strictness; end
|
445
|
+
end
|
446
|
+
|
447
|
+
# Ensures RBI shims do not include a call to extend T::Sig
|
448
|
+
# or to extend T::Helpers
|
449
|
+
#
|
450
|
+
# @example
|
451
|
+
#
|
452
|
+
# # bad
|
453
|
+
# module SomeModule
|
454
|
+
# extend T::Sig
|
455
|
+
# extend T::Helpers
|
456
|
+
#
|
457
|
+
# sig { returns(String) }
|
458
|
+
# def foo; end
|
459
|
+
# end
|
460
|
+
#
|
461
|
+
# # good
|
462
|
+
# module SomeModule
|
463
|
+
# sig { returns(String) }
|
464
|
+
# def foo; end
|
465
|
+
# end
|
466
|
+
#
|
467
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb#25
|
468
|
+
class RuboCop::Cop::Sorbet::ForbidExtendTSigHelpersInShims < ::RuboCop::Cop::Base
|
469
|
+
include ::RuboCop::Cop::RangeHelp
|
470
|
+
extend ::RuboCop::Cop::AutoCorrector
|
471
|
+
|
472
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb#33
|
473
|
+
def extend_t_sig_or_helpers?(param0 = T.unsafe(nil)); end
|
474
|
+
|
475
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb#37
|
476
|
+
def on_send(node); end
|
477
|
+
end
|
478
|
+
|
479
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb#29
|
480
|
+
RuboCop::Cop::Sorbet::ForbidExtendTSigHelpersInShims::MSG = T.let(T.unsafe(nil), String)
|
481
|
+
|
482
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb#30
|
483
|
+
RuboCop::Cop::Sorbet::ForbidExtendTSigHelpersInShims::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
484
|
+
|
485
|
+
# Correct `send` expressions in include statements by constant literals.
|
486
|
+
#
|
487
|
+
# Sorbet, the static checker, is not (yet) able to support constructs on the
|
488
|
+
# following form:
|
489
|
+
#
|
490
|
+
# ```ruby
|
491
|
+
# class MyClass
|
492
|
+
# include send_expr
|
493
|
+
# end
|
494
|
+
# ```
|
495
|
+
#
|
496
|
+
# Multiple occurences of this can be found in Shopify's code base like:
|
497
|
+
#
|
498
|
+
# ```ruby
|
499
|
+
# include Rails.application.routes.url_helpers
|
500
|
+
# ```
|
501
|
+
# or
|
502
|
+
# ```ruby
|
503
|
+
# include Polaris::Engine.helpers
|
504
|
+
# ```
|
505
|
+
#
|
506
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#29
|
507
|
+
class RuboCop::Cop::Sorbet::ForbidIncludeConstLiteral < ::RuboCop::Cop::Cop
|
508
|
+
# @return [ForbidIncludeConstLiteral] a new instance of ForbidIncludeConstLiteral
|
509
|
+
#
|
510
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#41
|
511
|
+
def initialize(*_arg0); end
|
512
|
+
|
513
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#60
|
514
|
+
def autocorrect(node); end
|
515
|
+
|
516
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#35
|
517
|
+
def not_lit_const_include?(param0 = T.unsafe(nil)); end
|
518
|
+
|
519
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#46
|
520
|
+
def on_send(node); end
|
521
|
+
|
522
|
+
# Returns the value of attribute used_names.
|
523
|
+
#
|
524
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#32
|
525
|
+
def used_names; end
|
526
|
+
|
527
|
+
# Sets the attribute used_names
|
528
|
+
#
|
529
|
+
# @param value the value to set the attribute used_names to.
|
530
|
+
#
|
531
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#32
|
532
|
+
def used_names=(_arg0); end
|
533
|
+
end
|
534
|
+
|
535
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#30
|
536
|
+
RuboCop::Cop::Sorbet::ForbidIncludeConstLiteral::MSG = T.let(T.unsafe(nil), String)
|
537
|
+
|
538
|
+
# Makes sure that RBI files are always located under the defined allowed paths.
|
539
|
+
#
|
540
|
+
# Options:
|
541
|
+
#
|
542
|
+
# * `AllowedPaths`: A list of the paths where RBI files are allowed (default: ["rbi/**", "sorbet/rbi/**"])
|
543
|
+
#
|
544
|
+
# @example
|
545
|
+
# # bad
|
546
|
+
# # lib/some_file.rbi
|
547
|
+
# # other_file.rbi
|
548
|
+
#
|
549
|
+
# # good
|
550
|
+
# # rbi/external_interface.rbi
|
551
|
+
# # sorbet/rbi/some_file.rbi
|
552
|
+
# # sorbet/rbi/any/path/for/file.rbi
|
553
|
+
#
|
554
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_rbi_outside_of_allowed_paths.rb#23
|
555
|
+
class RuboCop::Cop::Sorbet::ForbidRBIOutsideOfAllowedPaths < ::RuboCop::Cop::Cop
|
556
|
+
include ::RuboCop::Cop::RangeHelp
|
557
|
+
|
558
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_rbi_outside_of_allowed_paths.rb#26
|
559
|
+
def investigate(processed_source); end
|
560
|
+
|
561
|
+
private
|
562
|
+
|
563
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_rbi_outside_of_allowed_paths.rb#58
|
564
|
+
def allowed_paths; end
|
565
|
+
end
|
566
|
+
|
567
|
+
# Correct superclass `send` expressions by constant literals.
|
568
|
+
#
|
569
|
+
# Sorbet, the static checker, is not (yet) able to support constructs on the
|
570
|
+
# following form:
|
571
|
+
#
|
572
|
+
# ```ruby
|
573
|
+
# class Foo < send_expr; end
|
574
|
+
# ```
|
575
|
+
#
|
576
|
+
# Multiple occurences of this can be found in Shopify's code base like:
|
577
|
+
#
|
578
|
+
# ```ruby
|
579
|
+
# class ShopScope < Component::TrustedIdScope[ShopIdentity::ShopId]
|
580
|
+
# ```
|
581
|
+
# or
|
582
|
+
# ```ruby
|
583
|
+
# class ApiClientEligibility < Struct.new(:api_client, :match_results, :shop)
|
584
|
+
# ```
|
585
|
+
#
|
586
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_superclass_const_literal.rb#28
|
587
|
+
class RuboCop::Cop::Sorbet::ForbidSuperclassConstLiteral < ::RuboCop::Cop::Base
|
588
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_superclass_const_literal.rb#32
|
589
|
+
def dynamic_superclass?(param0 = T.unsafe(nil)); end
|
590
|
+
|
591
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_superclass_const_literal.rb#36
|
592
|
+
def on_class(node); end
|
593
|
+
end
|
594
|
+
|
595
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_superclass_const_literal.rb#29
|
596
|
+
RuboCop::Cop::Sorbet::ForbidSuperclassConstLiteral::MSG = T.let(T.unsafe(nil), String)
|
597
|
+
|
598
|
+
# Disallows using `T.unsafe` anywhere.
|
599
|
+
#
|
600
|
+
# @example
|
601
|
+
#
|
602
|
+
# # bad
|
603
|
+
# T.unsafe(foo)
|
604
|
+
#
|
605
|
+
# # good
|
606
|
+
# foo
|
607
|
+
#
|
608
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_unsafe.rb#17
|
609
|
+
class RuboCop::Cop::Sorbet::ForbidTUnsafe < ::RuboCop::Cop::Base
|
610
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_unsafe.rb#24
|
611
|
+
def on_send(node); end
|
612
|
+
|
613
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_unsafe.rb#22
|
614
|
+
def t_unsafe?(param0 = T.unsafe(nil)); end
|
615
|
+
end
|
616
|
+
|
617
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_unsafe.rb#18
|
618
|
+
RuboCop::Cop::Sorbet::ForbidTUnsafe::MSG = T.let(T.unsafe(nil), String)
|
619
|
+
|
620
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_unsafe.rb#19
|
621
|
+
RuboCop::Cop::Sorbet::ForbidTUnsafe::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
622
|
+
|
623
|
+
# Disallows using `T.untyped` anywhere.
|
624
|
+
#
|
625
|
+
# @example
|
626
|
+
#
|
627
|
+
# # bad
|
628
|
+
# sig { params(my_argument: T.untyped).void }
|
629
|
+
# def foo(my_argument); end
|
630
|
+
#
|
631
|
+
# # good
|
632
|
+
# sig { params(my_argument: String).void }
|
633
|
+
# def foo(my_argument); end
|
634
|
+
#
|
635
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_untyped.rb#20
|
636
|
+
class RuboCop::Cop::Sorbet::ForbidTUntyped < ::RuboCop::Cop::Base
|
637
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_untyped.rb#27
|
638
|
+
def on_send(node); end
|
639
|
+
|
640
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_untyped.rb#25
|
641
|
+
def t_untyped?(param0 = T.unsafe(nil)); end
|
642
|
+
end
|
643
|
+
|
644
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_untyped.rb#21
|
645
|
+
RuboCop::Cop::Sorbet::ForbidTUntyped::MSG = T.let(T.unsafe(nil), String)
|
646
|
+
|
647
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_untyped.rb#22
|
648
|
+
RuboCop::Cop::Sorbet::ForbidTUntyped::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
649
|
+
|
650
|
+
# Disallows use of `T.untyped` or `T.nilable(T.untyped)`
|
651
|
+
# as a prop type for `T::Struct` or `T::ImmutableStruct`.
|
652
|
+
#
|
653
|
+
# @example
|
654
|
+
#
|
655
|
+
# # bad
|
656
|
+
# class SomeClass < T::Struct
|
657
|
+
# const :foo, T.untyped
|
658
|
+
# prop :bar, T.nilable(T.untyped)
|
659
|
+
# end
|
660
|
+
#
|
661
|
+
# # good
|
662
|
+
# class SomeClass < T::Struct
|
663
|
+
# const :foo, Integer
|
664
|
+
# prop :bar, T.nilable(String)
|
665
|
+
# end
|
666
|
+
#
|
667
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#25
|
668
|
+
class RuboCop::Cop::Sorbet::ForbidUntypedStructProps < ::RuboCop::Cop::Base
|
669
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#54
|
670
|
+
def on_class(node); end
|
671
|
+
|
672
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#44
|
673
|
+
def subclass_of_t_struct?(param0 = T.unsafe(nil)); end
|
674
|
+
|
675
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#39
|
676
|
+
def t_nilable_untyped(param0 = T.unsafe(nil)); end
|
677
|
+
|
678
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#29
|
679
|
+
def t_struct(param0 = T.unsafe(nil)); end
|
680
|
+
|
681
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#34
|
682
|
+
def t_untyped(param0 = T.unsafe(nil)); end
|
683
|
+
|
684
|
+
# Search for untyped prop/const declarations and capture their types
|
685
|
+
#
|
686
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#50
|
687
|
+
def untyped_props(param0); end
|
688
|
+
end
|
689
|
+
|
690
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#26
|
691
|
+
RuboCop::Cop::Sorbet::ForbidUntypedStructProps::MSG = T.let(T.unsafe(nil), String)
|
692
|
+
|
693
|
+
# Makes the Sorbet typed sigil mandatory in all files.
|
694
|
+
#
|
695
|
+
# Options:
|
696
|
+
#
|
697
|
+
# * `SuggestedStrictness`: Sorbet strictness level suggested in offense messages (default: 'false')
|
698
|
+
# * `MinimumStrictness`: If set, make offense if the strictness level in the file is below this one
|
699
|
+
#
|
700
|
+
# If a `MinimumStrictness` level is specified, it will be used in offense messages and autocorrect.
|
701
|
+
#
|
702
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/has_sigil.rb#17
|
703
|
+
class RuboCop::Cop::Sorbet::HasSigil < ::RuboCop::Cop::Sorbet::ValidSigil
|
704
|
+
# @return [Boolean]
|
705
|
+
#
|
706
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/has_sigil.rb#20
|
707
|
+
def require_sigil_on_all_files?; end
|
708
|
+
end
|
709
|
+
|
710
|
+
# Makes the Sorbet `ignore` sigil mandatory in all files.
|
711
|
+
#
|
712
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/ignore_sigil.rb#10
|
713
|
+
class RuboCop::Cop::Sorbet::IgnoreSigil < ::RuboCop::Cop::Sorbet::HasSigil
|
714
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/ignore_sigil.rb#11
|
715
|
+
def minimum_strictness; end
|
716
|
+
end
|
717
|
+
|
718
|
+
# Disallows declaring implicit conversion methods.
|
719
|
+
# Since Sorbet is a nominal (not structural) type system,
|
720
|
+
# implicit conversion is currently unsupported.
|
721
|
+
#
|
722
|
+
# @example
|
723
|
+
#
|
724
|
+
# # bad
|
725
|
+
# def to_str; end
|
726
|
+
#
|
727
|
+
# # good
|
728
|
+
# def to_str(x); end
|
729
|
+
#
|
730
|
+
# # bad
|
731
|
+
# def self.to_str; end
|
732
|
+
#
|
733
|
+
# # good
|
734
|
+
# def self.to_str(x); end
|
735
|
+
#
|
736
|
+
# # bad
|
737
|
+
# alias to_str to_s
|
738
|
+
# @note Since the arity of aliased methods is not checked, false positives may result.
|
739
|
+
# @see https://docs.ruby-lang.org/en/master/implicit_conversion_rdoc.html
|
740
|
+
#
|
741
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/implicit_conversion_method.rb#31
|
742
|
+
class RuboCop::Cop::Sorbet::ImplicitConversionMethod < ::RuboCop::Cop::Base
|
743
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/implicit_conversion_method.rb#37
|
744
|
+
def on_alias(node); end
|
745
|
+
|
746
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/implicit_conversion_method.rb#42
|
747
|
+
def on_def(node); end
|
748
|
+
|
749
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/implicit_conversion_method.rb#42
|
750
|
+
def on_defs(node); end
|
751
|
+
|
752
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/implicit_conversion_method.rb#50
|
753
|
+
def on_send(node); end
|
754
|
+
end
|
755
|
+
|
756
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/implicit_conversion_method.rb#32
|
757
|
+
RuboCop::Cop::Sorbet::ImplicitConversionMethod::IMPLICIT_CONVERSION_METHODS = T.let(T.unsafe(nil), Array)
|
758
|
+
|
759
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/implicit_conversion_method.rb#33
|
760
|
+
RuboCop::Cop::Sorbet::ImplicitConversionMethod::MSG = T.let(T.unsafe(nil), String)
|
761
|
+
|
762
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/implicit_conversion_method.rb#35
|
763
|
+
RuboCop::Cop::Sorbet::ImplicitConversionMethod::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
764
|
+
|
765
|
+
# Checks for the ordering of keyword arguments required by
|
766
|
+
# sorbet-runtime. The ordering requires that all keyword arguments
|
767
|
+
# are at the end of the parameters list, and all keyword arguments
|
768
|
+
# with a default value must be after those without default values.
|
769
|
+
#
|
770
|
+
# @example
|
771
|
+
#
|
772
|
+
# # bad
|
773
|
+
# sig { params(a: Integer, b: String).void }
|
774
|
+
# def foo(a: 1, b:); end
|
775
|
+
#
|
776
|
+
# # good
|
777
|
+
# sig { params(b: String, a: Integer).void }
|
778
|
+
# def foo(b:, a: 1); end
|
779
|
+
#
|
780
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/keyword_argument_ordering.rb#23
|
781
|
+
class RuboCop::Cop::Sorbet::KeywordArgumentOrdering < ::RuboCop::Cop::Sorbet::SignatureCop
|
782
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/keyword_argument_ordering.rb#24
|
783
|
+
def on_signature(node); end
|
784
|
+
|
785
|
+
private
|
786
|
+
|
787
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/keyword_argument_ordering.rb#35
|
788
|
+
def check_order_for_kwoptargs(parameters); end
|
789
|
+
end
|
790
|
+
|
791
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#8
|
792
|
+
module RuboCop::Cop::Sorbet::MutableConstantSorbetAwareBehaviour
|
793
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#18
|
794
|
+
def on_assignment(value); end
|
795
|
+
|
796
|
+
class << self
|
797
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#10
|
798
|
+
def prepended(base); end
|
799
|
+
end
|
800
|
+
end
|
801
|
+
|
802
|
+
# Checks for the obsolete pattern for initializing instance variables that was required for older Sorbet
|
803
|
+
#
|
804
|
+
# It's no longer required, as of Sorbet 0.5.10210
|
805
|
+
# See https://sorbet.org/docs/type-assertions#put-type-assertions-behind-memoization
|
806
|
+
#
|
807
|
+
# @example
|
808
|
+
#
|
809
|
+
# # bad
|
810
|
+
# sig { returns(Foo) }
|
811
|
+
# def foo
|
812
|
+
# @foo = T.let(@foo, T.nilable(Foo))
|
813
|
+
# @foo ||= Foo.new
|
814
|
+
# end
|
815
|
+
#
|
816
|
+
# # bad
|
817
|
+
# sig { returns(Foo) }
|
818
|
+
# def foo
|
819
|
+
# # This would have been a mistake, causing the memoized value to be discarded and recomputed on every call.
|
820
|
+
# @foo = T.let(nil, T.nilable(Foo))
|
821
|
+
# @foo ||= Foo.new
|
822
|
+
# end
|
823
|
+
#
|
824
|
+
# # good
|
825
|
+
# sig { returns(Foo) }
|
826
|
+
# def foo
|
827
|
+
# @foo ||= T.let(Foo.new, T.nilable(Foo))
|
828
|
+
# end
|
829
|
+
#
|
830
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/obsolete_strict_memoization.rb#37
|
831
|
+
class RuboCop::Cop::Sorbet::ObsoleteStrictMemoization < ::RuboCop::Cop::Base
|
832
|
+
include ::RuboCop::Cop::RangeHelp
|
833
|
+
include ::RuboCop::Cop::MatchRange
|
834
|
+
include ::RuboCop::Cop::Alignment
|
835
|
+
include ::RuboCop::Cop::LineLengthHelp
|
836
|
+
include ::RuboCop::Cop::Sorbet::TargetSorbetVersion
|
837
|
+
extend ::RuboCop::Cop::AutoCorrector
|
838
|
+
extend ::RuboCop::Cop::Sorbet::TargetSorbetVersion::ClassMethods
|
839
|
+
|
840
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/obsolete_strict_memoization.rb#51
|
841
|
+
def legacy_memoization_pattern?(param0 = T.unsafe(nil)); end
|
842
|
+
|
843
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/obsolete_strict_memoization.rb#62
|
844
|
+
def on_begin(node); end
|
845
|
+
|
846
|
+
# @return [Boolean]
|
847
|
+
#
|
848
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/obsolete_strict_memoization.rb#86
|
849
|
+
def relevant_file?(file); end
|
850
|
+
end
|
851
|
+
|
852
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/obsolete_strict_memoization.rb#47
|
853
|
+
RuboCop::Cop::Sorbet::ObsoleteStrictMemoization::MSG = T.let(T.unsafe(nil), String)
|
854
|
+
|
855
|
+
# Ensures one ancestor per requires_ancestor line
|
856
|
+
# rather than chaining them as a comma-separated list.
|
857
|
+
#
|
858
|
+
# @example
|
859
|
+
#
|
860
|
+
# # bad
|
861
|
+
# module SomeModule
|
862
|
+
# requires_ancestor Kernel, Minitest::Assertions
|
863
|
+
# end
|
864
|
+
#
|
865
|
+
# # good
|
866
|
+
# module SomeModule
|
867
|
+
# requires_ancestor Kernel
|
868
|
+
# requires_ancestor Minitest::Assertions
|
869
|
+
# end
|
870
|
+
#
|
871
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#24
|
872
|
+
class RuboCop::Cop::Sorbet::OneAncestorPerLine < ::RuboCop::Cop::Cop
|
873
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#38
|
874
|
+
def abstract?(param0); end
|
875
|
+
|
876
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#56
|
877
|
+
def autocorrect(node); end
|
878
|
+
|
879
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#33
|
880
|
+
def more_than_one_ancestor(param0 = T.unsafe(nil)); end
|
881
|
+
|
882
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#49
|
883
|
+
def on_class(node); end
|
884
|
+
|
885
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#42
|
886
|
+
def on_module(node); end
|
887
|
+
|
888
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#28
|
889
|
+
def requires_ancestors(param0); end
|
890
|
+
|
891
|
+
private
|
892
|
+
|
893
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#72
|
894
|
+
def new_ra_line(indent_count); end
|
895
|
+
|
896
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#66
|
897
|
+
def process_node(node); end
|
898
|
+
end
|
899
|
+
|
900
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#25
|
901
|
+
RuboCop::Cop::Sorbet::OneAncestorPerLine::MSG = T.let(T.unsafe(nil), String)
|
902
|
+
|
903
|
+
# Forbids the use of redundant `extend T::Sig`. Only for use in
|
904
|
+
# applications that monkey patch `Module.include(T::Sig)` globally,
|
905
|
+
# which would make it redundant.
|
906
|
+
#
|
907
|
+
# @example
|
908
|
+
# # bad
|
909
|
+
# class Example
|
910
|
+
# extend T::Sig
|
911
|
+
# sig { void }
|
912
|
+
# def no_op; end
|
913
|
+
# end
|
914
|
+
#
|
915
|
+
# # good
|
916
|
+
# class Example
|
917
|
+
# sig { void }
|
918
|
+
# def no_op; end
|
919
|
+
# end
|
920
|
+
#
|
921
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb#28
|
922
|
+
class RuboCop::Cop::Sorbet::RedundantExtendTSig < ::RuboCop::Cop::Base
|
923
|
+
extend ::RuboCop::Cop::AutoCorrector
|
924
|
+
|
925
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb#35
|
926
|
+
def extend_t_sig?(param0 = T.unsafe(nil)); end
|
927
|
+
|
928
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb#39
|
929
|
+
def on_send(node); end
|
930
|
+
end
|
931
|
+
|
932
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb#31
|
933
|
+
RuboCop::Cop::Sorbet::RedundantExtendTSig::MSG = T.let(T.unsafe(nil), String)
|
934
|
+
|
935
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb#32
|
936
|
+
RuboCop::Cop::Sorbet::RedundantExtendTSig::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
937
|
+
|
938
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#15
|
939
|
+
class RuboCop::Cop::Sorbet::SignatureBuildOrder < ::RuboCop::Cop::Sorbet::SignatureCop
|
940
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#59
|
941
|
+
def autocorrect(node); end
|
942
|
+
|
943
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#35
|
944
|
+
def on_signature(node); end
|
945
|
+
|
946
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#31
|
947
|
+
def root_call(param0); end
|
948
|
+
|
949
|
+
private
|
950
|
+
|
951
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#101
|
952
|
+
def call_chain(sig_child_node); end
|
953
|
+
|
954
|
+
# @return [Boolean]
|
955
|
+
#
|
956
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#97
|
957
|
+
def can_autocorrect?; end
|
958
|
+
|
959
|
+
# This method exists to reparse the current node with modern features enabled.
|
960
|
+
# Modern features include "index send" emitting, which is necessary to unparse
|
961
|
+
# "index sends" (i.e. `[]` calls) back to index accessors (i.e. as `foo[bar]``).
|
962
|
+
# Otherwise, we would get the unparsed node as `foo.[](bar)`.
|
963
|
+
#
|
964
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#88
|
965
|
+
def node_reparsed_with_modern_features(node); end
|
966
|
+
end
|
967
|
+
|
968
|
+
# Create a subclass of AST Builder that has modern features turned on
|
969
|
+
#
|
970
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#77
|
971
|
+
class RuboCop::Cop::Sorbet::SignatureBuildOrder::ModernBuilder < ::RuboCop::AST::Builder; end
|
972
|
+
|
973
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#16
|
974
|
+
RuboCop::Cop::Sorbet::SignatureBuildOrder::ORDER = T.let(T.unsafe(nil), Hash)
|
975
|
+
|
976
|
+
# Abstract cop specific to Sorbet signatures
|
977
|
+
#
|
978
|
+
# You can subclass it to use the `on_signature` trigger and the `signature?` node matcher.
|
979
|
+
#
|
980
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_cop.rb#11
|
981
|
+
class RuboCop::Cop::Sorbet::SignatureCop < ::RuboCop::Cop::Cop
|
982
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_cop.rb#33
|
983
|
+
def on_block(node); end
|
984
|
+
|
985
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_cop.rb#33
|
986
|
+
def on_numblock(node); end
|
987
|
+
|
988
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_cop.rb#39
|
989
|
+
def on_signature(_); end
|
990
|
+
|
991
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_cop.rb#15
|
992
|
+
def signature?(param0 = T.unsafe(nil)); end
|
993
|
+
|
994
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_cop.rb#24
|
995
|
+
def with_runtime?(param0 = T.unsafe(nil)); end
|
996
|
+
|
997
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_cop.rb#29
|
998
|
+
def without_runtime?(param0 = T.unsafe(nil)); end
|
999
|
+
end
|
1000
|
+
|
1001
|
+
# Ensures empty class/module definitions in RBI files are
|
1002
|
+
# done on a single line rather than being split across multiple lines.
|
1003
|
+
#
|
1004
|
+
# @example
|
1005
|
+
#
|
1006
|
+
# # bad
|
1007
|
+
# module SomeModule
|
1008
|
+
# end
|
1009
|
+
#
|
1010
|
+
# # good
|
1011
|
+
# module SomeModule; end
|
1012
|
+
#
|
1013
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#17
|
1014
|
+
class RuboCop::Cop::Sorbet::SingleLineRbiClassModuleDefinitions < ::RuboCop::Cop::Base
|
1015
|
+
extend ::RuboCop::Cop::AutoCorrector
|
1016
|
+
|
1017
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#22
|
1018
|
+
def on_class(node); end
|
1019
|
+
|
1020
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#22
|
1021
|
+
def on_module(node); end
|
1022
|
+
|
1023
|
+
private
|
1024
|
+
|
1025
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#34
|
1026
|
+
def convert_newlines_to_semicolons(source); end
|
1027
|
+
end
|
1028
|
+
|
1029
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#20
|
1030
|
+
RuboCop::Cop::Sorbet::SingleLineRbiClassModuleDefinitions::MSG = T.let(T.unsafe(nil), String)
|
1031
|
+
|
1032
|
+
# Makes the Sorbet `strict` sigil mandatory in all files.
|
1033
|
+
#
|
1034
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/strict_sigil.rb#10
|
1035
|
+
class RuboCop::Cop::Sorbet::StrictSigil < ::RuboCop::Cop::Sorbet::HasSigil
|
1036
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/strict_sigil.rb#11
|
1037
|
+
def minimum_strictness; end
|
1038
|
+
end
|
1039
|
+
|
1040
|
+
# Makes the Sorbet `strong` sigil mandatory in all files.
|
1041
|
+
#
|
1042
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/strong_sigil.rb#10
|
1043
|
+
class RuboCop::Cop::Sorbet::StrongSigil < ::RuboCop::Cop::Sorbet::HasSigil
|
1044
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/strong_sigil.rb#11
|
1045
|
+
def minimum_strictness; end
|
1046
|
+
end
|
1047
|
+
|
1048
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#6
|
1049
|
+
module RuboCop::Cop::Sorbet::TargetSorbetVersion
|
1050
|
+
mixes_in_class_methods ::RuboCop::Cop::Sorbet::TargetSorbetVersion::ClassMethods
|
1051
|
+
|
1052
|
+
# @return [Boolean]
|
1053
|
+
#
|
1054
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#24
|
1055
|
+
def enabled_for_sorbet_static_version?; end
|
1056
|
+
|
1057
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#40
|
1058
|
+
def read_sorbet_static_version_from_bundler_lock_file; end
|
1059
|
+
|
1060
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#31
|
1061
|
+
def target_sorbet_static_version_from_bundler_lock_file; end
|
1062
|
+
|
1063
|
+
class << self
|
1064
|
+
# @private
|
1065
|
+
#
|
1066
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#8
|
1067
|
+
def included(target); end
|
1068
|
+
end
|
1069
|
+
end
|
1070
|
+
|
1071
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#13
|
1072
|
+
module RuboCop::Cop::Sorbet::TargetSorbetVersion::ClassMethods
|
1073
|
+
# The version of the Sorbet static type checker required by this cop
|
1074
|
+
#
|
1075
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#15
|
1076
|
+
def minimum_target_sorbet_static_version(version); end
|
1077
|
+
|
1078
|
+
# @return [Boolean]
|
1079
|
+
#
|
1080
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#19
|
1081
|
+
def support_target_sorbet_static_version?(version); end
|
1082
|
+
end
|
1083
|
+
|
1084
|
+
# Makes the Sorbet `true` sigil mandatory in all files.
|
1085
|
+
#
|
1086
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/true_sigil.rb#10
|
1087
|
+
class RuboCop::Cop::Sorbet::TrueSigil < ::RuboCop::Cop::Sorbet::HasSigil
|
1088
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/true_sigil.rb#11
|
1089
|
+
def minimum_strictness; end
|
1090
|
+
end
|
1091
|
+
|
1092
|
+
# Ensures all constants used as `T.type_alias` are using CamelCase.
|
1093
|
+
#
|
1094
|
+
# @example
|
1095
|
+
#
|
1096
|
+
# # bad
|
1097
|
+
# FOO_OR_BAR = T.type_alias { T.any(Foo, Bar) }
|
1098
|
+
#
|
1099
|
+
# # good
|
1100
|
+
# FooOrBar = T.type_alias { T.any(Foo, Bar) }
|
1101
|
+
#
|
1102
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/type_alias_name.rb#17
|
1103
|
+
class RuboCop::Cop::Sorbet::TypeAliasName < ::RuboCop::Cop::Base
|
1104
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/type_alias_name.rb#32
|
1105
|
+
def on_casgn(node); end
|
1106
|
+
|
1107
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/type_alias_name.rb#21
|
1108
|
+
def underscored_type_alias?(param0 = T.unsafe(nil)); end
|
1109
|
+
end
|
1110
|
+
|
1111
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/type_alias_name.rb#18
|
1112
|
+
RuboCop::Cop::Sorbet::TypeAliasName::MSG = T.let(T.unsafe(nil), String)
|
1113
|
+
|
1114
|
+
# Checks that every Ruby file contains a valid Sorbet sigil.
|
1115
|
+
# Adapted from: https://gist.github.com/clarkdave/85aca4e16f33fd52aceb6a0a29936e52
|
1116
|
+
#
|
1117
|
+
# Options:
|
1118
|
+
#
|
1119
|
+
# * `RequireSigilOnAllFiles`: make offense if the Sorbet typed is not found in the file (default: false)
|
1120
|
+
# * `SuggestedStrictness`: Sorbet strictness level suggested in offense messages (default: 'false')
|
1121
|
+
# * `MinimumStrictness`: If set, make offense if the strictness level in the file is below this one
|
1122
|
+
# * `ExactStrictness`: If set, make offense if the strictness level in the file is different than this one
|
1123
|
+
#
|
1124
|
+
# If an `ExactStrictness` level is specified, it will be used in offense messages and autocorrect.
|
1125
|
+
# Otherwise, if a `MinimumStrictness` level is specified, it will be used in offense messages and autocorrect.
|
1126
|
+
#
|
1127
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#20
|
1128
|
+
class RuboCop::Cop::Sorbet::ValidSigil < ::RuboCop::Cop::Cop
|
1129
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#35
|
1130
|
+
def autocorrect(_node); end
|
1131
|
+
|
1132
|
+
# So we can properly subclass this cop
|
1133
|
+
#
|
1134
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#23
|
1135
|
+
def investigate(processed_source); end
|
1136
|
+
|
1137
|
+
protected
|
1138
|
+
|
1139
|
+
# checks
|
1140
|
+
#
|
1141
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#70
|
1142
|
+
def check_sigil_present(sigil); end
|
1143
|
+
|
1144
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#130
|
1145
|
+
def check_strictness_level(sigil, strictness); end
|
1146
|
+
|
1147
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#108
|
1148
|
+
def check_strictness_not_empty(sigil, strictness); end
|
1149
|
+
|
1150
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#119
|
1151
|
+
def check_strictness_valid(sigil, strictness); end
|
1152
|
+
|
1153
|
+
# Default is `nil`
|
1154
|
+
#
|
1155
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#180
|
1156
|
+
def exact_strictness; end
|
1157
|
+
|
1158
|
+
# extraction
|
1159
|
+
#
|
1160
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#58
|
1161
|
+
def extract_sigil(processed_source); end
|
1162
|
+
|
1163
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#64
|
1164
|
+
def extract_strictness(sigil); end
|
1165
|
+
|
1166
|
+
# Default is `nil`
|
1167
|
+
#
|
1168
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#174
|
1169
|
+
def minimum_strictness; end
|
1170
|
+
|
1171
|
+
# Default is `false`
|
1172
|
+
#
|
1173
|
+
# @return [Boolean]
|
1174
|
+
#
|
1175
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#163
|
1176
|
+
def require_sigil_on_all_files?; end
|
1177
|
+
|
1178
|
+
# Default is `'false'`
|
1179
|
+
#
|
1180
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#168
|
1181
|
+
def suggested_strictness; end
|
1182
|
+
|
1183
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#86
|
1184
|
+
def suggested_strictness_level; end
|
1185
|
+
end
|
1186
|
+
|
1187
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#54
|
1188
|
+
RuboCop::Cop::Sorbet::ValidSigil::SIGIL_REGEX = T.let(T.unsafe(nil), Regexp)
|
1189
|
+
|
1190
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#53
|
1191
|
+
RuboCop::Cop::Sorbet::ValidSigil::STRICTNESS_LEVELS = T.let(T.unsafe(nil), Array)
|
1192
|
+
|
1193
|
+
module RuboCop::Cop::Style; end
|
1194
|
+
|
1195
|
+
class RuboCop::Cop::Style::MutableConstant < ::RuboCop::Cop::Base
|
1196
|
+
include ::RuboCop::Cop::Sorbet::MutableConstantSorbetAwareBehaviour
|
1197
|
+
end
|
1198
|
+
|
1199
|
+
# source://rubocop-sorbet//lib/rubocop/sorbet/version.rb#4
|
1200
|
+
module RuboCop::Sorbet; end
|
1201
|
+
|
1202
|
+
# source://rubocop-sorbet//lib/rubocop/sorbet.rb#12
|
1203
|
+
RuboCop::Sorbet::CONFIG = T.let(T.unsafe(nil), Hash)
|
1204
|
+
|
1205
|
+
# source://rubocop-sorbet//lib/rubocop/sorbet.rb#11
|
1206
|
+
RuboCop::Sorbet::CONFIG_DEFAULT = T.let(T.unsafe(nil), Pathname)
|
1207
|
+
|
1208
|
+
# source://rubocop-sorbet//lib/rubocop/sorbet.rb#8
|
1209
|
+
class RuboCop::Sorbet::Error < ::StandardError; end
|
1210
|
+
|
1211
|
+
# Because RuboCop doesn't yet support plugins, we have to monkey patch in a
|
1212
|
+
# bit of our configuration.
|
1213
|
+
#
|
1214
|
+
# source://rubocop-sorbet//lib/rubocop/sorbet/inject.rb#9
|
1215
|
+
module RuboCop::Sorbet::Inject
|
1216
|
+
class << self
|
1217
|
+
# source://rubocop-sorbet//lib/rubocop/sorbet/inject.rb#11
|
1218
|
+
def defaults!; end
|
1219
|
+
end
|
1220
|
+
end
|
1221
|
+
|
1222
|
+
# source://rubocop-sorbet//lib/rubocop/sorbet.rb#10
|
1223
|
+
RuboCop::Sorbet::PROJECT_ROOT = T.let(T.unsafe(nil), Pathname)
|
1224
|
+
|
1225
|
+
# source://rubocop-sorbet//lib/rubocop/sorbet/version.rb#5
|
1226
|
+
RuboCop::Sorbet::VERSION = T.let(T.unsafe(nil), String)
|