lunchmoney 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. checksums.yaml +7 -0
  2. data/.DS_Store +0 -0
  3. data/.github/dependabot.yml +18 -0
  4. data/.github/workflows/build_and_publish_yard_docs.yml +47 -0
  5. data/.github/workflows/ci.yml +58 -0
  6. data/.github/workflows/dependabot-rbi-updater.yml +43 -0
  7. data/.github/workflows/publish_gem.yml +31 -0
  8. data/.gitignore +62 -0
  9. data/.rubocop.yml +45 -0
  10. data/.ruby-version +1 -0
  11. data/.toys/.toys.rb +10 -0
  12. data/.toys/ci.rb +22 -0
  13. data/.toys/rbi.rb +60 -0
  14. data/.toys/rubocop.rb +10 -0
  15. data/.toys/spoom.rb +15 -0
  16. data/.toys/typecheck.rb +5 -0
  17. data/.yardopts +2 -0
  18. data/Appraisals +22 -0
  19. data/Gemfile +25 -0
  20. data/Gemfile.lock +174 -0
  21. data/LICENSE +21 -0
  22. data/README.md +57 -0
  23. data/bin/console +16 -0
  24. data/bin/rubocop +27 -0
  25. data/bin/setup +8 -0
  26. data/bin/spoom +27 -0
  27. data/bin/srb +27 -0
  28. data/bin/tapioca +27 -0
  29. data/bin/toys +27 -0
  30. data/bin/yard +27 -0
  31. data/lib/lunchmoney/api.rb +147 -0
  32. data/lib/lunchmoney/api_call.rb +109 -0
  33. data/lib/lunchmoney/assets/asset.rb +89 -0
  34. data/lib/lunchmoney/assets/asset_calls.rb +96 -0
  35. data/lib/lunchmoney/budget/budget.rb +74 -0
  36. data/lib/lunchmoney/budget/budget_calls.rb +82 -0
  37. data/lib/lunchmoney/budget/config.rb +38 -0
  38. data/lib/lunchmoney/budget/data.rb +42 -0
  39. data/lib/lunchmoney/categories/category/category.rb +52 -0
  40. data/lib/lunchmoney/categories/category/child_category.rb +42 -0
  41. data/lib/lunchmoney/categories/category_calls.rb +195 -0
  42. data/lib/lunchmoney/configuration.rb +26 -0
  43. data/lib/lunchmoney/crypto/crypto/crypto.rb +43 -0
  44. data/lib/lunchmoney/crypto/crypto/crypto_base.rb +65 -0
  45. data/lib/lunchmoney/crypto/crypto_calls.rb +49 -0
  46. data/lib/lunchmoney/data_object.rb +25 -0
  47. data/lib/lunchmoney/errors.rb +19 -0
  48. data/lib/lunchmoney/exceptions.rb +19 -0
  49. data/lib/lunchmoney/plaid_accounts/plaid_account.rb +73 -0
  50. data/lib/lunchmoney/plaid_accounts/plaid_account_calls.rb +38 -0
  51. data/lib/lunchmoney/recurring_expenses/recurring_expense/recurring_expense.rb +65 -0
  52. data/lib/lunchmoney/recurring_expenses/recurring_expense/recurring_expense_base.rb +29 -0
  53. data/lib/lunchmoney/recurring_expenses/recurring_expense_calls.rb +28 -0
  54. data/lib/lunchmoney/tags/tag/tag.rb +20 -0
  55. data/lib/lunchmoney/tags/tag/tag_base.rb +21 -0
  56. data/lib/lunchmoney/tags/tag_calls.rb +20 -0
  57. data/lib/lunchmoney/transactions/transaction/child_transaction.rb +31 -0
  58. data/lib/lunchmoney/transactions/transaction/split.rb +24 -0
  59. data/lib/lunchmoney/transactions/transaction/transaction.rb +156 -0
  60. data/lib/lunchmoney/transactions/transaction/transaction_base.rb +52 -0
  61. data/lib/lunchmoney/transactions/transaction/transaction_modification_base.rb +30 -0
  62. data/lib/lunchmoney/transactions/transaction/update_transaction.rb +43 -0
  63. data/lib/lunchmoney/transactions/transaction_calls.rb +218 -0
  64. data/lib/lunchmoney/user/user.rb +36 -0
  65. data/lib/lunchmoney/user/user_calls.rb +19 -0
  66. data/lib/lunchmoney/validators.rb +43 -0
  67. data/lib/lunchmoney/version.rb +7 -0
  68. data/lib/lunchmoney.rb +54 -0
  69. data/lunchmoney.gemspec +34 -0
  70. data/sorbet/config +5 -0
  71. data/sorbet/rbi/annotations/.gitattributes +1 -0
  72. data/sorbet/rbi/annotations/activesupport.rbi +410 -0
  73. data/sorbet/rbi/annotations/faraday.rbi +17 -0
  74. data/sorbet/rbi/annotations/mocha.rbi +34 -0
  75. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  76. data/sorbet/rbi/annotations/webmock.rbi +9 -0
  77. data/sorbet/rbi/dsl/.gitattributes +1 -0
  78. data/sorbet/rbi/dsl/active_support/callbacks.rbi +22 -0
  79. data/sorbet/rbi/gems/.gitattributes +1 -0
  80. data/sorbet/rbi/gems/activesupport@7.1.3.rbi +18004 -0
  81. data/sorbet/rbi/gems/addressable@2.8.6.rbi +1993 -0
  82. data/sorbet/rbi/gems/appraisal@2.5.0.rbi +621 -0
  83. data/sorbet/rbi/gems/ast@2.4.2.rbi +584 -0
  84. data/sorbet/rbi/gems/base64@0.2.0.rbi +508 -0
  85. data/sorbet/rbi/gems/bigdecimal@3.1.6.rbi +77 -0
  86. data/sorbet/rbi/gems/coderay@1.1.3.rbi +3426 -0
  87. data/sorbet/rbi/gems/concurrent-ruby@1.2.3.rbi +11590 -0
  88. data/sorbet/rbi/gems/connection_pool@2.4.1.rbi +8 -0
  89. data/sorbet/rbi/gems/crack@0.4.5.rbi +144 -0
  90. data/sorbet/rbi/gems/dotenv@2.8.1.rbi +234 -0
  91. data/sorbet/rbi/gems/drb@2.2.0.rbi +1346 -0
  92. data/sorbet/rbi/gems/erubi@1.12.0.rbi +145 -0
  93. data/sorbet/rbi/gems/faraday-net_http@3.1.0.rbi +146 -0
  94. data/sorbet/rbi/gems/faraday@2.9.0.rbi +2911 -0
  95. data/sorbet/rbi/gems/hashdiff@1.1.0.rbi +352 -0
  96. data/sorbet/rbi/gems/i18n@1.14.1.rbi +2325 -0
  97. data/sorbet/rbi/gems/json@2.7.1.rbi +1561 -0
  98. data/sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi +14237 -0
  99. data/sorbet/rbi/gems/method_source@1.0.0.rbi +272 -0
  100. data/sorbet/rbi/gems/minitest@5.21.2.rbi +2197 -0
  101. data/sorbet/rbi/gems/mocha@2.1.0.rbi +3934 -0
  102. data/sorbet/rbi/gems/mutex_m@0.2.0.rbi +93 -0
  103. data/sorbet/rbi/gems/net-http@0.4.1.rbi +4068 -0
  104. data/sorbet/rbi/gems/netrc@0.11.0.rbi +158 -0
  105. data/sorbet/rbi/gems/parallel@1.24.0.rbi +280 -0
  106. data/sorbet/rbi/gems/parser@3.3.0.5.rbi +5472 -0
  107. data/sorbet/rbi/gems/prettier_print@1.2.1.rbi +951 -0
  108. data/sorbet/rbi/gems/prism@0.19.0.rbi +29883 -0
  109. data/sorbet/rbi/gems/pry-sorbet@0.2.1.rbi +966 -0
  110. data/sorbet/rbi/gems/pry@0.14.2.rbi +10077 -0
  111. data/sorbet/rbi/gems/public_suffix@5.0.4.rbi +935 -0
  112. data/sorbet/rbi/gems/racc@1.7.3.rbi +161 -0
  113. data/sorbet/rbi/gems/rack@3.0.8.rbi +5183 -0
  114. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +402 -0
  115. data/sorbet/rbi/gems/rake@13.1.0.rbi +3027 -0
  116. data/sorbet/rbi/gems/rbi@0.1.6.rbi +2922 -0
  117. data/sorbet/rbi/gems/regexp_parser@2.9.0.rbi +3771 -0
  118. data/sorbet/rbi/gems/rexml@3.2.6.rbi +4781 -0
  119. data/sorbet/rbi/gems/rubocop-ast@1.30.0.rbi +7117 -0
  120. data/sorbet/rbi/gems/rubocop-minitest@0.34.5.rbi +2576 -0
  121. data/sorbet/rbi/gems/rubocop-rails@2.23.1.rbi +9175 -0
  122. data/sorbet/rbi/gems/rubocop-shopify@2.14.0.rbi +8 -0
  123. data/sorbet/rbi/gems/rubocop-sorbet@0.7.6.rbi +1510 -0
  124. data/sorbet/rbi/gems/rubocop@1.60.1.rbi +57356 -0
  125. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1317 -0
  126. data/sorbet/rbi/gems/ruby2_keywords@0.0.5.rbi +8 -0
  127. data/sorbet/rbi/gems/spoom@1.2.4.rbi +3777 -0
  128. data/sorbet/rbi/gems/syntax_tree@6.2.0.rbi +23136 -0
  129. data/sorbet/rbi/gems/tapioca@0.12.0.rbi +3506 -0
  130. data/sorbet/rbi/gems/thor@1.3.0.rbi +4312 -0
  131. data/sorbet/rbi/gems/toys-core@0.15.4.rbi +9462 -0
  132. data/sorbet/rbi/gems/toys@0.15.4.rbi +243 -0
  133. data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +5917 -0
  134. data/sorbet/rbi/gems/unicode-display_width@2.5.0.rbi +65 -0
  135. data/sorbet/rbi/gems/uri@0.13.0.rbi +2327 -0
  136. data/sorbet/rbi/gems/vcr@6.2.0.rbi +3036 -0
  137. data/sorbet/rbi/gems/webmock@3.19.1.rbi +1768 -0
  138. data/sorbet/rbi/gems/yard-sorbet@0.8.1.rbi +428 -0
  139. data/sorbet/rbi/gems/yard@0.9.34.rbi +18084 -0
  140. data/sorbet/shims/module.rbi +6 -0
  141. data/sorbet/tapioca/require.rb +10 -0
  142. metadata +228 -0
@@ -0,0 +1,1510 @@
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
+ # Checks for the a mistaken variant of the "obsolete memoization pattern" that used to be required
109
+ # on every call, causing the memoized value to be discarded and recomputed on every call.
110
+ #
111
+ # This cop will correct it to read from the ivar instead of `nil`, which will memoize it correctly.
112
+ #
113
+ # The result of this correction will be the "obsolete memoization pattern", which can further be corrected by
114
+ # the `Sorbet/ObsoleteStrictMemoization` cop.
115
+ #
116
+ # See `Sorbet/ObsoleteStrictMemoization` for more details.
117
+ #
118
+ # @example
119
+ # # bad
120
+ # sig { returns(Foo) }
121
+ # def foo
122
+ # # This `nil` is likely a mistake, causing the memoized value to be discarded and recomputed on every call.
123
+ # @foo = T.let(nil, T.nilable(Foo))
124
+ # @foo ||= some_computation
125
+ # end
126
+ #
127
+ # # good
128
+ # sig { returns(Foo) }
129
+ # def foo
130
+ # # This will now memoize the value as was likely intended, so `some_computation` is only ever called once.
131
+ # # ⚠️If `some_computation` has side effects, this might be a breaking change!
132
+ # @foo = T.let(@foo, T.nilable(Foo))
133
+ # @foo ||= some_computation
134
+ # end
135
+ # @see Sorbet/ObsoleteStrictMemoization
136
+ #
137
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/buggy_obsolete_strict_memoization.rb#42
138
+ class RuboCop::Cop::Sorbet::BuggyObsoleteStrictMemoization < ::RuboCop::Cop::Base
139
+ include ::RuboCop::Cop::RangeHelp
140
+ include ::RuboCop::Cop::MatchRange
141
+ include ::RuboCop::Cop::Alignment
142
+ include ::RuboCop::Cop::LineLengthHelp
143
+ include ::RuboCop::Cop::Sorbet::TargetSorbetVersion
144
+ extend ::RuboCop::Cop::AutoCorrector
145
+ extend ::RuboCop::Cop::Sorbet::TargetSorbetVersion::ClassMethods
146
+
147
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/buggy_obsolete_strict_memoization.rb#55
148
+ def buggy_legacy_memoization_pattern?(param0 = T.unsafe(nil)); end
149
+
150
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/buggy_obsolete_strict_memoization.rb#66
151
+ def on_begin(node); end
152
+
153
+ # @return [Boolean]
154
+ #
155
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/buggy_obsolete_strict_memoization.rb#77
156
+ def relevant_file?(file); end
157
+ end
158
+
159
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/buggy_obsolete_strict_memoization.rb#51
160
+ RuboCop::Cop::Sorbet::BuggyObsoleteStrictMemoization::MSG = T.let(T.unsafe(nil), String)
161
+
162
+ # Ensures that callback conditionals are bound to the right type
163
+ # so that they are type checked properly.
164
+ #
165
+ # Auto-correction is unsafe because other libraries define similar style callbacks as Rails, but don't always need
166
+ # binding to the attached class. Auto-correcting those usages can lead to false positives and auto-correction
167
+ # introduces new typing errors.
168
+ #
169
+ # @example
170
+ #
171
+ # # bad
172
+ # class Post < ApplicationRecord
173
+ # before_create :do_it, if: -> { should_do_it? }
174
+ #
175
+ # def should_do_it?
176
+ # true
177
+ # end
178
+ # end
179
+ #
180
+ # # good
181
+ # class Post < ApplicationRecord
182
+ # before_create :do_it, if: -> {
183
+ # T.bind(self, Post)
184
+ # should_do_it?
185
+ # }
186
+ #
187
+ # def should_do_it?
188
+ # true
189
+ # end
190
+ # end
191
+ #
192
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#35
193
+ class RuboCop::Cop::Sorbet::CallbackConditionalsBinding < ::RuboCop::Cop::Cop
194
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#75
195
+ def autocorrect(node); end
196
+
197
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#127
198
+ def on_send(node); end
199
+ end
200
+
201
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/callback_conditionals_binding.rb#36
202
+ RuboCop::Cop::Sorbet::CallbackConditionalsBinding::CALLBACKS = T.let(T.unsafe(nil), Array)
203
+
204
+ # Disallows the usage of `checked(true)`. This usage could cause
205
+ # confusion; it could lead some people to believe that a method would be checked
206
+ # even if runtime checks have not been enabled on the class or globally.
207
+ # Additionally, in the event where checks are enabled, `checked(true)` would
208
+ # be redundant; only `checked(false)` or `soft` would change the behaviour.
209
+ #
210
+ # @example
211
+ #
212
+ # # bad
213
+ # sig { void.checked(true) }
214
+ #
215
+ # # good
216
+ # sig { void }
217
+ #
218
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb#19
219
+ class RuboCop::Cop::Sorbet::CheckedTrueInSignature < ::RuboCop::Cop::Cop
220
+ include ::RuboCop::Cop::RangeHelp
221
+ include ::RuboCop::Cop::Sorbet::SignatureHelp
222
+
223
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb#24
224
+ def offending_node(param0); end
225
+
226
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb#35
227
+ def on_signature(node); end
228
+ end
229
+
230
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/checked_true_in_signature.rb#28
231
+ RuboCop::Cop::Sorbet::CheckedTrueInSignature::MESSAGE = T.let(T.unsafe(nil), String)
232
+
233
+ # Disallows the calls that are used to get constants fom Strings
234
+ # such as +constantize+, +const_get+, and +constants+.
235
+ #
236
+ # The goal of this cop is to make the code easier to statically analyze,
237
+ # more IDE-friendly, and more predictable. It leads to code that clearly
238
+ # expresses which values the constant can have.
239
+ #
240
+ # @example
241
+ #
242
+ # # bad
243
+ # class_name.constantize
244
+ #
245
+ # # bad
246
+ # constants.detect { |c| c.name == "User" }
247
+ #
248
+ # # bad
249
+ # const_get(class_name)
250
+ #
251
+ # # good
252
+ # case class_name
253
+ # when "User"
254
+ # User
255
+ # else
256
+ # raise ArgumentError
257
+ # end
258
+ #
259
+ # # good
260
+ # { "User" => User }.fetch(class_name)
261
+ #
262
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/constants_from_strings.rb#37
263
+ class RuboCop::Cop::Sorbet::ConstantsFromStrings < ::RuboCop::Cop::Cop
264
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/constants_from_strings.rb#38
265
+ def constant_from_string?(param0 = T.unsafe(nil)); end
266
+
267
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/constants_from_strings.rb#42
268
+ def on_send(node); end
269
+ end
270
+
271
+ # Checks for blank lines after signatures.
272
+ #
273
+ # @example
274
+ # # bad
275
+ # sig { void }
276
+ #
277
+ # def foo; end
278
+ #
279
+ # # good
280
+ # sig { void }
281
+ # def foo; end
282
+ #
283
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb#17
284
+ class RuboCop::Cop::Sorbet::EmptyLineAfterSig < ::RuboCop::Cop::Base
285
+ include ::RuboCop::Cop::RangeHelp
286
+ include ::RuboCop::Cop::Sorbet::SignatureHelp
287
+ extend ::RuboCop::Cop::AutoCorrector
288
+
289
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb#34
290
+ def on_signature(sig); end
291
+
292
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb#25
293
+ def sig_or_signable_method_definition?(param0 = T.unsafe(nil)); end
294
+
295
+ private
296
+
297
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb#57
298
+ def lines_between(node1, node2, buffer: T.unsafe(nil)); end
299
+
300
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb#53
301
+ def next_sibling(node); end
302
+ end
303
+
304
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/empty_line_after_sig.rb#22
305
+ RuboCop::Cop::Sorbet::EmptyLineAfterSig::MSG = T.let(T.unsafe(nil), String)
306
+
307
+ # Checks that the Sorbet sigil comes as the first magic comment in the file.
308
+ #
309
+ # The expected order for magic comments is: (en)?coding, typed, warn_indent then frozen_string_literal.
310
+ #
311
+ # For example, the following bad ordering:
312
+ #
313
+ # ```ruby
314
+ # class Foo; end
315
+ # ```
316
+ #
317
+ # Will be corrected as:
318
+ #
319
+ # ```ruby
320
+ # class Foo; end
321
+ # ```
322
+ #
323
+ # Only `(en)?coding`, `typed`, `warn_indent` and `frozen_string_literal` magic comments are considered,
324
+ # other comments or magic comments are left in the same place.
325
+ #
326
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#30
327
+ class RuboCop::Cop::Sorbet::EnforceSigilOrder < ::RuboCop::Cop::Sorbet::ValidSigil
328
+ include ::RuboCop::Cop::RangeHelp
329
+
330
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#42
331
+ def autocorrect(_node); end
332
+
333
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#33
334
+ def investigate(processed_source); end
335
+
336
+ protected
337
+
338
+ # checks
339
+ #
340
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#92
341
+ def check_magic_comments_order(tokens); end
342
+
343
+ # Get all the tokens in `processed_source` that match `MAGIC_REGEX`
344
+ #
345
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#84
346
+ def extract_magic_comments(processed_source); end
347
+ end
348
+
349
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#68
350
+ RuboCop::Cop::Sorbet::EnforceSigilOrder::CODING_REGEX = T.let(T.unsafe(nil), Regexp)
351
+
352
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#70
353
+ RuboCop::Cop::Sorbet::EnforceSigilOrder::FROZEN_REGEX = T.let(T.unsafe(nil), Regexp)
354
+
355
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#69
356
+ RuboCop::Cop::Sorbet::EnforceSigilOrder::INDENT_REGEX = T.let(T.unsafe(nil), Regexp)
357
+
358
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#79
359
+ RuboCop::Cop::Sorbet::EnforceSigilOrder::MAGIC_REGEX = T.let(T.unsafe(nil), Regexp)
360
+
361
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_sigil_order.rb#72
362
+ RuboCop::Cop::Sorbet::EnforceSigilOrder::PREFERRED_ORDER = T.let(T.unsafe(nil), Hash)
363
+
364
+ # Checks that every method definition and attribute accessor has a Sorbet signature.
365
+ #
366
+ # It also suggest an autocorrect with placeholders so the following code:
367
+ #
368
+ # ```
369
+ # def foo(a, b, c); end
370
+ # ```
371
+ #
372
+ # Will be corrected as:
373
+ #
374
+ # ```
375
+ # sig { params(a: T.untyped, b: T.untyped, c: T.untyped).returns(T.untyped)
376
+ # def foo(a, b, c); end
377
+ # ```
378
+ #
379
+ # You can configure the placeholders used by changing the following options:
380
+ #
381
+ # * `ParameterTypePlaceholder`: placeholders used for parameter types (default: 'T.untyped')
382
+ # * `ReturnTypePlaceholder`: placeholders used for return types (default: 'T.untyped')
383
+ #
384
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#27
385
+ class RuboCop::Cop::Sorbet::EnforceSignatures < ::RuboCop::Cop::Cop
386
+ include ::RuboCop::Cop::Sorbet::SignatureHelp
387
+
388
+ # @return [EnforceSignatures] a new instance of EnforceSignatures
389
+ #
390
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#30
391
+ def initialize(config = T.unsafe(nil), options = T.unsafe(nil)); end
392
+
393
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#36
394
+ def accessor?(param0 = T.unsafe(nil)); end
395
+
396
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#56
397
+ def autocorrect(node); end
398
+
399
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#40
400
+ def on_def(node); end
401
+
402
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#44
403
+ def on_defs(node); end
404
+
405
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#48
406
+ def on_send(node); end
407
+
408
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#52
409
+ def on_signature(node); end
410
+
411
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#75
412
+ def scope(node); end
413
+
414
+ private
415
+
416
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#84
417
+ def check_node(node); end
418
+
419
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#95
420
+ def param_type_placeholder; end
421
+
422
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#99
423
+ def return_type_placeholder; end
424
+ end
425
+
426
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#103
427
+ class RuboCop::Cop::Sorbet::EnforceSignatures::SigSuggestion
428
+ # @return [SigSuggestion] a new instance of SigSuggestion
429
+ #
430
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#106
431
+ def initialize(indent, param_placeholder, return_placeholder); end
432
+
433
+ # Returns the value of attribute params.
434
+ #
435
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#104
436
+ def params; end
437
+
438
+ # Sets the attribute params
439
+ #
440
+ # @param value the value to set the attribute params to.
441
+ #
442
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#104
443
+ def params=(_arg0); end
444
+
445
+ # Returns the value of attribute returns.
446
+ #
447
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#104
448
+ def returns; end
449
+
450
+ # Sets the attribute returns
451
+ #
452
+ # @param value the value to set the attribute returns to.
453
+ #
454
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#104
455
+ def returns=(_arg0); end
456
+
457
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#114
458
+ def to_autocorrect; end
459
+
460
+ private
461
+
462
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#126
463
+ def generate_params; end
464
+
465
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/enforce_signatures.rb#138
466
+ def generate_return; end
467
+ end
468
+
469
+ # Checks that there is only one Sorbet sigil in a given file
470
+ #
471
+ # For example, the following class with two sigils
472
+ #
473
+ # ```ruby
474
+ # class Foo; end
475
+ # ```
476
+ #
477
+ # Will be corrected as:
478
+ #
479
+ # ```ruby
480
+ # class Foo; end
481
+ # ```
482
+ #
483
+ # Other comments or magic comments are left in place.
484
+ #
485
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb#26
486
+ class RuboCop::Cop::Sorbet::EnforceSingleSigil < ::RuboCop::Cop::Sorbet::ValidSigil
487
+ include ::RuboCop::Cop::RangeHelp
488
+
489
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb#40
490
+ def autocorrect(_node); end
491
+
492
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb#29
493
+ def investigate(processed_source); end
494
+
495
+ protected
496
+
497
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/enforce_single_sigil.rb#56
498
+ def extract_all_sigils(processed_source); end
499
+ end
500
+
501
+ # Makes the Sorbet `false` sigil mandatory in all files.
502
+ #
503
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/false_sigil.rb#10
504
+ class RuboCop::Cop::Sorbet::FalseSigil < ::RuboCop::Cop::Sorbet::HasSigil
505
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/false_sigil.rb#11
506
+ def minimum_strictness; end
507
+ end
508
+
509
+ # Ensures RBI shims do not include a call to extend T::Sig
510
+ # or to extend T::Helpers
511
+ #
512
+ # @example
513
+ #
514
+ # # bad
515
+ # module SomeModule
516
+ # extend T::Sig
517
+ # extend T::Helpers
518
+ #
519
+ # sig { returns(String) }
520
+ # def foo; end
521
+ # end
522
+ #
523
+ # # good
524
+ # module SomeModule
525
+ # sig { returns(String) }
526
+ # def foo; end
527
+ # end
528
+ #
529
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb#25
530
+ class RuboCop::Cop::Sorbet::ForbidExtendTSigHelpersInShims < ::RuboCop::Cop::Base
531
+ include ::RuboCop::Cop::RangeHelp
532
+ extend ::RuboCop::Cop::AutoCorrector
533
+
534
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb#33
535
+ def extend_t_sig_or_helpers?(param0 = T.unsafe(nil)); end
536
+
537
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb#37
538
+ def on_send(node); end
539
+ end
540
+
541
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb#29
542
+ RuboCop::Cop::Sorbet::ForbidExtendTSigHelpersInShims::MSG = T.let(T.unsafe(nil), String)
543
+
544
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_extend_t_sig_helpers_in_shims.rb#30
545
+ RuboCop::Cop::Sorbet::ForbidExtendTSigHelpersInShims::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
546
+
547
+ # Correct `send` expressions in include statements by constant literals.
548
+ #
549
+ # Sorbet, the static checker, is not (yet) able to support constructs on the
550
+ # following form:
551
+ #
552
+ # ```ruby
553
+ # class MyClass
554
+ # include send_expr
555
+ # end
556
+ # ```
557
+ #
558
+ # Multiple occurences of this can be found in Shopify's code base like:
559
+ #
560
+ # ```ruby
561
+ # include Rails.application.routes.url_helpers
562
+ # ```
563
+ # or
564
+ # ```ruby
565
+ # include Polaris::Engine.helpers
566
+ # ```
567
+ #
568
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#29
569
+ class RuboCop::Cop::Sorbet::ForbidIncludeConstLiteral < ::RuboCop::Cop::Base
570
+ extend ::RuboCop::Cop::AutoCorrector
571
+
572
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#36
573
+ def dynamic_inclusion?(param0 = T.unsafe(nil)); end
574
+
575
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#40
576
+ def on_send(node); end
577
+
578
+ private
579
+
580
+ # @return [Boolean]
581
+ #
582
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#52
583
+ def neither_const_nor_self?(node); end
584
+
585
+ # Returns true if the node is within a module declaration that is not anonymous.
586
+ #
587
+ # @return [Boolean]
588
+ #
589
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#57
590
+ def within_onymous_module?(node); end
591
+ end
592
+
593
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#32
594
+ RuboCop::Cop::Sorbet::ForbidIncludeConstLiteral::MSG = T.let(T.unsafe(nil), String)
595
+
596
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_include_const_literal.rb#33
597
+ RuboCop::Cop::Sorbet::ForbidIncludeConstLiteral::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
598
+
599
+ # Makes sure that RBI files are always located under the defined allowed paths.
600
+ #
601
+ # Options:
602
+ #
603
+ # * `AllowedPaths`: A list of the paths where RBI files are allowed (default: ["rbi/**", "sorbet/rbi/**"])
604
+ #
605
+ # @example
606
+ # # bad
607
+ # # lib/some_file.rbi
608
+ # # other_file.rbi
609
+ #
610
+ # # good
611
+ # # rbi/external_interface.rbi
612
+ # # sorbet/rbi/some_file.rbi
613
+ # # sorbet/rbi/any/path/for/file.rbi
614
+ #
615
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_rbi_outside_of_allowed_paths.rb#23
616
+ class RuboCop::Cop::Sorbet::ForbidRBIOutsideOfAllowedPaths < ::RuboCop::Cop::Cop
617
+ include ::RuboCop::Cop::RangeHelp
618
+
619
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_rbi_outside_of_allowed_paths.rb#26
620
+ def investigate(processed_source); end
621
+
622
+ private
623
+
624
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/forbid_rbi_outside_of_allowed_paths.rb#58
625
+ def allowed_paths; end
626
+ end
627
+
628
+ # Correct superclass `send` expressions by constant literals.
629
+ #
630
+ # Sorbet, the static checker, is not (yet) able to support constructs on the
631
+ # following form:
632
+ #
633
+ # ```ruby
634
+ # class Foo < send_expr; end
635
+ # ```
636
+ #
637
+ # Multiple occurences of this can be found in Shopify's code base like:
638
+ #
639
+ # ```ruby
640
+ # class ShopScope < Component::TrustedIdScope[ShopIdentity::ShopId]
641
+ # ```
642
+ # or
643
+ # ```ruby
644
+ # class ApiClientEligibility < Struct.new(:api_client, :match_results, :shop)
645
+ # ```
646
+ #
647
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_superclass_const_literal.rb#28
648
+ class RuboCop::Cop::Sorbet::ForbidSuperclassConstLiteral < ::RuboCop::Cop::Base
649
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_superclass_const_literal.rb#32
650
+ def dynamic_superclass?(param0 = T.unsafe(nil)); end
651
+
652
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_superclass_const_literal.rb#36
653
+ def on_class(node); end
654
+ end
655
+
656
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_superclass_const_literal.rb#29
657
+ RuboCop::Cop::Sorbet::ForbidSuperclassConstLiteral::MSG = T.let(T.unsafe(nil), String)
658
+
659
+ # Disallow using `T::Struct` and `T::Props`.
660
+ #
661
+ # @example
662
+ #
663
+ # # bad
664
+ # class MyStruct < T::Struct
665
+ # const :foo, String
666
+ # prop :bar, Integer, default: 0
667
+ #
668
+ # def some_method; end
669
+ # end
670
+ #
671
+ # # good
672
+ # class MyStruct
673
+ # extend T::Sig
674
+ #
675
+ # sig { returns(String) }
676
+ # attr_reader :foo
677
+ #
678
+ # sig { returns(Integer) }
679
+ # attr_accessor :bar
680
+ #
681
+ # sig { params(foo: String, bar: Integer) }
682
+ # def initialize(foo:, bar: 0)
683
+ # @foo = foo
684
+ # @bar = bar
685
+ # end
686
+ #
687
+ # def some_method; end
688
+ # end
689
+ #
690
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#38
691
+ class RuboCop::Cop::Sorbet::ForbidTStruct < ::RuboCop::Cop::Base
692
+ include ::RuboCop::Cop::Alignment
693
+ include ::RuboCop::Cop::RangeHelp
694
+ include ::RuboCop::Cop::CommentsHelp
695
+ extend ::RuboCop::Cop::AutoCorrector
696
+
697
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#164
698
+ def on_class(node); end
699
+
700
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#205
701
+ def on_send(node); end
702
+
703
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#162
704
+ def t_props?(param0 = T.unsafe(nil)); end
705
+
706
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#157
707
+ def t_struct?(param0 = T.unsafe(nil)); end
708
+
709
+ private
710
+
711
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#213
712
+ def initialize_method(indent, props); end
713
+
714
+ # @return [Boolean]
715
+ #
716
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#226
717
+ def previous_line_blank?(node); end
718
+ end
719
+
720
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#47
721
+ RuboCop::Cop::Sorbet::ForbidTStruct::MSG_PROPS = T.let(T.unsafe(nil), String)
722
+
723
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#46
724
+ RuboCop::Cop::Sorbet::ForbidTStruct::MSG_STRUCT = T.let(T.unsafe(nil), String)
725
+
726
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#104
727
+ class RuboCop::Cop::Sorbet::ForbidTStruct::Property
728
+ # @return [Property] a new instance of Property
729
+ #
730
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#107
731
+ def initialize(node, kind, name, type, default:, factory:); end
732
+
733
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#123
734
+ def attr_accessor; end
735
+
736
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#119
737
+ def attr_sig; end
738
+
739
+ # Returns the value of attribute default.
740
+ #
741
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#105
742
+ def default; end
743
+
744
+ # Returns the value of attribute factory.
745
+ #
746
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#105
747
+ def factory; end
748
+
749
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#144
750
+ def initialize_assign; end
751
+
752
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#131
753
+ def initialize_param; end
754
+
755
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#127
756
+ def initialize_sig_param; end
757
+
758
+ # Returns the value of attribute kind.
759
+ #
760
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#105
761
+ def kind; end
762
+
763
+ # Returns the value of attribute name.
764
+ #
765
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#105
766
+ def name; end
767
+
768
+ # @return [Boolean]
769
+ #
770
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#151
771
+ def nilable?; end
772
+
773
+ # Returns the value of attribute node.
774
+ #
775
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#105
776
+ def node; end
777
+
778
+ # Returns the value of attribute type.
779
+ #
780
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#105
781
+ def type; end
782
+ end
783
+
784
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#44
785
+ RuboCop::Cop::Sorbet::ForbidTStruct::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
786
+
787
+ # This class walks down the class body of a T::Struct and collects all the properties that will need to be
788
+ # translated into `attr_reader` and `attr_accessor` methods.
789
+ #
790
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#51
791
+ class RuboCop::Cop::Sorbet::ForbidTStruct::TStructWalker
792
+ include ::RuboCop::AST::Traversal
793
+ extend ::RuboCop::AST::NodePattern::Macros
794
+
795
+ # @return [TStructWalker] a new instance of TStructWalker
796
+ #
797
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#57
798
+ def initialize; end
799
+
800
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#63
801
+ def extend_t_sig?(param0 = T.unsafe(nil)); end
802
+
803
+ # Returns the value of attribute has_extend_t_sig.
804
+ #
805
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#55
806
+ def has_extend_t_sig; end
807
+
808
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#72
809
+ def on_send(node); end
810
+
811
+ # Returns the value of attribute props.
812
+ #
813
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#55
814
+ def props; end
815
+
816
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_struct.rb#68
817
+ def t_struct_prop?(param0 = T.unsafe(nil)); end
818
+ end
819
+
820
+ # Disallows using `T.unsafe` anywhere.
821
+ #
822
+ # @example
823
+ #
824
+ # # bad
825
+ # T.unsafe(foo)
826
+ #
827
+ # # good
828
+ # foo
829
+ #
830
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_unsafe.rb#17
831
+ class RuboCop::Cop::Sorbet::ForbidTUnsafe < ::RuboCop::Cop::Base
832
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_unsafe.rb#24
833
+ def on_send(node); end
834
+
835
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_unsafe.rb#22
836
+ def t_unsafe?(param0 = T.unsafe(nil)); end
837
+ end
838
+
839
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_unsafe.rb#18
840
+ RuboCop::Cop::Sorbet::ForbidTUnsafe::MSG = T.let(T.unsafe(nil), String)
841
+
842
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_unsafe.rb#19
843
+ RuboCop::Cop::Sorbet::ForbidTUnsafe::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
844
+
845
+ # Disallows using `T.untyped` anywhere.
846
+ #
847
+ # @example
848
+ #
849
+ # # bad
850
+ # sig { params(my_argument: T.untyped).void }
851
+ # def foo(my_argument); end
852
+ #
853
+ # # good
854
+ # sig { params(my_argument: String).void }
855
+ # def foo(my_argument); end
856
+ #
857
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_untyped.rb#20
858
+ class RuboCop::Cop::Sorbet::ForbidTUntyped < ::RuboCop::Cop::Base
859
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_untyped.rb#27
860
+ def on_send(node); end
861
+
862
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_untyped.rb#25
863
+ def t_untyped?(param0 = T.unsafe(nil)); end
864
+ end
865
+
866
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_untyped.rb#21
867
+ RuboCop::Cop::Sorbet::ForbidTUntyped::MSG = T.let(T.unsafe(nil), String)
868
+
869
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_t_untyped.rb#22
870
+ RuboCop::Cop::Sorbet::ForbidTUntyped::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
871
+
872
+ # Disallows defining type aliases that contain shapes
873
+ #
874
+ # @example
875
+ #
876
+ # # bad
877
+ # Foo = T.type_alias { { foo: Integer } }
878
+ #
879
+ # # good
880
+ # class Foo
881
+ # extend T::Sig
882
+ #
883
+ # sig { params(foo: Integer).void }
884
+ # def initialize(foo)
885
+ # @foo = foo
886
+ # end
887
+ # end
888
+ #
889
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_type_aliased_shapes.rb#24
890
+ class RuboCop::Cop::Sorbet::ForbidTypeAliasedShapes < ::RuboCop::Cop::Base
891
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_type_aliased_shapes.rb#36
892
+ def on_block(node); end
893
+
894
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_type_aliased_shapes.rb#36
895
+ def on_numblock(node); end
896
+
897
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_type_aliased_shapes.rb#28
898
+ def shape_type_alias?(param0 = T.unsafe(nil)); end
899
+ end
900
+
901
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_type_aliased_shapes.rb#25
902
+ RuboCop::Cop::Sorbet::ForbidTypeAliasedShapes::MSG = T.let(T.unsafe(nil), String)
903
+
904
+ # Disallows use of `T.untyped` or `T.nilable(T.untyped)`
905
+ # as a prop type for `T::Struct` or `T::ImmutableStruct`.
906
+ #
907
+ # @example
908
+ #
909
+ # # bad
910
+ # class SomeClass < T::Struct
911
+ # const :foo, T.untyped
912
+ # prop :bar, T.nilable(T.untyped)
913
+ # end
914
+ #
915
+ # # good
916
+ # class SomeClass < T::Struct
917
+ # const :foo, Integer
918
+ # prop :bar, T.nilable(String)
919
+ # end
920
+ #
921
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#25
922
+ class RuboCop::Cop::Sorbet::ForbidUntypedStructProps < ::RuboCop::Cop::Base
923
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#54
924
+ def on_class(node); end
925
+
926
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#44
927
+ def subclass_of_t_struct?(param0 = T.unsafe(nil)); end
928
+
929
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#39
930
+ def t_nilable_untyped(param0 = T.unsafe(nil)); end
931
+
932
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#29
933
+ def t_struct(param0 = T.unsafe(nil)); end
934
+
935
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#34
936
+ def t_untyped(param0 = T.unsafe(nil)); end
937
+
938
+ # Search for untyped prop/const declarations and capture their types
939
+ #
940
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#50
941
+ def untyped_props(param0); end
942
+ end
943
+
944
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/forbid_untyped_struct_props.rb#26
945
+ RuboCop::Cop::Sorbet::ForbidUntypedStructProps::MSG = T.let(T.unsafe(nil), String)
946
+
947
+ # Makes the Sorbet typed sigil mandatory in all files.
948
+ #
949
+ # Options:
950
+ #
951
+ # * `SuggestedStrictness`: Sorbet strictness level suggested in offense messages (default: 'false')
952
+ # * `MinimumStrictness`: If set, make offense if the strictness level in the file is below this one
953
+ #
954
+ # If a `MinimumStrictness` level is specified, it will be used in offense messages and autocorrect.
955
+ #
956
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/has_sigil.rb#17
957
+ class RuboCop::Cop::Sorbet::HasSigil < ::RuboCop::Cop::Sorbet::ValidSigil
958
+ # @return [Boolean]
959
+ #
960
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/has_sigil.rb#20
961
+ def require_sigil_on_all_files?; end
962
+ end
963
+
964
+ # Makes the Sorbet `ignore` sigil mandatory in all files.
965
+ #
966
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/ignore_sigil.rb#10
967
+ class RuboCop::Cop::Sorbet::IgnoreSigil < ::RuboCop::Cop::Sorbet::HasSigil
968
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/ignore_sigil.rb#11
969
+ def minimum_strictness; end
970
+ end
971
+
972
+ # Disallows declaring implicit conversion methods.
973
+ # Since Sorbet is a nominal (not structural) type system,
974
+ # implicit conversion is currently unsupported.
975
+ #
976
+ # @example
977
+ #
978
+ # # bad
979
+ # def to_str; end
980
+ #
981
+ # # good
982
+ # def to_str(x); end
983
+ #
984
+ # # bad
985
+ # def self.to_str; end
986
+ #
987
+ # # good
988
+ # def self.to_str(x); end
989
+ #
990
+ # # bad
991
+ # alias to_str to_s
992
+ # @note Since the arity of aliased methods is not checked, false positives may result.
993
+ # @see https://docs.ruby-lang.org/en/master/implicit_conversion_rdoc.html
994
+ #
995
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/implicit_conversion_method.rb#31
996
+ class RuboCop::Cop::Sorbet::ImplicitConversionMethod < ::RuboCop::Cop::Base
997
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/implicit_conversion_method.rb#37
998
+ def on_alias(node); end
999
+
1000
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/implicit_conversion_method.rb#42
1001
+ def on_def(node); end
1002
+
1003
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/implicit_conversion_method.rb#42
1004
+ def on_defs(node); end
1005
+
1006
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/implicit_conversion_method.rb#50
1007
+ def on_send(node); end
1008
+ end
1009
+
1010
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/implicit_conversion_method.rb#32
1011
+ RuboCop::Cop::Sorbet::ImplicitConversionMethod::IMPLICIT_CONVERSION_METHODS = T.let(T.unsafe(nil), Array)
1012
+
1013
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/implicit_conversion_method.rb#33
1014
+ RuboCop::Cop::Sorbet::ImplicitConversionMethod::MSG = T.let(T.unsafe(nil), String)
1015
+
1016
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/implicit_conversion_method.rb#35
1017
+ RuboCop::Cop::Sorbet::ImplicitConversionMethod::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1018
+
1019
+ # Checks for the ordering of keyword arguments required by
1020
+ # sorbet-runtime. The ordering requires that all keyword arguments
1021
+ # are at the end of the parameters list, and all keyword arguments
1022
+ # with a default value must be after those without default values.
1023
+ #
1024
+ # @example
1025
+ #
1026
+ # # bad
1027
+ # sig { params(a: Integer, b: String).void }
1028
+ # def foo(a: 1, b:); end
1029
+ #
1030
+ # # good
1031
+ # sig { params(b: String, a: Integer).void }
1032
+ # def foo(b:, a: 1); end
1033
+ #
1034
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/keyword_argument_ordering.rb#20
1035
+ class RuboCop::Cop::Sorbet::KeywordArgumentOrdering < ::RuboCop::Cop::Cop
1036
+ include ::RuboCop::Cop::Sorbet::SignatureHelp
1037
+
1038
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/keyword_argument_ordering.rb#23
1039
+ def on_signature(node); end
1040
+
1041
+ private
1042
+
1043
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/keyword_argument_ordering.rb#34
1044
+ def check_order_for_kwoptargs(parameters); end
1045
+ end
1046
+
1047
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#8
1048
+ module RuboCop::Cop::Sorbet::MutableConstantSorbetAwareBehaviour
1049
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#18
1050
+ def on_assignment(value); end
1051
+
1052
+ class << self
1053
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mutable_constant_sorbet_aware_behaviour.rb#10
1054
+ def prepended(base); end
1055
+ end
1056
+ end
1057
+
1058
+ # Checks for the obsolete pattern for initializing instance variables that was required for older Sorbet
1059
+ #
1060
+ # It's no longer required, as of Sorbet 0.5.10210
1061
+ # See https://sorbet.org/docs/type-assertions#put-type-assertions-behind-memoization
1062
+ #
1063
+ # @example
1064
+ #
1065
+ # # bad
1066
+ # sig { returns(Foo) }
1067
+ # def foo
1068
+ # @foo = T.let(@foo, T.nilable(Foo))
1069
+ # @foo ||= Foo.new
1070
+ # end
1071
+ #
1072
+ # # bad
1073
+ # sig { returns(Foo) }
1074
+ # def foo
1075
+ # # This would have been a mistake, causing the memoized value to be discarded and recomputed on every call.
1076
+ # @foo = T.let(nil, T.nilable(Foo))
1077
+ # @foo ||= Foo.new
1078
+ # end
1079
+ #
1080
+ # # good
1081
+ # sig { returns(Foo) }
1082
+ # def foo
1083
+ # @foo ||= T.let(Foo.new, T.nilable(Foo))
1084
+ # end
1085
+ #
1086
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/obsolete_strict_memoization.rb#37
1087
+ class RuboCop::Cop::Sorbet::ObsoleteStrictMemoization < ::RuboCop::Cop::Base
1088
+ include ::RuboCop::Cop::RangeHelp
1089
+ include ::RuboCop::Cop::MatchRange
1090
+ include ::RuboCop::Cop::Alignment
1091
+ include ::RuboCop::Cop::LineLengthHelp
1092
+ include ::RuboCop::Cop::Sorbet::TargetSorbetVersion
1093
+ extend ::RuboCop::Cop::AutoCorrector
1094
+ extend ::RuboCop::Cop::Sorbet::TargetSorbetVersion::ClassMethods
1095
+
1096
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/obsolete_strict_memoization.rb#51
1097
+ def legacy_memoization_pattern?(param0 = T.unsafe(nil)); end
1098
+
1099
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/obsolete_strict_memoization.rb#62
1100
+ def on_begin(node); end
1101
+
1102
+ # @return [Boolean]
1103
+ #
1104
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/obsolete_strict_memoization.rb#86
1105
+ def relevant_file?(file); end
1106
+ end
1107
+
1108
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/obsolete_strict_memoization.rb#47
1109
+ RuboCop::Cop::Sorbet::ObsoleteStrictMemoization::MSG = T.let(T.unsafe(nil), String)
1110
+
1111
+ # Ensures one ancestor per requires_ancestor line
1112
+ # rather than chaining them as a comma-separated list.
1113
+ #
1114
+ # @example
1115
+ #
1116
+ # # bad
1117
+ # module SomeModule
1118
+ # requires_ancestor Kernel, Minitest::Assertions
1119
+ # end
1120
+ #
1121
+ # # good
1122
+ # module SomeModule
1123
+ # requires_ancestor Kernel
1124
+ # requires_ancestor Minitest::Assertions
1125
+ # end
1126
+ #
1127
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#24
1128
+ class RuboCop::Cop::Sorbet::OneAncestorPerLine < ::RuboCop::Cop::Cop
1129
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#38
1130
+ def abstract?(param0); end
1131
+
1132
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#56
1133
+ def autocorrect(node); end
1134
+
1135
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#33
1136
+ def more_than_one_ancestor(param0 = T.unsafe(nil)); end
1137
+
1138
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#49
1139
+ def on_class(node); end
1140
+
1141
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#42
1142
+ def on_module(node); end
1143
+
1144
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#28
1145
+ def requires_ancestors(param0); end
1146
+
1147
+ private
1148
+
1149
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#72
1150
+ def new_ra_line(indent_count); end
1151
+
1152
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#66
1153
+ def process_node(node); end
1154
+ end
1155
+
1156
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/one_ancestor_per_line.rb#25
1157
+ RuboCop::Cop::Sorbet::OneAncestorPerLine::MSG = T.let(T.unsafe(nil), String)
1158
+
1159
+ # Forbids the use of redundant `extend T::Sig`. Only for use in
1160
+ # applications that monkey patch `Module.include(T::Sig)` globally,
1161
+ # which would make it redundant.
1162
+ #
1163
+ # @example
1164
+ # # bad
1165
+ # class Example
1166
+ # extend T::Sig
1167
+ # sig { void }
1168
+ # def no_op; end
1169
+ # end
1170
+ #
1171
+ # # good
1172
+ # class Example
1173
+ # sig { void }
1174
+ # def no_op; end
1175
+ # end
1176
+ #
1177
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb#28
1178
+ class RuboCop::Cop::Sorbet::RedundantExtendTSig < ::RuboCop::Cop::Base
1179
+ include ::RuboCop::Cop::RangeHelp
1180
+ extend ::RuboCop::Cop::AutoCorrector
1181
+
1182
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb#36
1183
+ def extend_t_sig?(param0 = T.unsafe(nil)); end
1184
+
1185
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb#40
1186
+ def on_send(node); end
1187
+ end
1188
+
1189
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb#32
1190
+ RuboCop::Cop::Sorbet::RedundantExtendTSig::MSG = T.let(T.unsafe(nil), String)
1191
+
1192
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/redundant_extend_t_sig.rb#33
1193
+ RuboCop::Cop::Sorbet::RedundantExtendTSig::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array)
1194
+
1195
+ # Checks for the correct order of sig builder methods:
1196
+ # - abstract, override, or overridable
1197
+ # - type_parameters
1198
+ # - params
1199
+ # - returns, or void
1200
+ # - soft, checked, or on_failure
1201
+ #
1202
+ # # bad
1203
+ # sig { returns(Integer).params(x: Integer) }
1204
+ #
1205
+ # # good
1206
+ # sig { params(x: Integer).returns(Integer) }
1207
+ #
1208
+ # @example
1209
+ # # bad
1210
+ # sig { void.abstract }
1211
+ #
1212
+ # # good
1213
+ # sig { abstract.void }
1214
+ #
1215
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#31
1216
+ class RuboCop::Cop::Sorbet::SignatureBuildOrder < ::RuboCop::Cop::Cop
1217
+ include ::RuboCop::Cop::Sorbet::SignatureHelp
1218
+
1219
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#77
1220
+ def autocorrect(node); end
1221
+
1222
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#53
1223
+ def on_signature(node); end
1224
+
1225
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#49
1226
+ def root_call(param0); end
1227
+
1228
+ private
1229
+
1230
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#119
1231
+ def call_chain(sig_child_node); end
1232
+
1233
+ # @return [Boolean]
1234
+ #
1235
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#115
1236
+ def can_autocorrect?; end
1237
+
1238
+ # This method exists to reparse the current node with modern features enabled.
1239
+ # Modern features include "index send" emitting, which is necessary to unparse
1240
+ # "index sends" (i.e. `[]` calls) back to index accessors (i.e. as `foo[bar]``).
1241
+ # Otherwise, we would get the unparsed node as `foo.[](bar)`.
1242
+ #
1243
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#106
1244
+ def node_reparsed_with_modern_features(node); end
1245
+ end
1246
+
1247
+ # Create a subclass of AST Builder that has modern features turned on
1248
+ #
1249
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#95
1250
+ class RuboCop::Cop::Sorbet::SignatureBuildOrder::ModernBuilder < ::RuboCop::AST::Builder; end
1251
+
1252
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/signatures/signature_build_order.rb#34
1253
+ RuboCop::Cop::Sorbet::SignatureBuildOrder::ORDER = T.let(T.unsafe(nil), Hash)
1254
+
1255
+ # Mixin for writing cops for signatures, providing a `signature?` node matcher and an `on_signature` trigger.
1256
+ #
1257
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/signature_help.rb#7
1258
+ module RuboCop::Cop::Sorbet::SignatureHelp
1259
+ extend ::RuboCop::AST::NodePattern::Macros
1260
+
1261
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/signature_help.rb#29
1262
+ def on_block(node); end
1263
+
1264
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/signature_help.rb#29
1265
+ def on_numblock(node); end
1266
+
1267
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/signature_help.rb#35
1268
+ def on_signature(_node); end
1269
+
1270
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/signature_help.rb#11
1271
+ def signature?(param0 = T.unsafe(nil)); end
1272
+
1273
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/signature_help.rb#20
1274
+ def with_runtime?(param0 = T.unsafe(nil)); end
1275
+
1276
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/signature_help.rb#25
1277
+ def without_runtime?(param0 = T.unsafe(nil)); end
1278
+ end
1279
+
1280
+ # Ensures empty class/module definitions in RBI files are
1281
+ # done on a single line rather than being split across multiple lines.
1282
+ #
1283
+ # @example
1284
+ #
1285
+ # # bad
1286
+ # module SomeModule
1287
+ # end
1288
+ #
1289
+ # # good
1290
+ # module SomeModule; end
1291
+ #
1292
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#17
1293
+ class RuboCop::Cop::Sorbet::SingleLineRbiClassModuleDefinitions < ::RuboCop::Cop::Base
1294
+ extend ::RuboCop::Cop::AutoCorrector
1295
+
1296
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#22
1297
+ def on_class(node); end
1298
+
1299
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#22
1300
+ def on_module(node); end
1301
+
1302
+ private
1303
+
1304
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#34
1305
+ def convert_newlines_to_semicolons(source); end
1306
+ end
1307
+
1308
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/rbi/single_line_rbi_class_module_definitions.rb#20
1309
+ RuboCop::Cop::Sorbet::SingleLineRbiClassModuleDefinitions::MSG = T.let(T.unsafe(nil), String)
1310
+
1311
+ # Makes the Sorbet `strict` sigil mandatory in all files.
1312
+ #
1313
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/strict_sigil.rb#10
1314
+ class RuboCop::Cop::Sorbet::StrictSigil < ::RuboCop::Cop::Sorbet::HasSigil
1315
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/strict_sigil.rb#11
1316
+ def minimum_strictness; end
1317
+ end
1318
+
1319
+ # Makes the Sorbet `strong` sigil mandatory in all files.
1320
+ #
1321
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/strong_sigil.rb#10
1322
+ class RuboCop::Cop::Sorbet::StrongSigil < ::RuboCop::Cop::Sorbet::HasSigil
1323
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/strong_sigil.rb#11
1324
+ def minimum_strictness; end
1325
+ end
1326
+
1327
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#6
1328
+ module RuboCop::Cop::Sorbet::TargetSorbetVersion
1329
+ mixes_in_class_methods ::RuboCop::Cop::Sorbet::TargetSorbetVersion::ClassMethods
1330
+
1331
+ # @return [Boolean]
1332
+ #
1333
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#28
1334
+ def enabled_for_sorbet_static_version?; end
1335
+
1336
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#44
1337
+ def read_sorbet_static_version_from_bundler_lock_file; end
1338
+
1339
+ # @return [Boolean]
1340
+ #
1341
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#24
1342
+ def sorbet_enabled?; end
1343
+
1344
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#35
1345
+ def target_sorbet_static_version_from_bundler_lock_file; end
1346
+
1347
+ class << self
1348
+ # @private
1349
+ #
1350
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#8
1351
+ def included(target); end
1352
+ end
1353
+ end
1354
+
1355
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#13
1356
+ module RuboCop::Cop::Sorbet::TargetSorbetVersion::ClassMethods
1357
+ # Sets the version of the Sorbet static type checker required by this cop
1358
+ #
1359
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#15
1360
+ def minimum_target_sorbet_static_version(version); end
1361
+
1362
+ # @return [Boolean]
1363
+ #
1364
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/mixin/target_sorbet_version.rb#19
1365
+ def supports_target_sorbet_static_version?(version); end
1366
+ end
1367
+
1368
+ # Makes the Sorbet `true` sigil mandatory in all files.
1369
+ #
1370
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/true_sigil.rb#10
1371
+ class RuboCop::Cop::Sorbet::TrueSigil < ::RuboCop::Cop::Sorbet::HasSigil
1372
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/true_sigil.rb#11
1373
+ def minimum_strictness; end
1374
+ end
1375
+
1376
+ # Ensures all constants used as `T.type_alias` are using CamelCase.
1377
+ #
1378
+ # @example
1379
+ #
1380
+ # # bad
1381
+ # FOO_OR_BAR = T.type_alias { T.any(Foo, Bar) }
1382
+ #
1383
+ # # good
1384
+ # FooOrBar = T.type_alias { T.any(Foo, Bar) }
1385
+ #
1386
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/type_alias_name.rb#17
1387
+ class RuboCop::Cop::Sorbet::TypeAliasName < ::RuboCop::Cop::Base
1388
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/type_alias_name.rb#32
1389
+ def on_casgn(node); end
1390
+
1391
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/type_alias_name.rb#21
1392
+ def underscored_type_alias?(param0 = T.unsafe(nil)); end
1393
+ end
1394
+
1395
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/type_alias_name.rb#18
1396
+ RuboCop::Cop::Sorbet::TypeAliasName::MSG = T.let(T.unsafe(nil), String)
1397
+
1398
+ # Checks that every Ruby file contains a valid Sorbet sigil.
1399
+ # Adapted from: https://gist.github.com/clarkdave/85aca4e16f33fd52aceb6a0a29936e52
1400
+ #
1401
+ # Options:
1402
+ #
1403
+ # * `RequireSigilOnAllFiles`: make offense if the Sorbet typed is not found in the file (default: false)
1404
+ # * `SuggestedStrictness`: Sorbet strictness level suggested in offense messages (default: 'false')
1405
+ # * `MinimumStrictness`: If set, make offense if the strictness level in the file is below this one
1406
+ # * `ExactStrictness`: If set, make offense if the strictness level in the file is different than this one
1407
+ #
1408
+ # If an `ExactStrictness` level is specified, it will be used in offense messages and autocorrect.
1409
+ # Otherwise, if a `MinimumStrictness` level is specified, it will be used in offense messages and autocorrect.
1410
+ #
1411
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#20
1412
+ class RuboCop::Cop::Sorbet::ValidSigil < ::RuboCop::Cop::Cop
1413
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#35
1414
+ def autocorrect(_node); end
1415
+
1416
+ # So we can properly subclass this cop
1417
+ #
1418
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#23
1419
+ def investigate(processed_source); end
1420
+
1421
+ protected
1422
+
1423
+ # checks
1424
+ #
1425
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#70
1426
+ def check_sigil_present(sigil); end
1427
+
1428
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#130
1429
+ def check_strictness_level(sigil, strictness); end
1430
+
1431
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#108
1432
+ def check_strictness_not_empty(sigil, strictness); end
1433
+
1434
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#119
1435
+ def check_strictness_valid(sigil, strictness); end
1436
+
1437
+ # Default is `nil`
1438
+ #
1439
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#180
1440
+ def exact_strictness; end
1441
+
1442
+ # extraction
1443
+ #
1444
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#58
1445
+ def extract_sigil(processed_source); end
1446
+
1447
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#64
1448
+ def extract_strictness(sigil); end
1449
+
1450
+ # Default is `nil`
1451
+ #
1452
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#174
1453
+ def minimum_strictness; end
1454
+
1455
+ # Default is `false`
1456
+ #
1457
+ # @return [Boolean]
1458
+ #
1459
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#163
1460
+ def require_sigil_on_all_files?; end
1461
+
1462
+ # Default is `'false'`
1463
+ #
1464
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#168
1465
+ def suggested_strictness; end
1466
+
1467
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#86
1468
+ def suggested_strictness_level; end
1469
+ end
1470
+
1471
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#54
1472
+ RuboCop::Cop::Sorbet::ValidSigil::SIGIL_REGEX = T.let(T.unsafe(nil), Regexp)
1473
+
1474
+ # source://rubocop-sorbet//lib/rubocop/cop/sorbet/sigils/valid_sigil.rb#53
1475
+ RuboCop::Cop::Sorbet::ValidSigil::STRICTNESS_LEVELS = T.let(T.unsafe(nil), Array)
1476
+
1477
+ module RuboCop::Cop::Style; end
1478
+
1479
+ class RuboCop::Cop::Style::MutableConstant < ::RuboCop::Cop::Base
1480
+ include ::RuboCop::Cop::Sorbet::MutableConstantSorbetAwareBehaviour
1481
+ end
1482
+
1483
+ # source://rubocop-sorbet//lib/rubocop/sorbet/version.rb#4
1484
+ module RuboCop::Sorbet; end
1485
+
1486
+ # source://rubocop-sorbet//lib/rubocop/sorbet.rb#12
1487
+ RuboCop::Sorbet::CONFIG = T.let(T.unsafe(nil), Hash)
1488
+
1489
+ # source://rubocop-sorbet//lib/rubocop/sorbet.rb#11
1490
+ RuboCop::Sorbet::CONFIG_DEFAULT = T.let(T.unsafe(nil), Pathname)
1491
+
1492
+ # source://rubocop-sorbet//lib/rubocop/sorbet.rb#8
1493
+ class RuboCop::Sorbet::Error < ::StandardError; end
1494
+
1495
+ # Because RuboCop doesn't yet support plugins, we have to monkey patch in a
1496
+ # bit of our configuration.
1497
+ #
1498
+ # source://rubocop-sorbet//lib/rubocop/sorbet/inject.rb#9
1499
+ module RuboCop::Sorbet::Inject
1500
+ class << self
1501
+ # source://rubocop-sorbet//lib/rubocop/sorbet/inject.rb#11
1502
+ def defaults!; end
1503
+ end
1504
+ end
1505
+
1506
+ # source://rubocop-sorbet//lib/rubocop/sorbet.rb#10
1507
+ RuboCop::Sorbet::PROJECT_ROOT = T.let(T.unsafe(nil), Pathname)
1508
+
1509
+ # source://rubocop-sorbet//lib/rubocop/sorbet/version.rb#5
1510
+ RuboCop::Sorbet::VERSION = T.let(T.unsafe(nil), String)