rubocop-modularization 0.0.1 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +82 -3
- data/config/default.yml +5 -0
- data/lib/rubocop/cop/modularization/namespaced_under_package_name/desired_zeitwerk_api.rb +110 -0
- data/lib/rubocop/cop/modularization/namespaced_under_package_name.rb +119 -0
- data/lib/rubocop/cop/modularization/typed_public_api.rb +39 -0
- data/lib/rubocop/cop/modularization_cops.rb +1 -0
- data/lib/rubocop/modularization/inject.rb +4 -0
- data/lib/rubocop/modularization/private.rb +11 -0
- data/lib/rubocop/modularization.rb +8 -4
- data/lib/rubocop-modularization.rb +5 -2
- data/sorbet/rbi/gems/activesupport@7.0.4.rbi +15914 -0
- data/sorbet/rbi/gems/ast@2.4.2.rbi +584 -0
- data/sorbet/rbi/gems/coderay@1.1.3.rbi +8 -0
- data/sorbet/rbi/gems/concurrent-ruby@1.1.10.rbi +11263 -0
- data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +1079 -0
- data/sorbet/rbi/gems/i18n@1.12.0.rbi +2296 -0
- data/sorbet/rbi/gems/json@2.6.2.rbi +1547 -0
- data/sorbet/rbi/gems/method_source@1.0.0.rbi +8 -0
- data/sorbet/rbi/gems/minitest@5.16.3.rbi +1459 -0
- data/sorbet/rbi/gems/netrc@0.11.0.rbi +161 -0
- data/sorbet/rbi/gems/parallel@1.22.1.rbi +277 -0
- data/sorbet/rbi/gems/parse_packwerk@0.12.1.rbi +203 -0
- data/sorbet/rbi/gems/parser@3.1.2.1.rbi +8944 -0
- data/sorbet/rbi/gems/pry@0.14.1.rbi +8 -0
- data/sorbet/rbi/gems/rainbow@3.1.1.rbi +392 -0
- data/sorbet/rbi/gems/rake@13.0.6.rbi +2899 -0
- data/sorbet/rbi/gems/rbi@0.0.16.rbi +3007 -0
- data/sorbet/rbi/gems/regexp_parser@2.6.0.rbi +3498 -0
- data/sorbet/rbi/gems/rexml@3.2.5.rbi +4717 -0
- data/sorbet/rbi/gems/rspec-core@3.11.0.rbi +10934 -0
- data/sorbet/rbi/gems/rspec-expectations@3.11.1.rbi +8090 -0
- data/sorbet/rbi/gems/rspec-mocks@3.11.1.rbi +5291 -0
- data/sorbet/rbi/gems/rspec-support@3.11.1.rbi +1610 -0
- data/sorbet/rbi/gems/rspec@3.11.0.rbi +88 -0
- data/sorbet/rbi/gems/rubocop-ast@1.21.0.rbi +6898 -0
- data/sorbet/rbi/gems/rubocop-extension-generator@0.5.1.rbi +86 -0
- data/sorbet/rbi/gems/rubocop-sorbet@0.6.11.rbi +1002 -0
- data/sorbet/rbi/gems/rubocop@1.36.0.rbi +52209 -0
- data/sorbet/rbi/gems/ruby-progressbar@1.11.0.rbi +1239 -0
- data/sorbet/rbi/gems/spoom@1.1.12.rbi +2369 -0
- data/sorbet/rbi/gems/tapioca@0.10.2.rbi +3439 -0
- data/sorbet/rbi/gems/thor@1.2.1.rbi +3956 -0
- data/sorbet/rbi/gems/tzinfo@2.0.5.rbi +5896 -0
- data/sorbet/rbi/gems/unicode-display_width@2.3.0.rbi +48 -0
- data/sorbet/rbi/gems/unparser@0.6.5.rbi +4529 -0
- data/sorbet/rbi/gems/webrick@1.7.0.rbi +2586 -0
- data/sorbet/rbi/gems/yard-sorbet@0.7.0.rbi +389 -0
- data/sorbet/rbi/gems/yard@0.9.28.rbi +17775 -0
- data/sorbet/rbi/todo.rbi +0 -3
- metadata +105 -6
@@ -0,0 +1,1002 @@
|
|
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
|
+
# Correct superclass `send` expressions by constant literals.
|
8
|
+
#
|
9
|
+
# Sorbet, the static checker, is not (yet) able to support constructs on the
|
10
|
+
# following form:
|
11
|
+
#
|
12
|
+
# ```ruby
|
13
|
+
# class Foo < send_expr; end
|
14
|
+
# ```
|
15
|
+
#
|
16
|
+
# Multiple occurences of this can be found in Shopify's code base like:
|
17
|
+
#
|
18
|
+
# ```ruby
|
19
|
+
# class ShopScope < Component::TrustedIdScope[ShopIdentity::ShopId]
|
20
|
+
# ```
|
21
|
+
# or
|
22
|
+
# ```ruby
|
23
|
+
# class ApiClientEligibility < Struct.new(:api_client, :match_results, :shop)
|
24
|
+
# ```
|
25
|
+
#
|
26
|
+
# source://rubocop-sorbet//lib/rubocop/sorbet/version.rb#2
|
27
|
+
module RuboCop; end
|
28
|
+
|
29
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb#6
|
30
|
+
module RuboCop::Cop; end
|
31
|
+
|
32
|
+
# source://rubocop/1.36.0/lib/rubocop/cop/mixin/allowed_methods.rb#38
|
33
|
+
RuboCop::Cop::IgnoredMethods = RuboCop::Cop::AllowedMethods
|
34
|
+
|
35
|
+
# source://rubocop/1.36.0/lib/rubocop/cop/mixin/allowed_pattern.rb#54
|
36
|
+
RuboCop::Cop::IgnoredPattern = RuboCop::Cop::AllowedPattern
|
37
|
+
|
38
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb#7
|
39
|
+
module RuboCop::Cop::Sorbet; end
|
40
|
+
|
41
|
+
# This cop disallows using `.override(allow_incompatible: true)`.
|
42
|
+
# Using `allow_incompatible` suggests a violation of the Liskov
|
43
|
+
# Substitution Principle, meaning that a subclass is not a valid
|
44
|
+
# subtype of it's superclass. This Cop prevents these design smells
|
45
|
+
# from occurring.
|
46
|
+
#
|
47
|
+
# @example
|
48
|
+
#
|
49
|
+
# # bad
|
50
|
+
# sig.override(allow_incompatible: true)
|
51
|
+
#
|
52
|
+
# # good
|
53
|
+
# sig.override
|
54
|
+
#
|
55
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb#21
|
56
|
+
class RuboCop::Cop::Sorbet::AllowIncompatibleOverride < ::RuboCop::Cop::Cop
|
57
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb#35
|
58
|
+
def allow_incompatible?(param0); end
|
59
|
+
|
60
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb#39
|
61
|
+
def allow_incompatible_override?(param0 = T.unsafe(nil)); end
|
62
|
+
|
63
|
+
# @return [Boolean]
|
64
|
+
#
|
65
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb#31
|
66
|
+
def not_nil?(node); end
|
67
|
+
|
68
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb#48
|
69
|
+
def on_send(node); end
|
70
|
+
|
71
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/allow_incompatible_override.rb#22
|
72
|
+
def sig?(param0); end
|
73
|
+
end
|
74
|
+
|
75
|
+
# This cop disallows binding the return value of `T.any`, `T.all`, `T.enum`
|
76
|
+
# to a constant directly. To bind the value, one must use `T.type_alias`.
|
77
|
+
#
|
78
|
+
# @example
|
79
|
+
#
|
80
|
+
# # bad
|
81
|
+
# FooOrBar = T.any(Foo, Bar)
|
82
|
+
#
|
83
|
+
# # good
|
84
|
+
# FooOrBar = T.type_alias { T.any(Foo, Bar) }
|
85
|
+
#
|
86
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb#18
|
87
|
+
class RuboCop::Cop::Sorbet::BindingConstantWithoutTypeAlias < ::RuboCop::Cop::Cop
|
88
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb#116
|
89
|
+
def autocorrect(node); end
|
90
|
+
|
91
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb#19
|
92
|
+
def binding_unaliased_type?(param0 = T.unsafe(nil)); end
|
93
|
+
|
94
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb#51
|
95
|
+
def dynamic_type_creation_with_block?(param0 = T.unsafe(nil)); end
|
96
|
+
|
97
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb#66
|
98
|
+
def generic_parameter_decl_block_call?(param0 = T.unsafe(nil)); end
|
99
|
+
|
100
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb#60
|
101
|
+
def generic_parameter_decl_call?(param0 = T.unsafe(nil)); end
|
102
|
+
|
103
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb#72
|
104
|
+
def method_needing_aliasing_on_t?(param0); end
|
105
|
+
|
106
|
+
# @return [Boolean]
|
107
|
+
#
|
108
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb#85
|
109
|
+
def not_dynamic_type_creation_with_block?(node); end
|
110
|
+
|
111
|
+
# @return [Boolean]
|
112
|
+
#
|
113
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb#89
|
114
|
+
def not_generic_parameter_decl?(node); end
|
115
|
+
|
116
|
+
# @return [Boolean]
|
117
|
+
#
|
118
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb#93
|
119
|
+
def not_nil?(node); end
|
120
|
+
|
121
|
+
# @return [Boolean]
|
122
|
+
#
|
123
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb#81
|
124
|
+
def not_t_let?(node); end
|
125
|
+
|
126
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb#97
|
127
|
+
def on_casgn(node); end
|
128
|
+
|
129
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb#41
|
130
|
+
def t_let?(param0 = T.unsafe(nil)); end
|
131
|
+
|
132
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb#32
|
133
|
+
def using_deprecated_type_alias_syntax?(param0 = T.unsafe(nil)); end
|
134
|
+
|
135
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/binding_constants_without_type_alias.rb#23
|
136
|
+
def using_type_alias?(param0 = T.unsafe(nil)); end
|
137
|
+
end
|
138
|
+
|
139
|
+
# This cop ensures that callback conditionals are bound to the right type
|
140
|
+
# so that they are type checked properly.
|
141
|
+
#
|
142
|
+
# Auto-correction is unsafe because other libraries define similar style callbacks as Rails, but don't always need
|
143
|
+
# binding to the attached class. Auto-correcting those usages can lead to false positives and auto-correction
|
144
|
+
# introduces new typing errors.
|
145
|
+
#
|
146
|
+
# @example
|
147
|
+
#
|
148
|
+
# # bad
|
149
|
+
# class Post < ApplicationRecord
|
150
|
+
# before_create :do_it, if: -> { should_do_it? }
|
151
|
+
#
|
152
|
+
# def should_do_it?
|
153
|
+
# true
|
154
|
+
# end
|
155
|
+
# end
|
156
|
+
#
|
157
|
+
# # good
|
158
|
+
# class Post < ApplicationRecord
|
159
|
+
# before_create :do_it, if: -> {
|
160
|
+
# T.bind(self, Post)
|
161
|
+
# should_do_it?
|
162
|
+
# }
|
163
|
+
#
|
164
|
+
# def should_do_it?
|
165
|
+
# true
|
166
|
+
# end
|
167
|
+
# end
|
168
|
+
#
|
169
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#35
|
170
|
+
class RuboCop::Cop::Sorbet::CallbackConditionalsBinding < ::RuboCop::Cop::Cop
|
171
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#47
|
172
|
+
def autocorrect(node); end
|
173
|
+
|
174
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#99
|
175
|
+
def on_send(node); end
|
176
|
+
end
|
177
|
+
|
178
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#36
|
179
|
+
RuboCop::Cop::Sorbet::CallbackConditionalsBinding::CALLBACKS = T.let(T.unsafe(nil), Array)
|
180
|
+
|
181
|
+
# This cop disallows the usage of `checked(true)`. This usage could cause
|
182
|
+
# confusion; it could lead some people to believe that a method would be checked
|
183
|
+
# even if runtime checks have not been enabled on the class or globally.
|
184
|
+
# Additionally, in the event where checks are enabled, `checked(true)` would
|
185
|
+
# be redundant; only `checked(false)` or `soft` would change the behaviour.
|
186
|
+
#
|
187
|
+
# @example
|
188
|
+
#
|
189
|
+
# # bad
|
190
|
+
# sig { void.checked(true) }
|
191
|
+
#
|
192
|
+
# # good
|
193
|
+
# sig { void }
|
194
|
+
#
|
195
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb#22
|
196
|
+
class RuboCop::Cop::Sorbet::CheckedTrueInSignature < ::RuboCop::Cop::Sorbet::SignatureCop
|
197
|
+
include ::RuboCop::Cop::RangeHelp
|
198
|
+
|
199
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb#25
|
200
|
+
def offending_node(param0); end
|
201
|
+
|
202
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb#36
|
203
|
+
def on_signature(node); end
|
204
|
+
end
|
205
|
+
|
206
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb#29
|
207
|
+
RuboCop::Cop::Sorbet::CheckedTrueInSignature::MESSAGE = T.let(T.unsafe(nil), String)
|
208
|
+
|
209
|
+
# This cop disallows the calls that are used to get constants fom Strings
|
210
|
+
# such as +constantize+, +const_get+, and +constants+.
|
211
|
+
#
|
212
|
+
# The goal of this cop is to make the code easier to statically analyze,
|
213
|
+
# more IDE-friendly, and more predictable. It leads to code that clearly
|
214
|
+
# expresses which values the constant can have.
|
215
|
+
#
|
216
|
+
# @example
|
217
|
+
#
|
218
|
+
# # bad
|
219
|
+
# class_name.constantize
|
220
|
+
#
|
221
|
+
# # bad
|
222
|
+
# constants.detect { |c| c.name == "User" }
|
223
|
+
#
|
224
|
+
# # bad
|
225
|
+
# const_get(class_name)
|
226
|
+
#
|
227
|
+
# # good
|
228
|
+
# case class_name
|
229
|
+
# when "User"
|
230
|
+
# User
|
231
|
+
# else
|
232
|
+
# raise ArgumentError
|
233
|
+
# end
|
234
|
+
#
|
235
|
+
# # good
|
236
|
+
# { "User" => User }.fetch(class_name)
|
237
|
+
#
|
238
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/constants_from_strings.rb#36
|
239
|
+
class RuboCop::Cop::Sorbet::ConstantsFromStrings < ::RuboCop::Cop::Cop
|
240
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/constants_from_strings.rb#37
|
241
|
+
def constant_from_string?(param0 = T.unsafe(nil)); end
|
242
|
+
|
243
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/constants_from_strings.rb#41
|
244
|
+
def on_send(node); end
|
245
|
+
end
|
246
|
+
|
247
|
+
# This cop checks that the Sorbet sigil comes as the first magic comment in the file.
|
248
|
+
#
|
249
|
+
# The expected order for magic comments is: typed, (en)?coding, 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 `typed`, `(en)?coding`, `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#91
|
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#83
|
286
|
+
def extract_magic_comments(processed_source); end
|
287
|
+
end
|
288
|
+
|
289
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#67
|
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#69
|
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#68
|
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#78
|
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#71
|
302
|
+
RuboCop::Cop::Sorbet::EnforceSigilOrder::PREFERRED_ORDER = T.let(T.unsafe(nil), Hash)
|
303
|
+
|
304
|
+
# This cop 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#35
|
332
|
+
def accessor?(param0 = T.unsafe(nil)); end
|
333
|
+
|
334
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#55
|
335
|
+
def autocorrect(node); end
|
336
|
+
|
337
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#39
|
338
|
+
def on_def(node); end
|
339
|
+
|
340
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#43
|
341
|
+
def on_defs(node); end
|
342
|
+
|
343
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#47
|
344
|
+
def on_send(node); end
|
345
|
+
|
346
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#51
|
347
|
+
def on_signature(node); end
|
348
|
+
|
349
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#74
|
350
|
+
def scope(node); end
|
351
|
+
|
352
|
+
private
|
353
|
+
|
354
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#82
|
355
|
+
def check_node(node); end
|
356
|
+
|
357
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#93
|
358
|
+
def param_type_placeholder; end
|
359
|
+
|
360
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#97
|
361
|
+
def return_type_placeholder; end
|
362
|
+
end
|
363
|
+
|
364
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#101
|
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#104
|
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#102
|
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#102
|
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#102
|
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#102
|
393
|
+
def returns=(_arg0); end
|
394
|
+
|
395
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#112
|
396
|
+
def to_autocorrect; end
|
397
|
+
|
398
|
+
private
|
399
|
+
|
400
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#124
|
401
|
+
def generate_params; end
|
402
|
+
|
403
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#135
|
404
|
+
def generate_return; end
|
405
|
+
end
|
406
|
+
|
407
|
+
# This cop 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#39
|
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#55
|
436
|
+
def extract_all_sigils(processed_source); end
|
437
|
+
end
|
438
|
+
|
439
|
+
# This cop 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
|
+
# This cop 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::Cop
|
469
|
+
include ::RuboCop::Cop::RangeHelp
|
470
|
+
|
471
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb#39
|
472
|
+
def autocorrect(node); end
|
473
|
+
|
474
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb#35
|
475
|
+
def extend_t_helpers?(param0 = T.unsafe(nil)); end
|
476
|
+
|
477
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb#31
|
478
|
+
def extend_t_sig?(param0 = T.unsafe(nil)); end
|
479
|
+
|
480
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb#47
|
481
|
+
def on_send(node); end
|
482
|
+
end
|
483
|
+
|
484
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb#28
|
485
|
+
RuboCop::Cop::Sorbet::ForbidExtendTSigHelpersInShims::MSG = T.let(T.unsafe(nil), String)
|
486
|
+
|
487
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb#29
|
488
|
+
RuboCop::Cop::Sorbet::ForbidExtendTSigHelpersInShims::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
|
489
|
+
|
490
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#29
|
491
|
+
class RuboCop::Cop::Sorbet::ForbidIncludeConstLiteral < ::RuboCop::Cop::Cop
|
492
|
+
# @return [ForbidIncludeConstLiteral] a new instance of ForbidIncludeConstLiteral
|
493
|
+
#
|
494
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#40
|
495
|
+
def initialize(*_arg0); end
|
496
|
+
|
497
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#56
|
498
|
+
def autocorrect(node); end
|
499
|
+
|
500
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#34
|
501
|
+
def not_lit_const_include?(param0 = T.unsafe(nil)); end
|
502
|
+
|
503
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#45
|
504
|
+
def on_send(node); end
|
505
|
+
|
506
|
+
# Returns the value of attribute used_names.
|
507
|
+
#
|
508
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#32
|
509
|
+
def used_names; end
|
510
|
+
|
511
|
+
# Sets the attribute used_names
|
512
|
+
#
|
513
|
+
# @param value the value to set the attribute used_names to.
|
514
|
+
#
|
515
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#32
|
516
|
+
def used_names=(_arg0); end
|
517
|
+
end
|
518
|
+
|
519
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#30
|
520
|
+
RuboCop::Cop::Sorbet::ForbidIncludeConstLiteral::MSG = T.let(T.unsafe(nil), String)
|
521
|
+
|
522
|
+
# This cop makes sure that RBI files are always located under the defined allowed paths.
|
523
|
+
#
|
524
|
+
# Options:
|
525
|
+
#
|
526
|
+
# * `AllowedPaths`: A list of the paths where RBI files are allowed (default: ["sorbet/rbi/**"])
|
527
|
+
#
|
528
|
+
# @example
|
529
|
+
# # bad
|
530
|
+
# # lib/some_file.rbi
|
531
|
+
# # other_file.rbi
|
532
|
+
#
|
533
|
+
# # good
|
534
|
+
# # sorbet/rbi/some_file.rbi
|
535
|
+
# # sorbet/rbi/any/path/for/file.rbi
|
536
|
+
#
|
537
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_rbi_outside_of_allowed_paths.rb#22
|
538
|
+
class RuboCop::Cop::Sorbet::ForbidRBIOutsideOfAllowedPaths < ::RuboCop::Cop::Cop
|
539
|
+
include ::RuboCop::Cop::RangeHelp
|
540
|
+
|
541
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_rbi_outside_of_allowed_paths.rb#25
|
542
|
+
def investigate(processed_source); end
|
543
|
+
|
544
|
+
private
|
545
|
+
|
546
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_rbi_outside_of_allowed_paths.rb#57
|
547
|
+
def allowed_paths; end
|
548
|
+
end
|
549
|
+
|
550
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_superclass_const_literal.rb#27
|
551
|
+
class RuboCop::Cop::Sorbet::ForbidSuperclassConstLiteral < ::RuboCop::Cop::Cop
|
552
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_superclass_const_literal.rb#30
|
553
|
+
def not_lit_const_superclass?(param0 = T.unsafe(nil)); end
|
554
|
+
|
555
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_superclass_const_literal.rb#38
|
556
|
+
def on_class(node); end
|
557
|
+
end
|
558
|
+
|
559
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_superclass_const_literal.rb#28
|
560
|
+
RuboCop::Cop::Sorbet::ForbidSuperclassConstLiteral::MSG = T.let(T.unsafe(nil), String)
|
561
|
+
|
562
|
+
# This cop disallows using `T.unsafe` anywhere.
|
563
|
+
#
|
564
|
+
# @example
|
565
|
+
#
|
566
|
+
# # bad
|
567
|
+
# T.unsafe(foo)
|
568
|
+
#
|
569
|
+
# # good
|
570
|
+
# foo
|
571
|
+
#
|
572
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_unsafe.rb#17
|
573
|
+
class RuboCop::Cop::Sorbet::ForbidTUnsafe < ::RuboCop::Cop::Cop
|
574
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_unsafe.rb#20
|
575
|
+
def on_send(node); end
|
576
|
+
|
577
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_unsafe.rb#18
|
578
|
+
def t_unsafe?(param0 = T.unsafe(nil)); end
|
579
|
+
end
|
580
|
+
|
581
|
+
# This cop disallows using `T.untyped` anywhere.
|
582
|
+
#
|
583
|
+
# @example
|
584
|
+
#
|
585
|
+
# # bad
|
586
|
+
# sig { params(my_argument: T.untyped).void }
|
587
|
+
# def foo(my_argument); end
|
588
|
+
#
|
589
|
+
# # good
|
590
|
+
# sig { params(my_argument: String).void }
|
591
|
+
# def foo(my_argument); end
|
592
|
+
#
|
593
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_untyped.rb#20
|
594
|
+
class RuboCop::Cop::Sorbet::ForbidTUntyped < ::RuboCop::Cop::Cop
|
595
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_untyped.rb#23
|
596
|
+
def on_send(node); end
|
597
|
+
|
598
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_untyped.rb#21
|
599
|
+
def t_untyped?(param0 = T.unsafe(nil)); end
|
600
|
+
end
|
601
|
+
|
602
|
+
# This cop disallows use of `T.untyped` or `T.nilable(T.untyped)`
|
603
|
+
# as a prop type for `T::Struct`.
|
604
|
+
#
|
605
|
+
# @example
|
606
|
+
#
|
607
|
+
# # bad
|
608
|
+
# class SomeClass
|
609
|
+
# const :foo, T.untyped
|
610
|
+
# prop :bar, T.nilable(T.untyped)
|
611
|
+
# end
|
612
|
+
#
|
613
|
+
# # good
|
614
|
+
# class SomeClass
|
615
|
+
# const :foo, Integer
|
616
|
+
# prop :bar, T.nilable(String)
|
617
|
+
# end
|
618
|
+
#
|
619
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#25
|
620
|
+
class RuboCop::Cop::Sorbet::ForbidUntypedStructProps < ::RuboCop::Cop::Cop
|
621
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#48
|
622
|
+
def on_class(node); end
|
623
|
+
|
624
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#40
|
625
|
+
def subclass_of_t_struct?(param0 = T.unsafe(nil)); end
|
626
|
+
|
627
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#36
|
628
|
+
def t_nilable_untyped(param0 = T.unsafe(nil)); end
|
629
|
+
|
630
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#28
|
631
|
+
def t_struct(param0 = T.unsafe(nil)); end
|
632
|
+
|
633
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#32
|
634
|
+
def t_untyped(param0 = T.unsafe(nil)); end
|
635
|
+
|
636
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#44
|
637
|
+
def untyped_props(param0); end
|
638
|
+
end
|
639
|
+
|
640
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#26
|
641
|
+
RuboCop::Cop::Sorbet::ForbidUntypedStructProps::MSG = T.let(T.unsafe(nil), String)
|
642
|
+
|
643
|
+
# This cop makes the Sorbet typed sigil mandatory in all files.
|
644
|
+
#
|
645
|
+
# Options:
|
646
|
+
#
|
647
|
+
# * `SuggestedStrictness`: Sorbet strictness level suggested in offense messages (default: 'false')
|
648
|
+
# * `MinimumStrictness`: If set, make offense if the strictness level in the file is below this one
|
649
|
+
#
|
650
|
+
# If a `MinimumStrictness` level is specified, it will be used in offense messages and autocorrect.
|
651
|
+
#
|
652
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/has_sigil.rb#17
|
653
|
+
class RuboCop::Cop::Sorbet::HasSigil < ::RuboCop::Cop::Sorbet::ValidSigil
|
654
|
+
# @return [Boolean]
|
655
|
+
#
|
656
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/has_sigil.rb#20
|
657
|
+
def require_sigil_on_all_files?; end
|
658
|
+
end
|
659
|
+
|
660
|
+
# This cop makes the Sorbet `ignore` sigil mandatory in all files.
|
661
|
+
#
|
662
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/ignore_sigil.rb#10
|
663
|
+
class RuboCop::Cop::Sorbet::IgnoreSigil < ::RuboCop::Cop::Sorbet::HasSigil
|
664
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/ignore_sigil.rb#11
|
665
|
+
def minimum_strictness; end
|
666
|
+
end
|
667
|
+
|
668
|
+
# This cop checks for the ordering of keyword arguments required by
|
669
|
+
# sorbet-runtime. The ordering requires that all keyword arguments
|
670
|
+
# are at the end of the parameters list, and all keyword arguments
|
671
|
+
# with a default value must be after those without default values.
|
672
|
+
#
|
673
|
+
# @example
|
674
|
+
#
|
675
|
+
# # bad
|
676
|
+
# sig { params(a: Integer, b: String).void }
|
677
|
+
# def foo(a: 1, b:); end
|
678
|
+
#
|
679
|
+
# # good
|
680
|
+
# sig { params(b: String, a: Integer).void }
|
681
|
+
# def foo(b:, a: 1); end
|
682
|
+
#
|
683
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/keyword_argument_ordering.rb#23
|
684
|
+
class RuboCop::Cop::Sorbet::KeywordArgumentOrdering < ::RuboCop::Cop::Sorbet::SignatureCop
|
685
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/keyword_argument_ordering.rb#24
|
686
|
+
def on_signature(node); end
|
687
|
+
|
688
|
+
private
|
689
|
+
|
690
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/keyword_argument_ordering.rb#34
|
691
|
+
def check_order_for_kwoptargs(parameters); end
|
692
|
+
end
|
693
|
+
|
694
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#8
|
695
|
+
module RuboCop::Cop::Sorbet::MutableConstantSorbetAwareBehaviour
|
696
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#15
|
697
|
+
def on_assignment(value); end
|
698
|
+
|
699
|
+
class << self
|
700
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#9
|
701
|
+
def prepended(base); end
|
702
|
+
end
|
703
|
+
end
|
704
|
+
|
705
|
+
# This cop ensures one ancestor per requires_ancestor line
|
706
|
+
# rather than chaining them as a comma-separated list.
|
707
|
+
#
|
708
|
+
# @example
|
709
|
+
#
|
710
|
+
# # bad
|
711
|
+
# module SomeModule
|
712
|
+
# requires_ancestor Kernel, Minitest::Assertions
|
713
|
+
# end
|
714
|
+
#
|
715
|
+
# # good
|
716
|
+
# module SomeModule
|
717
|
+
# requires_ancestor Kernel
|
718
|
+
# requires_ancestor Minitest::Assertions
|
719
|
+
# end
|
720
|
+
#
|
721
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#24
|
722
|
+
class RuboCop::Cop::Sorbet::OneAncestorPerLine < ::RuboCop::Cop::Cop
|
723
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#35
|
724
|
+
def abstract?(param0); end
|
725
|
+
|
726
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#51
|
727
|
+
def autocorrect(node); end
|
728
|
+
|
729
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#31
|
730
|
+
def more_than_one_ancestor(param0 = T.unsafe(nil)); end
|
731
|
+
|
732
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#45
|
733
|
+
def on_class(node); end
|
734
|
+
|
735
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#39
|
736
|
+
def on_module(node); end
|
737
|
+
|
738
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#27
|
739
|
+
def requires_ancestors(param0); end
|
740
|
+
|
741
|
+
private
|
742
|
+
|
743
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#67
|
744
|
+
def new_ra_line(indent_count); end
|
745
|
+
|
746
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#61
|
747
|
+
def process_node(node); end
|
748
|
+
end
|
749
|
+
|
750
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#25
|
751
|
+
RuboCop::Cop::Sorbet::OneAncestorPerLine::MSG = T.let(T.unsafe(nil), String)
|
752
|
+
|
753
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#15
|
754
|
+
class RuboCop::Cop::Sorbet::SignatureBuildOrder < ::RuboCop::Cop::Sorbet::SignatureCop
|
755
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#54
|
756
|
+
def autocorrect(node); end
|
757
|
+
|
758
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#34
|
759
|
+
def on_signature(node); end
|
760
|
+
|
761
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#30
|
762
|
+
def root_call(param0); end
|
763
|
+
|
764
|
+
private
|
765
|
+
|
766
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#96
|
767
|
+
def call_chain(sig_child_node); end
|
768
|
+
|
769
|
+
# @return [Boolean]
|
770
|
+
#
|
771
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#92
|
772
|
+
def can_autocorrect?; end
|
773
|
+
|
774
|
+
# This method exists to reparse the current node with modern features enabled.
|
775
|
+
# Modern features include "index send" emitting, which is necessary to unparse
|
776
|
+
# "index sends" (i.e. `[]` calls) back to index accessors (i.e. as `foo[bar]``).
|
777
|
+
# Otherwise, we would get the unparsed node as `foo.[](bar)`.
|
778
|
+
#
|
779
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#83
|
780
|
+
def node_reparsed_with_modern_features(node); end
|
781
|
+
end
|
782
|
+
|
783
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#16
|
784
|
+
RuboCop::Cop::Sorbet::SignatureBuildOrder::ORDER = T.let(T.unsafe(nil), Hash)
|
785
|
+
|
786
|
+
# Abstract cop specific to Sorbet signatures
|
787
|
+
#
|
788
|
+
# You can subclass it to use the `on_signature` trigger and the `signature?` node matcher.
|
789
|
+
#
|
790
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_cop.rb#11
|
791
|
+
class RuboCop::Cop::Sorbet::SignatureCop < ::RuboCop::Cop::Cop
|
792
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_cop.rb#26
|
793
|
+
def allowed_recv(recv); end
|
794
|
+
|
795
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_cop.rb#33
|
796
|
+
def on_block(node); end
|
797
|
+
|
798
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_cop.rb#37
|
799
|
+
def on_signature(_); end
|
800
|
+
|
801
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_cop.rb#14
|
802
|
+
def signature?(param0 = T.unsafe(nil)); end
|
803
|
+
|
804
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_cop.rb#18
|
805
|
+
def with_runtime?(param0 = T.unsafe(nil)); end
|
806
|
+
|
807
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_cop.rb#22
|
808
|
+
def without_runtime?(param0 = T.unsafe(nil)); end
|
809
|
+
end
|
810
|
+
|
811
|
+
# This cop ensures empty class/module definitions in RBI files are
|
812
|
+
# done on a single line rather than being split across multiple lines.
|
813
|
+
#
|
814
|
+
# @example
|
815
|
+
#
|
816
|
+
# # bad
|
817
|
+
# module SomeModule
|
818
|
+
# end
|
819
|
+
#
|
820
|
+
# # good
|
821
|
+
# module SomeModule; end
|
822
|
+
#
|
823
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#17
|
824
|
+
class RuboCop::Cop::Sorbet::SingleLineRbiClassModuleDefinitions < ::RuboCop::Cop::Cop
|
825
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#28
|
826
|
+
def autocorrect(node); end
|
827
|
+
|
828
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#24
|
829
|
+
def on_class(node); end
|
830
|
+
|
831
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#20
|
832
|
+
def on_module(node); end
|
833
|
+
|
834
|
+
protected
|
835
|
+
|
836
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#34
|
837
|
+
def convert_newlines(source); end
|
838
|
+
|
839
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#38
|
840
|
+
def process_node(node); end
|
841
|
+
end
|
842
|
+
|
843
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#18
|
844
|
+
RuboCop::Cop::Sorbet::SingleLineRbiClassModuleDefinitions::MSG = T.let(T.unsafe(nil), String)
|
845
|
+
|
846
|
+
# This cop makes the Sorbet `strict` sigil mandatory in all files.
|
847
|
+
#
|
848
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/strict_sigil.rb#10
|
849
|
+
class RuboCop::Cop::Sorbet::StrictSigil < ::RuboCop::Cop::Sorbet::HasSigil
|
850
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/strict_sigil.rb#11
|
851
|
+
def minimum_strictness; end
|
852
|
+
end
|
853
|
+
|
854
|
+
# This cop makes the Sorbet `strong` sigil mandatory in all files.
|
855
|
+
#
|
856
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/strong_sigil.rb#10
|
857
|
+
class RuboCop::Cop::Sorbet::StrongSigil < ::RuboCop::Cop::Sorbet::HasSigil
|
858
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/strong_sigil.rb#11
|
859
|
+
def minimum_strictness; end
|
860
|
+
end
|
861
|
+
|
862
|
+
# This cop makes the Sorbet `true` sigil mandatory in all files.
|
863
|
+
#
|
864
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/true_sigil.rb#10
|
865
|
+
class RuboCop::Cop::Sorbet::TrueSigil < ::RuboCop::Cop::Sorbet::HasSigil
|
866
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/true_sigil.rb#11
|
867
|
+
def minimum_strictness; end
|
868
|
+
end
|
869
|
+
|
870
|
+
# This cop ensures all constants used as `T.type_alias` are using CamelCase.
|
871
|
+
#
|
872
|
+
# @example
|
873
|
+
#
|
874
|
+
# # bad
|
875
|
+
# FOO_OR_BAR = T.type_alias { T.any(Foo, Bar) }
|
876
|
+
#
|
877
|
+
# # good
|
878
|
+
# FooOrBar = T.type_alias { T.any(Foo, Bar) }
|
879
|
+
#
|
880
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/type_alias_name.rb#17
|
881
|
+
class RuboCop::Cop::Sorbet::TypeAliasName < ::RuboCop::Cop::Cop
|
882
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/type_alias_name.rb#20
|
883
|
+
def casgn_type_alias?(param0 = T.unsafe(nil)); end
|
884
|
+
|
885
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/type_alias_name.rb#32
|
886
|
+
def on_casgn(node); end
|
887
|
+
end
|
888
|
+
|
889
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/type_alias_name.rb#18
|
890
|
+
RuboCop::Cop::Sorbet::TypeAliasName::MSG = T.let(T.unsafe(nil), String)
|
891
|
+
|
892
|
+
# This cop checks that every Ruby file contains a valid Sorbet sigil.
|
893
|
+
# Adapted from: https://gist.github.com/clarkdave/85aca4e16f33fd52aceb6a0a29936e52
|
894
|
+
#
|
895
|
+
# Options:
|
896
|
+
#
|
897
|
+
# * `RequireSigilOnAllFiles`: make offense if the Sorbet typed is not found in the file (default: false)
|
898
|
+
# * `SuggestedStrictness`: Sorbet strictness level suggested in offense messages (default: 'false')
|
899
|
+
# * `MinimumStrictness`: If set, make offense if the strictness level in the file is below this one
|
900
|
+
#
|
901
|
+
# If a `MinimumStrictness` level is specified, it will be used in offense messages and autocorrect.
|
902
|
+
#
|
903
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#18
|
904
|
+
class RuboCop::Cop::Sorbet::ValidSigil < ::RuboCop::Cop::Cop
|
905
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#33
|
906
|
+
def autocorrect(_node); end
|
907
|
+
|
908
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#21
|
909
|
+
def investigate(processed_source); end
|
910
|
+
|
911
|
+
protected
|
912
|
+
|
913
|
+
# checks
|
914
|
+
#
|
915
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#68
|
916
|
+
def check_sigil_present(sigil); end
|
917
|
+
|
918
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#125
|
919
|
+
def check_strictness_level(sigil, strictness); end
|
920
|
+
|
921
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#103
|
922
|
+
def check_strictness_not_empty(sigil, strictness); end
|
923
|
+
|
924
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#114
|
925
|
+
def check_strictness_valid(sigil, strictness); end
|
926
|
+
|
927
|
+
# extraction
|
928
|
+
#
|
929
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#56
|
930
|
+
def extract_sigil(processed_source); end
|
931
|
+
|
932
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#62
|
933
|
+
def extract_strictness(sigil); end
|
934
|
+
|
935
|
+
# Default is `nil`
|
936
|
+
#
|
937
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#155
|
938
|
+
def minimum_strictness; end
|
939
|
+
|
940
|
+
# Default is `false`
|
941
|
+
#
|
942
|
+
# @return [Boolean]
|
943
|
+
#
|
944
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#144
|
945
|
+
def require_sigil_on_all_files?; end
|
946
|
+
|
947
|
+
# Default is `'false'`
|
948
|
+
#
|
949
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#149
|
950
|
+
def suggested_strictness; end
|
951
|
+
|
952
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#84
|
953
|
+
def suggested_strictness_level(minimum_strictness, suggested_strictness); end
|
954
|
+
end
|
955
|
+
|
956
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#52
|
957
|
+
RuboCop::Cop::Sorbet::ValidSigil::SIGIL_REGEX = T.let(T.unsafe(nil), Regexp)
|
958
|
+
|
959
|
+
# source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#51
|
960
|
+
RuboCop::Cop::Sorbet::ValidSigil::STRICTNESS_LEVELS = T.let(T.unsafe(nil), Array)
|
961
|
+
|
962
|
+
class RuboCop::Cop::Style::MutableConstant < ::RuboCop::Cop::Base
|
963
|
+
include ::RuboCop::Cop::Sorbet::MutableConstantSorbetAwareBehaviour
|
964
|
+
end
|
965
|
+
|
966
|
+
# source://rubocop/1.36.0/lib/rubocop/ast_aliases.rb#5
|
967
|
+
RuboCop::NodePattern = RuboCop::AST::NodePattern
|
968
|
+
|
969
|
+
# source://rubocop/1.36.0/lib/rubocop/ast_aliases.rb#6
|
970
|
+
RuboCop::ProcessedSource = RuboCop::AST::ProcessedSource
|
971
|
+
|
972
|
+
# source://rubocop-sorbet//lib/rubocop/sorbet/version.rb#3
|
973
|
+
module RuboCop::Sorbet; end
|
974
|
+
|
975
|
+
# source://rubocop-sorbet//lib/rubocop/sorbet.rb#11
|
976
|
+
RuboCop::Sorbet::CONFIG = T.let(T.unsafe(nil), Hash)
|
977
|
+
|
978
|
+
# source://rubocop-sorbet//lib/rubocop/sorbet.rb#10
|
979
|
+
RuboCop::Sorbet::CONFIG_DEFAULT = T.let(T.unsafe(nil), Pathname)
|
980
|
+
|
981
|
+
# source://rubocop-sorbet//lib/rubocop/sorbet.rb#7
|
982
|
+
class RuboCop::Sorbet::Error < ::StandardError; end
|
983
|
+
|
984
|
+
# Because RuboCop doesn't yet support plugins, we have to monkey patch in a
|
985
|
+
# bit of our configuration.
|
986
|
+
#
|
987
|
+
# source://rubocop-sorbet//lib/rubocop/sorbet/inject.rb#9
|
988
|
+
module RuboCop::Sorbet::Inject
|
989
|
+
class << self
|
990
|
+
# source://rubocop-sorbet//lib/rubocop/sorbet/inject.rb#10
|
991
|
+
def defaults!; end
|
992
|
+
end
|
993
|
+
end
|
994
|
+
|
995
|
+
# source://rubocop-sorbet//lib/rubocop/sorbet.rb#9
|
996
|
+
RuboCop::Sorbet::PROJECT_ROOT = T.let(T.unsafe(nil), Pathname)
|
997
|
+
|
998
|
+
# source://rubocop-sorbet//lib/rubocop/sorbet/version.rb#4
|
999
|
+
RuboCop::Sorbet::VERSION = T.let(T.unsafe(nil), String)
|
1000
|
+
|
1001
|
+
# source://rubocop/1.36.0/lib/rubocop/ast_aliases.rb#7
|
1002
|
+
RuboCop::Token = RuboCop::AST::Token
|