packwerk 2.2.0 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (187) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +29 -20
  3. data/.github/workflows/cla.yml +22 -0
  4. data/.rubocop.yml +48 -19
  5. data/Gemfile +7 -2
  6. data/Gemfile.lock +201 -175
  7. data/README.md +1 -1
  8. data/RESOLVING_VIOLATIONS.md +81 -0
  9. data/Rakefile +1 -1
  10. data/USAGE.md +14 -5
  11. data/bin/m +1 -1
  12. data/bin/rake +1 -1
  13. data/bin/rubocop +1 -1
  14. data/bin/srb +1 -1
  15. data/bin/tapioca +1 -1
  16. data/gemfiles/Gemfile-rails-6-0 +1 -1
  17. data/gemfiles/Gemfile-rails-6-1 +22 -0
  18. data/lib/packwerk/application_validator.rb +7 -6
  19. data/lib/packwerk/association_inspector.rb +17 -15
  20. data/lib/packwerk/cache.rb +36 -29
  21. data/lib/packwerk/cli.rb +5 -6
  22. data/lib/packwerk/const_node_inspector.rb +8 -7
  23. data/lib/packwerk/constant_name_inspector.rb +2 -2
  24. data/lib/packwerk/deprecated_references.rb +34 -19
  25. data/lib/packwerk/file_processor.rb +14 -14
  26. data/lib/packwerk/files_for_processing.rb +27 -31
  27. data/lib/packwerk/formatters/offenses_formatter.rb +3 -3
  28. data/lib/packwerk/formatters/progress_formatter.rb +2 -2
  29. data/lib/packwerk/node.rb +1 -294
  30. data/lib/packwerk/node_helpers.rb +335 -0
  31. data/lib/packwerk/node_processor.rb +6 -5
  32. data/lib/packwerk/node_processor_factory.rb +3 -3
  33. data/lib/packwerk/node_visitor.rb +1 -1
  34. data/lib/packwerk/offense_collection.rb +6 -3
  35. data/lib/packwerk/offenses_formatter.rb +2 -2
  36. data/lib/packwerk/package.rb +3 -0
  37. data/lib/packwerk/package_set.rb +2 -0
  38. data/lib/packwerk/parse_run.rb +15 -13
  39. data/lib/packwerk/parsed_constant_definitions.rb +23 -20
  40. data/lib/packwerk/parsers/erb.rb +3 -3
  41. data/lib/packwerk/reference_checking/checkers/checker.rb +16 -3
  42. data/lib/packwerk/reference_checking/checkers/dependency_checker.rb +16 -0
  43. data/lib/packwerk/reference_checking/checkers/privacy_checker.rb +18 -0
  44. data/lib/packwerk/reference_checking/reference_checker.rb +3 -1
  45. data/lib/packwerk/reference_extractor.rb +51 -48
  46. data/lib/packwerk/reference_offense.rb +3 -27
  47. data/lib/packwerk/run_context.rb +3 -3
  48. data/lib/packwerk/spring_command.rb +1 -1
  49. data/lib/packwerk/version.rb +1 -1
  50. data/lib/packwerk.rb +1 -0
  51. data/packwerk.gemspec +4 -12
  52. data/sorbet/rbi/gems/actioncable@7.0.3.1.rbi +2754 -0
  53. data/sorbet/rbi/gems/actionmailbox@7.0.3.1.rbi +1496 -0
  54. data/sorbet/rbi/gems/actionmailer@7.0.3.1.rbi +2362 -0
  55. data/sorbet/rbi/gems/actionpack@7.0.3.1.rbi +19397 -0
  56. data/sorbet/rbi/gems/actiontext@7.0.3.1.rbi +1569 -0
  57. data/sorbet/rbi/gems/actionview@7.0.3.1.rbi +14907 -0
  58. data/sorbet/rbi/gems/activejob@7.0.3.1.rbi +2553 -0
  59. data/sorbet/rbi/gems/activemodel@7.0.3.1.rbi +5999 -0
  60. data/sorbet/rbi/gems/activerecord@7.0.3.1.rbi +37832 -0
  61. data/sorbet/rbi/gems/activestorage@7.0.3.1.rbi +2321 -0
  62. data/sorbet/rbi/gems/activesupport@7.0.3.1.rbi +18818 -0
  63. data/sorbet/rbi/gems/concurrent-ruby@1.1.10.rbi +11722 -0
  64. data/sorbet/rbi/gems/constant_resolver@0.2.0.rbi +90 -0
  65. data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +1079 -0
  66. data/sorbet/rbi/gems/digest@3.1.0.rbi +189 -0
  67. data/sorbet/rbi/gems/erubi@1.11.0.rbi +140 -0
  68. data/sorbet/rbi/gems/globalid@1.0.0.rbi +572 -0
  69. data/sorbet/rbi/gems/i18n@1.12.0.rbi +2296 -0
  70. data/sorbet/rbi/gems/json@2.6.2.rbi +1548 -0
  71. data/sorbet/rbi/gems/language_server-protocol@3.16.0.3.rbi +8 -0
  72. data/sorbet/rbi/gems/loofah@2.18.0.rbi +877 -0
  73. data/sorbet/rbi/gems/m@1.6.0.rbi +257 -0
  74. data/sorbet/rbi/gems/marcel@1.0.2.rbi +220 -0
  75. data/sorbet/rbi/gems/mini_mime@1.1.2.rbi +170 -0
  76. data/sorbet/rbi/gems/mini_portile2@2.8.0.rbi +8 -0
  77. data/sorbet/rbi/gems/minitest-focus@1.3.1.rbi +104 -0
  78. data/sorbet/rbi/gems/minitest@5.16.2.rbi +2136 -0
  79. data/sorbet/rbi/gems/mocha@1.14.0.rbi +4177 -0
  80. data/sorbet/rbi/gems/net-imap@0.2.3.rbi +2147 -0
  81. data/sorbet/rbi/gems/net-pop@0.1.1.rbi +926 -0
  82. data/sorbet/rbi/gems/net-protocol@0.1.3.rbi +11 -0
  83. data/sorbet/rbi/gems/net-smtp@0.3.1.rbi +1108 -0
  84. data/sorbet/rbi/gems/netrc@0.11.0.rbi +153 -0
  85. data/sorbet/rbi/gems/nio4r@2.5.8.rbi +292 -0
  86. data/sorbet/rbi/gems/nokogiri@1.13.8.rbi +6478 -0
  87. data/sorbet/rbi/gems/parallel@1.22.1.rbi +277 -0
  88. data/sorbet/rbi/gems/parser@3.1.2.1.rbi +9029 -0
  89. data/sorbet/rbi/gems/prettier_print@0.1.0.rbi +8 -0
  90. data/sorbet/rbi/gems/pry@0.14.1.rbi +8 -0
  91. data/sorbet/rbi/gems/racc@1.6.0.rbi +152 -0
  92. data/sorbet/rbi/gems/rack-test@2.0.2.rbi +953 -0
  93. data/sorbet/rbi/gems/rack@2.2.4.rbi +5636 -0
  94. data/sorbet/rbi/gems/rails-html-sanitizer@1.4.3.rbi +688 -0
  95. data/sorbet/rbi/gems/rails@7.0.3.1.rbi +8 -0
  96. data/sorbet/rbi/gems/railties@7.0.3.1.rbi +3507 -0
  97. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +392 -0
  98. data/sorbet/rbi/gems/rake@13.0.6.rbi +2924 -0
  99. data/sorbet/rbi/gems/rbi@0.0.15.rbi +3007 -0
  100. data/sorbet/rbi/gems/regexp_parser@2.5.0.rbi +3383 -0
  101. data/sorbet/rbi/gems/rexml@3.2.5.rbi +4714 -0
  102. data/sorbet/rbi/gems/rubocop-ast@1.21.0.rbi +6961 -0
  103. data/sorbet/rbi/gems/rubocop-performance@1.14.3.rbi +2986 -0
  104. data/sorbet/rbi/gems/{rubocop-shopify@2.0.1.rbi → rubocop-shopify@2.9.0.rbi} +4 -4
  105. data/sorbet/rbi/gems/rubocop-sorbet@0.6.11.rbi +992 -0
  106. data/sorbet/rbi/gems/rubocop@1.34.1.rbi +51820 -0
  107. data/sorbet/rbi/gems/ruby-lsp@0.2.1.rbi +11 -0
  108. data/sorbet/rbi/gems/smart_properties@1.17.0.rbi +474 -0
  109. data/sorbet/rbi/gems/spoom@1.1.11.rbi +2181 -0
  110. data/sorbet/rbi/gems/spring@4.0.0.rbi +411 -0
  111. data/sorbet/rbi/gems/strscan@3.0.4.rbi +8 -0
  112. data/sorbet/rbi/gems/syntax_tree@3.3.0.rbi +8 -0
  113. data/sorbet/rbi/gems/tapioca@0.9.2.rbi +3181 -0
  114. data/sorbet/rbi/gems/thor@1.2.1.rbi +3956 -0
  115. data/sorbet/rbi/gems/timeout@0.3.0.rbi +142 -0
  116. data/sorbet/rbi/gems/tzinfo@2.0.5.rbi +5896 -0
  117. data/sorbet/rbi/gems/unicode-display_width@2.2.0.rbi +48 -0
  118. data/sorbet/rbi/gems/unparser@0.6.5.rbi +4529 -0
  119. data/sorbet/rbi/gems/webrick@1.7.0.rbi +2582 -0
  120. data/sorbet/rbi/gems/websocket-driver@0.7.5.rbi +993 -0
  121. data/sorbet/rbi/gems/yard-sorbet@0.6.1.rbi +388 -0
  122. data/sorbet/rbi/gems/yard@0.9.28.rbi +18242 -0
  123. data/sorbet/rbi/gems/zeitwerk@2.6.0.rbi +867 -0
  124. data/sorbet/rbi/shims/psych.rbi +5 -0
  125. data/sorbet/tapioca/require.rb +2 -3
  126. metadata +88 -157
  127. data/.github/probots.yml +0 -2
  128. data/library.yml +0 -6
  129. data/service.yml +0 -1
  130. data/sorbet/rbi/gems/actioncable@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -860
  131. data/sorbet/rbi/gems/actionmailbox@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -568
  132. data/sorbet/rbi/gems/actionmailer@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -587
  133. data/sorbet/rbi/gems/actionpack@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -5314
  134. data/sorbet/rbi/gems/actiontext@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -699
  135. data/sorbet/rbi/gems/actionview@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -2515
  136. data/sorbet/rbi/gems/activejob@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -624
  137. data/sorbet/rbi/gems/activemodel@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -1248
  138. data/sorbet/rbi/gems/activerecord@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -8363
  139. data/sorbet/rbi/gems/activestorage@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -876
  140. data/sorbet/rbi/gems/activesupport@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -3987
  141. data/sorbet/rbi/gems/colorize@0.8.1.rbi +0 -40
  142. data/sorbet/rbi/gems/commander@4.5.2.rbi +0 -8
  143. data/sorbet/rbi/gems/concurrent-ruby@1.1.8.rbi +0 -1969
  144. data/sorbet/rbi/gems/constant_resolver@0.1.5.rbi +0 -26
  145. data/sorbet/rbi/gems/erubi@1.10.0.rbi +0 -41
  146. data/sorbet/rbi/gems/globalid@0.4.2.rbi +0 -178
  147. data/sorbet/rbi/gems/highline@2.0.3.rbi +0 -8
  148. data/sorbet/rbi/gems/i18n@1.8.10.rbi +0 -600
  149. data/sorbet/rbi/gems/loofah@2.9.0.rbi +0 -274
  150. data/sorbet/rbi/gems/m@1.5.1.rbi +0 -108
  151. data/sorbet/rbi/gems/marcel@1.0.0.rbi +0 -70
  152. data/sorbet/rbi/gems/mini_mime@1.0.3.rbi +0 -71
  153. data/sorbet/rbi/gems/minitest-focus@1.2.1.rbi +0 -8
  154. data/sorbet/rbi/gems/minitest@5.14.4.rbi +0 -544
  155. data/sorbet/rbi/gems/mocha@1.12.0.rbi +0 -953
  156. data/sorbet/rbi/gems/nio4r@2.5.7.rbi +0 -90
  157. data/sorbet/rbi/gems/nokogiri@1.11.2.rbi +0 -1647
  158. data/sorbet/rbi/gems/parallel@1.20.1.rbi +0 -117
  159. data/sorbet/rbi/gems/parlour@6.0.0.rbi +0 -1272
  160. data/sorbet/rbi/gems/parser@3.0.0.0.rbi +0 -1745
  161. data/sorbet/rbi/gems/pry@0.14.0.rbi +0 -8
  162. data/sorbet/rbi/gems/psych@3.3.2.rbi +0 -24
  163. data/sorbet/rbi/gems/racc@1.5.2.rbi +0 -57
  164. data/sorbet/rbi/gems/rack-test@1.1.0.rbi +0 -335
  165. data/sorbet/rbi/gems/rack@2.2.3.rbi +0 -1718
  166. data/sorbet/rbi/gems/rails-html-sanitizer@1.3.0.rbi +0 -213
  167. data/sorbet/rbi/gems/rails@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -8
  168. data/sorbet/rbi/gems/railties@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -880
  169. data/sorbet/rbi/gems/rainbow@3.0.0.rbi +0 -155
  170. data/sorbet/rbi/gems/rake@13.0.3.rbi +0 -837
  171. data/sorbet/rbi/gems/regexp_parser@2.1.1.rbi +0 -8
  172. data/sorbet/rbi/gems/rexml@3.2.4.rbi +0 -8
  173. data/sorbet/rbi/gems/rubocop-ast@1.4.1.rbi +0 -8
  174. data/sorbet/rbi/gems/rubocop-performance@1.10.2.rbi +0 -8
  175. data/sorbet/rbi/gems/rubocop-sorbet@0.6.1.rbi +0 -8
  176. data/sorbet/rbi/gems/rubocop@1.12.0.rbi +0 -8
  177. data/sorbet/rbi/gems/smart_properties@1.15.0.rbi +0 -168
  178. data/sorbet/rbi/gems/spoom@1.1.0.rbi +0 -1061
  179. data/sorbet/rbi/gems/spring@2.1.1.rbi +0 -160
  180. data/sorbet/rbi/gems/sprockets-rails@3.2.2.rbi +0 -451
  181. data/sorbet/rbi/gems/sprockets@4.0.2.rbi +0 -1133
  182. data/sorbet/rbi/gems/tapioca@0.4.19.rbi +0 -603
  183. data/sorbet/rbi/gems/thor@1.1.0.rbi +0 -893
  184. data/sorbet/rbi/gems/tzinfo@2.0.4.rbi +0 -566
  185. data/sorbet/rbi/gems/unicode-display_width@2.0.0.rbi +0 -8
  186. data/sorbet/rbi/gems/websocket-driver@0.7.3.rbi +0 -438
  187. data/sorbet/rbi/gems/zeitwerk@2.4.2.rbi +0 -177
@@ -1,603 +0,0 @@
1
- # DO NOT EDIT MANUALLY
2
- # This is an autogenerated file for types exported from the `tapioca` gem.
3
- # Please instead update this file by running `bin/tapioca sync`.
4
-
5
- # typed: true
6
-
7
- module T::Generic::TypeStoragePatch
8
- def [](*types); end
9
- def type_member(variance = T.unsafe(nil), fixed: T.unsafe(nil), lower: T.unsafe(nil), upper: T.unsafe(nil)); end
10
- def type_template(variance = T.unsafe(nil), fixed: T.unsafe(nil), lower: T.unsafe(nil), upper: T.unsafe(nil)); end
11
- end
12
-
13
- module T::Types::Simple::GenericNamePatch
14
- def name; end
15
- end
16
-
17
- module T::Types::Simple::NamePatch
18
- def name; end
19
- end
20
-
21
- module Tapioca
22
- class << self
23
- def silence_warnings(&blk); end
24
- end
25
- end
26
-
27
- module Tapioca::Cli
28
- end
29
-
30
- class Tapioca::Cli::Main < ::Thor
31
- include(::Thor::Actions)
32
- extend(::Thor::Actions::ClassMethods)
33
-
34
- def __print_version; end
35
- def dsl(*constants); end
36
- def generate(*gems); end
37
- def init; end
38
- def require; end
39
- def sync; end
40
- def todo; end
41
-
42
- private
43
-
44
- def create_config; end
45
- def create_post_require; end
46
- def generate_binstub; end
47
- def generator; end
48
-
49
- class << self
50
- def exit_on_failure?; end
51
- end
52
- end
53
-
54
- module Tapioca::Compilers
55
- end
56
-
57
- module Tapioca::Compilers::Dsl
58
- end
59
-
60
- class Tapioca::Compilers::Dsl::Base
61
- abstract!
62
-
63
- sig { void }
64
- def initialize; end
65
-
66
- sig { abstract.type_parameters(:T).params(root: Parlour::RbiGenerator::Namespace, constant: T.type_parameter(:T)).void }
67
- def decorate(root, constant); end
68
- sig { abstract.returns(T::Enumerable[Module]) }
69
- def gather_constants; end
70
- sig { params(constant: Module).returns(T::Boolean) }
71
- def handles?(constant); end
72
- sig { returns(T::Set[Module]) }
73
- def processable_constants; end
74
-
75
- private
76
-
77
- sig { params(method_def: T.any(Method, UnboundMethod)).returns(T::Array[Parlour::RbiGenerator::Parameter]) }
78
- def compile_method_parameters_to_parlour(method_def); end
79
- sig { params(method_def: T.any(Method, UnboundMethod)).returns(T.nilable(String)) }
80
- def compile_method_return_type_to_parlour(method_def); end
81
- sig { params(namespace: Parlour::RbiGenerator::Namespace, name: String, options: T::Hash[T.untyped, T.untyped]).void }
82
- def create_method(namespace, name, options = T.unsafe(nil)); end
83
- sig { params(namespace: Parlour::RbiGenerator::Namespace, method_def: T.any(Method, UnboundMethod), class_method: T::Boolean).void }
84
- def create_method_from_def(namespace, method_def, class_method: T.unsafe(nil)); end
85
- sig { params(method_def: T.any(Method, UnboundMethod), signature: T.untyped).returns(T::Array[String]) }
86
- def parameters_types_from_signature(method_def, signature); end
87
- sig { params(name: String).returns(T::Boolean) }
88
- def valid_method_name?(name); end
89
- end
90
-
91
- Tapioca::Compilers::Dsl::Base::SPECIAL_METHOD_NAMES = T.let(T.unsafe(nil), Array)
92
-
93
- class Tapioca::Compilers::DslCompiler
94
- sig { params(requested_constants: T::Array[Module], requested_generators: T::Array[String], error_handler: T.nilable(T.proc.params(error: String).void)).void }
95
- def initialize(requested_constants:, requested_generators: T.unsafe(nil), error_handler: T.unsafe(nil)); end
96
-
97
- sig { returns(T.proc.params(error: String).void) }
98
- def error_handler; end
99
- sig { returns(T::Enumerable[Tapioca::Compilers::Dsl::Base]) }
100
- def generators; end
101
- sig { returns(T::Array[Module]) }
102
- def requested_constants; end
103
- sig { params(blk: T.proc.params(constant: Module, rbi: String).void).void }
104
- def run(&blk); end
105
-
106
- private
107
-
108
- sig { params(requested_constants: T::Array[Module]).returns(T::Set[Module]) }
109
- def gather_constants(requested_constants); end
110
- sig { params(requested_generators: T::Array[String]).returns(T::Enumerable[Tapioca::Compilers::Dsl::Base]) }
111
- def gather_generators(requested_generators); end
112
- sig { params(requested_generators: T::Array[String]).returns(T.proc.params(klass: Class).returns(T::Boolean)) }
113
- def generator_filter(requested_generators); end
114
- sig { params(constant: Module).returns(T.nilable(String)) }
115
- def rbi_for_constant(constant); end
116
- sig { params(error: String).returns(T.noreturn) }
117
- def report_error(error); end
118
- sig { params(parlour: Parlour::RbiGenerator).void }
119
- def resolve_conflicts(parlour); end
120
- end
121
-
122
- class Tapioca::Compilers::RequiresCompiler
123
- sig { params(sorbet_path: String).void }
124
- def initialize(sorbet_path); end
125
-
126
- sig { returns(String) }
127
- def compile; end
128
-
129
- private
130
-
131
- sig { params(config: Spoom::Sorbet::Config).returns(T::Array[String]) }
132
- def collect_files(config); end
133
- sig { params(file_path: String).returns(T::Enumerable[String]) }
134
- def collect_requires(file_path); end
135
- sig { params(config: Spoom::Sorbet::Config, file_path: Pathname).returns(T::Boolean) }
136
- def file_ignored_by_sorbet?(config, file_path); end
137
- sig { params(files: T::Enumerable[String], name: String).returns(T::Boolean) }
138
- def name_in_project?(files, name); end
139
- sig { params(path: Pathname).returns(T::Array[String]) }
140
- def path_parts(path); end
141
- end
142
-
143
- module Tapioca::Compilers::Sorbet
144
- class << self
145
- sig { params(args: String).returns(String) }
146
- def run(*args); end
147
- sig { returns(String) }
148
- def sorbet_path; end
149
- end
150
- end
151
-
152
- Tapioca::Compilers::Sorbet::EXE_PATH_ENV_VAR = T.let(T.unsafe(nil), String)
153
-
154
- Tapioca::Compilers::Sorbet::SORBET = T.let(T.unsafe(nil), Pathname)
155
-
156
- module Tapioca::Compilers::SymbolTable
157
- end
158
-
159
- class Tapioca::Compilers::SymbolTable::SymbolGenerator
160
- sig { params(gem: Tapioca::Gemfile::Gem, indent: Integer).void }
161
- def initialize(gem, indent = T.unsafe(nil)); end
162
-
163
- def gem; end
164
- sig { returns(String) }
165
- def generate; end
166
- def indent; end
167
-
168
- private
169
-
170
- sig { params(name: String).void }
171
- def add_to_alias_namespace(name); end
172
- sig { params(name: String).returns(T::Boolean) }
173
- def alias_namespaced?(name); end
174
- sig { params(constant: Module).returns(T::Array[Module]) }
175
- def ancestors_of(constant); end
176
- sig { params(constant: Module, other: BasicObject).returns(T::Boolean) }
177
- def are_equal?(constant, other); end
178
- sig { params(constant: BasicObject).returns(Class) }
179
- def class_of(constant); end
180
- sig { params(name: T.nilable(String), constant: BasicObject).returns(T.nilable(String)) }
181
- def compile(name, constant); end
182
- sig { params(name: String, constant: Module).returns(T.nilable(String)) }
183
- def compile_alias(name, constant); end
184
- sig { params(name: String, constant: Module).returns(T.nilable(String)) }
185
- def compile_body(name, constant); end
186
- sig { params(name: String, constant: BasicObject).returns(T.nilable(String)) }
187
- def compile_constant(name, constant); end
188
- sig { params(module_name: String, mod: Module, for_visibility: T::Array[Symbol]).returns(T.nilable(String)) }
189
- def compile_directly_owned_methods(module_name, mod, for_visibility = T.unsafe(nil)); end
190
- sig { params(constant: Module).returns(T.nilable(String)) }
191
- def compile_enums(constant); end
192
- sig { params(symbol_name: String, constant: Module, method: T.nilable(UnboundMethod)).returns(T.nilable(String)) }
193
- def compile_method(symbol_name, constant, method); end
194
- sig { params(name: String, constant: Module).returns(T.nilable(String)) }
195
- def compile_methods(name, constant); end
196
- sig { params(constant: Module).returns(String) }
197
- def compile_mixes_in_class_methods(constant); end
198
- sig { params(constant: Module).returns(String) }
199
- def compile_mixins(constant); end
200
- sig { params(name: String, constant: Module).returns(T.nilable(String)) }
201
- def compile_module(name, constant); end
202
- sig { params(constant: Module).returns(T.nilable(String)) }
203
- def compile_module_helpers(constant); end
204
- sig { params(name: String, value: BasicObject).returns(T.nilable(String)) }
205
- def compile_object(name, value); end
206
- sig { params(constant: Module).returns(T.nilable(String)) }
207
- def compile_props(constant); end
208
- sig { params(signature: T.untyped, parameters: T::Array[[Symbol, String]]).returns(String) }
209
- def compile_signature(signature, parameters); end
210
- sig { params(name: String, constant: Module).returns(T.nilable(String)) }
211
- def compile_subconstants(name, constant); end
212
- sig { params(constant: Class).returns(String) }
213
- def compile_superclass(constant); end
214
- sig { params(constant: Module).returns(T.nilable(String)) }
215
- def compile_type_variable_declarations(constant); end
216
- sig { params(constant: Module).returns(T.nilable(String)) }
217
- def compile_type_variables(constant); end
218
- sig { params(constant: Module).returns(T::Array[Symbol]) }
219
- def constants_of(constant); end
220
- sig { params(constant: Module, strict: T::Boolean).returns(T::Boolean) }
221
- def defined_in_gem?(constant, strict: T.unsafe(nil)); end
222
- sig { params(symbols: T::Set[String]).returns(T::Set[String]) }
223
- def engine_symbols(symbols); end
224
- sig { params(symbol: String).returns(T.nilable(String)) }
225
- def generate_from_symbol(symbol); end
226
- sig { params(constant: Module).returns(T::Array[String]) }
227
- def get_file_candidates(constant); end
228
- sig { params(str: String).returns(String) }
229
- def indented(str); end
230
- sig { params(constant: Module).returns(T::Array[Module]) }
231
- def inherited_ancestors_of(constant); end
232
- def initialize_method_for(constant); end
233
- sig { params(constant: Module).returns(T::Array[Module]) }
234
- def interesting_ancestors_of(constant); end
235
- sig { params(name: String).void }
236
- def mark_seen(name); end
237
- sig { params(method: UnboundMethod).returns(T::Boolean) }
238
- def method_in_gem?(method); end
239
- sig { params(mod: Module).returns(T::Hash[Symbol, T::Array[Symbol]]) }
240
- def method_names_by_visibility(mod); end
241
- sig { params(constant: Module).returns(T.nilable(String)) }
242
- def name_of(constant); end
243
- sig { params(constant: Module).returns(T.nilable(String)) }
244
- def name_of_proxy_target(constant); end
245
- sig { params(object: BasicObject).returns(Integer) }
246
- def object_id_of(object); end
247
- def parent_declares_constant?(name); end
248
- sig { params(constant: Module).returns(T::Boolean) }
249
- def public_module?(constant); end
250
- sig { params(constant: Module).returns(T.nilable(String)) }
251
- def qualified_name_of(constant); end
252
- sig { params(constant: Module).returns(T.nilable(String)) }
253
- def raw_name_of(constant); end
254
- sig { params(symbol: String, inherit: T::Boolean, namespace: Module).returns(BasicObject) }
255
- def resolve_constant(symbol, inherit: T.unsafe(nil), namespace: T.unsafe(nil)); end
256
- sig { params(name: String).returns(T::Boolean) }
257
- def seen?(name); end
258
- sig { params(method: T.any(Method, UnboundMethod)).returns(T.untyped) }
259
- def signature_of(method); end
260
- sig { params(constant: Module).returns(Class) }
261
- def singleton_class_of(constant); end
262
- sig { params(constant: Module, method_name: String).returns(T::Boolean) }
263
- def struct_method?(constant, method_name); end
264
- sig { params(constant: Class).returns(T.nilable(Class)) }
265
- def superclass_of(constant); end
266
- sig { params(symbol_name: String).returns(T::Boolean) }
267
- def symbol_ignored?(symbol_name); end
268
- sig { returns(T::Set[String]) }
269
- def symbols; end
270
- sig { params(constant: T::Types::Base).returns(String) }
271
- def type_of(constant); end
272
- sig { params(name: String).returns(T::Boolean) }
273
- def valid_method_name?(name); end
274
- sig { type_parameters(:U).params(step: Integer, _blk: T.proc.returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) }
275
- def with_indentation(step = T.unsafe(nil), &_blk); end
276
- sig { params(constant: Module, blk: T.proc.returns(T.nilable(String))).returns(T.nilable(String)) }
277
- def with_indentation_for_constant(constant, &blk); end
278
- end
279
-
280
- Tapioca::Compilers::SymbolTable::SymbolGenerator::IGNORED_SYMBOLS = T.let(T.unsafe(nil), Array)
281
-
282
- Tapioca::Compilers::SymbolTable::SymbolGenerator::SPECIAL_METHOD_NAMES = T.let(T.unsafe(nil), Array)
283
-
284
- Tapioca::Compilers::SymbolTable::SymbolGenerator::TYPE_PARAMETER_MATCHER = T.let(T.unsafe(nil), Regexp)
285
-
286
- module Tapioca::Compilers::SymbolTable::SymbolLoader
287
- class << self
288
- def ignore_symbol?(symbol); end
289
- sig { params(paths: T::Array[Pathname]).returns(T::Set[String]) }
290
- def list_from_paths(paths); end
291
-
292
- private
293
-
294
- def ignored_symbols; end
295
- sig { params(paths: T::Array[String]).returns(T::Set[String]) }
296
- def load_symbols(paths); end
297
- def symbol_table_json_from(input, table_type: T.unsafe(nil)); end
298
- end
299
- end
300
-
301
- class Tapioca::Compilers::SymbolTable::SymbolLoader::SymbolTableParser
302
- class << self
303
- def parse(object, parents = T.unsafe(nil)); end
304
- end
305
- end
306
-
307
- class Tapioca::Compilers::SymbolTableCompiler
308
- sig { params(gem: Tapioca::Gemfile::Gem, indent: Integer).returns(String) }
309
- def compile(gem, indent = T.unsafe(nil)); end
310
- end
311
-
312
- class Tapioca::Compilers::TodosCompiler
313
- sig { returns(String) }
314
- def compile; end
315
-
316
- private
317
-
318
- sig { returns(String) }
319
- def list_todos; end
320
- end
321
-
322
- class Tapioca::Config < ::T::Struct
323
- const :outdir, String
324
- const :prerequire, T.nilable(String)
325
- const :postrequire, String
326
- const :exclude, T::Array[String]
327
- const :typed_overrides, T::Hash[String, String]
328
- const :todos_path, String
329
- const :generators, T::Array[String]
330
-
331
- sig { returns(Pathname) }
332
- def outpath; end
333
-
334
- class << self
335
- def inherited(s); end
336
- end
337
- end
338
-
339
- Tapioca::Config::DEFAULT_COMMAND = T.let(T.unsafe(nil), String)
340
-
341
- Tapioca::Config::DEFAULT_DSLDIR = T.let(T.unsafe(nil), String)
342
-
343
- Tapioca::Config::DEFAULT_GEMDIR = T.let(T.unsafe(nil), String)
344
-
345
- Tapioca::Config::DEFAULT_OVERRIDES = T.let(T.unsafe(nil), Hash)
346
-
347
- Tapioca::Config::DEFAULT_POSTREQUIRE = T.let(T.unsafe(nil), String)
348
-
349
- Tapioca::Config::DEFAULT_RBIDIR = T.let(T.unsafe(nil), String)
350
-
351
- Tapioca::Config::DEFAULT_TODOSPATH = T.let(T.unsafe(nil), String)
352
-
353
- Tapioca::Config::SORBET_CONFIG = T.let(T.unsafe(nil), String)
354
-
355
- Tapioca::Config::SORBET_PATH = T.let(T.unsafe(nil), String)
356
-
357
- Tapioca::Config::TAPIOCA_CONFIG = T.let(T.unsafe(nil), String)
358
-
359
- Tapioca::Config::TAPIOCA_PATH = T.let(T.unsafe(nil), String)
360
-
361
- class Tapioca::ConfigBuilder
362
- class << self
363
- sig { params(command: Symbol, options: T::Hash[String, T.untyped]).returns(Tapioca::Config) }
364
- def from_options(command, options); end
365
-
366
- private
367
-
368
- sig { returns(T::Hash[String, T.untyped]) }
369
- def config_options; end
370
- sig { params(command: Symbol).returns(T::Hash[String, T.untyped]) }
371
- def default_options(command); end
372
- sig { params(options: T::Hash[String, T.untyped]).returns(T::Hash[String, T.untyped]) }
373
- def merge_options(*options); end
374
- end
375
- end
376
-
377
- Tapioca::ConfigBuilder::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash)
378
-
379
- module Tapioca::ConstantLocator
380
-
381
- private
382
-
383
- def files_for(klass); end
384
-
385
- class << self
386
- def files_for(klass); end
387
- end
388
- end
389
-
390
- class Tapioca::Error < ::StandardError
391
- end
392
-
393
- class Tapioca::Gemfile
394
- sig { void }
395
- def initialize; end
396
-
397
- sig { returns(Bundler::Definition) }
398
- def definition; end
399
- sig { returns(T::Array[Tapioca::Gemfile::Gem]) }
400
- def dependencies; end
401
- sig { params(gem_name: String).returns(T.nilable(Tapioca::Gemfile::Gem)) }
402
- def gem(gem_name); end
403
- sig { returns(T::Array[String]) }
404
- def missing_specs; end
405
- sig { void }
406
- def require; end
407
-
408
- private
409
-
410
- sig { returns(String) }
411
- def dir; end
412
- sig { returns(File) }
413
- def gemfile; end
414
- sig { returns(T::Array[Symbol]) }
415
- def groups; end
416
- sig { returns([T::Array[Tapioca::Gemfile::Gem], T::Array[String]]) }
417
- def load_dependencies; end
418
- def lockfile; end
419
- sig { returns(Bundler::Runtime) }
420
- def runtime; end
421
- end
422
-
423
- class Tapioca::Gemfile::Gem
424
- sig { params(spec: T.any(Gem::Specification, T.all(Bundler::RemoteSpecification, Bundler::StubSpecification))).void }
425
- def initialize(spec); end
426
-
427
- sig { params(path: String).returns(T::Boolean) }
428
- def contains_path?(path); end
429
- sig { returns(T::Array[Pathname]) }
430
- def files; end
431
- sig { returns(String) }
432
- def full_gem_path; end
433
- sig { params(gemfile_dir: String).returns(T::Boolean) }
434
- def ignore?(gemfile_dir); end
435
- sig { returns(String) }
436
- def name; end
437
- sig { returns(String) }
438
- def rbi_file_name; end
439
- def version; end
440
-
441
- private
442
-
443
- sig { returns(T::Boolean) }
444
- def gem_ignored?; end
445
- sig { params(gemfile_dir: String).returns(T::Boolean) }
446
- def gem_in_app_dir?(gemfile_dir); end
447
- sig { returns(T::Boolean) }
448
- def gem_in_bundle_path?; end
449
- sig { params(path: String).returns(T::Boolean) }
450
- def has_parent_gemspec?(path); end
451
- sig { params(path: T.any(Pathname, String)).returns(String) }
452
- def to_realpath(path); end
453
- sig { returns(String) }
454
- def version_string; end
455
- end
456
-
457
- Tapioca::Gemfile::Gem::IGNORED_GEMS = T.let(T.unsafe(nil), Array)
458
-
459
- class Tapioca::Generator < ::Thor::Shell::Color
460
- sig { params(config: Tapioca::Config).void }
461
- def initialize(config); end
462
-
463
- sig { params(requested_constants: T::Array[String], should_verify: T::Boolean).void }
464
- def build_dsl(requested_constants, should_verify: T.unsafe(nil)); end
465
- sig { params(gem_names: T::Array[String]).void }
466
- def build_gem_rbis(gem_names); end
467
- sig { void }
468
- def build_requires; end
469
- sig { void }
470
- def build_todos; end
471
- sig { returns(Tapioca::Config) }
472
- def config; end
473
- sig { void }
474
- def sync_rbis_with_gemfile; end
475
-
476
- private
477
-
478
- sig { params(filename: Pathname).void }
479
- def add(filename); end
480
- sig { returns(T::Array[String]) }
481
- def added_rbis; end
482
- sig { returns(Tapioca::Gemfile) }
483
- def bundle; end
484
- sig { params(constant: Module, contents: String, outpath: Pathname).returns(T.nilable(Pathname)) }
485
- def compile_dsl_rbi(constant, contents, outpath: T.unsafe(nil)); end
486
- sig { params(gem: Tapioca::Gemfile::Gem).void }
487
- def compile_gem_rbi(gem); end
488
- sig { returns(Tapioca::Compilers::SymbolTableCompiler) }
489
- def compiler; end
490
- sig { params(constant_names: T::Array[String]).returns(T::Array[Module]) }
491
- def constantize(constant_names); end
492
- sig { params(constant_name: String).returns(Pathname) }
493
- def dsl_rbi_filename(constant_name); end
494
- sig { params(gem_name: String).returns(Pathname) }
495
- def existing_rbi(gem_name); end
496
- sig { params(requested_constants: T::Array[String], path: Pathname).returns(T::Set[Pathname]) }
497
- def existing_rbi_filenames(requested_constants, path: T.unsafe(nil)); end
498
- sig { returns(T::Hash[String, String]) }
499
- def existing_rbis; end
500
- sig { params(gem_name: String).returns(Pathname) }
501
- def expected_rbi(gem_name); end
502
- sig { returns(T::Hash[String, String]) }
503
- def expected_rbis; end
504
- sig { params(file: String, error: LoadError).void }
505
- def explain_failed_require(file, error); end
506
- sig { params(gem_name: String).returns(T::Boolean) }
507
- def gem_rbi_exists?(gem_name); end
508
- sig { params(gem_name: String, version: String).returns(Pathname) }
509
- def gem_rbi_filename(gem_name, version); end
510
- sig { params(gem_names: T::Array[String]).returns(T::Array[Tapioca::Gemfile::Gem]) }
511
- def gems_to_generate(gem_names); end
512
- sig { params(eager_load: T::Boolean).void }
513
- def load_application(eager_load:); end
514
- sig { void }
515
- def load_dsl_generators; end
516
- sig { returns(Tapioca::Loader) }
517
- def loader; end
518
- sig { params(old_filename: Pathname, new_filename: Pathname).void }
519
- def move(old_filename, new_filename); end
520
- sig { void }
521
- def perform_additions; end
522
- sig { params(dir: String).void }
523
- def perform_dsl_verification(dir); end
524
- sig { void }
525
- def perform_removals; end
526
- sig { params(files: T::Set[Pathname]).void }
527
- def purge_stale_dsl_rbi_files(files); end
528
- sig { params(command: String, reason: T.nilable(String), strictness: T.nilable(String)).returns(String) }
529
- def rbi_header(command, reason: T.unsafe(nil), strictness: T.unsafe(nil)); end
530
- sig { params(filename: Pathname).void }
531
- def remove(filename); end
532
- sig { returns(T::Array[String]) }
533
- def removed_rbis; end
534
- sig { void }
535
- def require_gem_file; end
536
- sig { params(message: String, color: T.any(Symbol, T::Array[Symbol])).void }
537
- def say_error(message = T.unsafe(nil), *color); end
538
- sig { params(tmp_dir: Pathname).returns(T.nilable(String)) }
539
- def verify_dsl_rbi(tmp_dir:); end
540
- end
541
-
542
- Tapioca::Generator::EMPTY_RBI_COMMENT = T.let(T.unsafe(nil), String)
543
-
544
- module Tapioca::GenericTypeRegistry
545
- class << self
546
- sig { params(constant: Module).returns(T.nilable(T::Hash[Integer, String])) }
547
- def lookup_type_variables(constant); end
548
- sig { params(constant: T.untyped, types: T.untyped).returns(Module) }
549
- def register_type(constant, types); end
550
- sig { params(constant: T.untyped, type_member: T::Types::TypeVariable, fixed: T.untyped, lower: T.untyped, upper: T.untyped).void }
551
- def register_type_member(constant, type_member, fixed, lower, upper); end
552
- sig { params(constant: T.untyped, type_template: T::Types::TypeVariable, fixed: T.untyped, lower: T.untyped, upper: T.untyped).void }
553
- def register_type_template(constant, type_template, fixed, lower, upper); end
554
-
555
- private
556
-
557
- sig { params(constant: Module, name: String).returns(Module) }
558
- def create_generic_type(constant, name); end
559
- sig { params(constant: Module).returns(T::Hash[Integer, String]) }
560
- def lookup_or_initialize_type_variables(constant); end
561
- sig { params(constant: Module).returns(T.nilable(String)) }
562
- def name_of(constant); end
563
- sig { params(object: BasicObject).returns(Integer) }
564
- def object_id_of(object); end
565
- sig { params(constant: T.untyped, type_variable_type: T.deprecated_enum([:type_member, :type_template]), type_variable: T::Types::TypeVariable, fixed: T.untyped, lower: T.untyped, upper: T.untyped).void }
566
- def register_type_variable(constant, type_variable_type, type_variable, fixed, lower, upper); end
567
- sig { params(type_variable_type: Symbol, variance: Symbol, fixed: T.untyped, lower: T.untyped, upper: T.untyped).returns(String) }
568
- def serialize_type_variable(type_variable_type, variance, fixed, lower, upper); end
569
- end
570
- end
571
-
572
- class Tapioca::Loader
573
- sig { params(gemfile: Tapioca::Gemfile).void }
574
- def initialize(gemfile); end
575
-
576
- sig { params(initialize_file: T.nilable(String), require_file: T.nilable(String)).void }
577
- def load_bundle(initialize_file, require_file); end
578
- sig { params(environment_load: T::Boolean, eager_load: T::Boolean).void }
579
- def load_rails(environment_load: T.unsafe(nil), eager_load: T.unsafe(nil)); end
580
-
581
- private
582
-
583
- sig { void }
584
- def eager_load_rails_app; end
585
- sig { returns(Tapioca::Gemfile) }
586
- def gemfile; end
587
- sig { void }
588
- def load_rails_engines; end
589
- sig { void }
590
- def load_rake; end
591
- sig { returns(T::Array[T.untyped]) }
592
- def rails_engines; end
593
- sig { void }
594
- def require_bundle; end
595
- sig { params(file: T.nilable(String)).void }
596
- def require_helper(file); end
597
- sig { params(path: String).void }
598
- def safe_require(path); end
599
- sig { void }
600
- def silence_deprecations; end
601
- end
602
-
603
- Tapioca::VERSION = T.let(T.unsafe(nil), String)