packwerk 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/ISSUE_TEMPLATE/bug_report.md +27 -0
- data/.github/probots.yml +2 -0
- data/.github/pull_request_template.md +27 -0
- data/.github/workflows/ci.yml +50 -0
- data/.gitignore +12 -0
- data/.rubocop.yml +46 -0
- data/.ruby-version +1 -0
- data/CODEOWNERS +1 -0
- data/CODE_OF_CONDUCT.md +76 -0
- data/CONTRIBUTING.md +17 -0
- data/Gemfile +22 -0
- data/Gemfile.lock +236 -0
- data/LICENSE.md +7 -0
- data/README.md +73 -0
- data/Rakefile +13 -0
- data/TROUBLESHOOT.md +67 -0
- data/USAGE.md +250 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/dev.yml +32 -0
- data/docs/cohesion.png +0 -0
- data/exe/packwerk +6 -0
- data/lib/packwerk.rb +44 -0
- data/lib/packwerk/application_validator.rb +343 -0
- data/lib/packwerk/association_inspector.rb +44 -0
- data/lib/packwerk/checking_deprecated_references.rb +40 -0
- data/lib/packwerk/cli.rb +238 -0
- data/lib/packwerk/configuration.rb +82 -0
- data/lib/packwerk/const_node_inspector.rb +44 -0
- data/lib/packwerk/constant_discovery.rb +60 -0
- data/lib/packwerk/constant_name_inspector.rb +22 -0
- data/lib/packwerk/dependency_checker.rb +28 -0
- data/lib/packwerk/deprecated_references.rb +92 -0
- data/lib/packwerk/file_processor.rb +43 -0
- data/lib/packwerk/files_for_processing.rb +67 -0
- data/lib/packwerk/formatters/progress_formatter.rb +46 -0
- data/lib/packwerk/generators/application_validation.rb +62 -0
- data/lib/packwerk/generators/configuration_file.rb +69 -0
- data/lib/packwerk/generators/inflections_file.rb +43 -0
- data/lib/packwerk/generators/root_package.rb +37 -0
- data/lib/packwerk/generators/templates/inflections.yml +6 -0
- data/lib/packwerk/generators/templates/package.yml +17 -0
- data/lib/packwerk/generators/templates/packwerk +23 -0
- data/lib/packwerk/generators/templates/packwerk.yml.erb +23 -0
- data/lib/packwerk/generators/templates/packwerk_validator_test.rb +11 -0
- data/lib/packwerk/graph.rb +74 -0
- data/lib/packwerk/inflections/custom.rb +33 -0
- data/lib/packwerk/inflections/default.rb +73 -0
- data/lib/packwerk/inflector.rb +41 -0
- data/lib/packwerk/node.rb +259 -0
- data/lib/packwerk/node_processor.rb +49 -0
- data/lib/packwerk/node_visitor.rb +22 -0
- data/lib/packwerk/offense.rb +44 -0
- data/lib/packwerk/output_styles.rb +41 -0
- data/lib/packwerk/package.rb +56 -0
- data/lib/packwerk/package_set.rb +59 -0
- data/lib/packwerk/parsed_constant_definitions.rb +62 -0
- data/lib/packwerk/parsers.rb +23 -0
- data/lib/packwerk/parsers/erb.rb +66 -0
- data/lib/packwerk/parsers/factory.rb +34 -0
- data/lib/packwerk/parsers/ruby.rb +42 -0
- data/lib/packwerk/privacy_checker.rb +45 -0
- data/lib/packwerk/reference.rb +6 -0
- data/lib/packwerk/reference_extractor.rb +81 -0
- data/lib/packwerk/reference_lister.rb +23 -0
- data/lib/packwerk/run_context.rb +103 -0
- data/lib/packwerk/sanity_checker.rb +10 -0
- data/lib/packwerk/spring_command.rb +28 -0
- data/lib/packwerk/updating_deprecated_references.rb +51 -0
- data/lib/packwerk/version.rb +6 -0
- data/lib/packwerk/violation_type.rb +13 -0
- data/library.yml +6 -0
- data/packwerk.gemspec +58 -0
- data/service.yml +6 -0
- data/shipit.rubygems.yml +1 -0
- data/sorbet/config +2 -0
- data/sorbet/rbi/gems/actioncable@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi +840 -0
- data/sorbet/rbi/gems/actionmailbox@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi +571 -0
- data/sorbet/rbi/gems/actionmailer@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi +568 -0
- data/sorbet/rbi/gems/actionpack@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi +5216 -0
- data/sorbet/rbi/gems/actiontext@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi +663 -0
- data/sorbet/rbi/gems/actionview@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi +2504 -0
- data/sorbet/rbi/gems/activejob@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi +635 -0
- data/sorbet/rbi/gems/activemodel@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi +1201 -0
- data/sorbet/rbi/gems/activerecord@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi +8011 -0
- data/sorbet/rbi/gems/activestorage@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi +904 -0
- data/sorbet/rbi/gems/activesupport@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi +3888 -0
- data/sorbet/rbi/gems/ast@2.4.1.rbi +54 -0
- data/sorbet/rbi/gems/better_html@1.0.15.rbi +317 -0
- data/sorbet/rbi/gems/builder@3.2.4.rbi +8 -0
- data/sorbet/rbi/gems/byebug@11.1.3.rbi +8 -0
- data/sorbet/rbi/gems/coderay@1.1.3.rbi +8 -0
- data/sorbet/rbi/gems/colorize@0.8.1.rbi +40 -0
- data/sorbet/rbi/gems/commander@4.5.2.rbi +8 -0
- data/sorbet/rbi/gems/concurrent-ruby@1.1.6.rbi +1966 -0
- data/sorbet/rbi/gems/constant_resolver@0.1.5.rbi +26 -0
- data/sorbet/rbi/gems/crass@1.0.6.rbi +138 -0
- data/sorbet/rbi/gems/erubi@1.9.0.rbi +39 -0
- data/sorbet/rbi/gems/globalid@0.4.2.rbi +178 -0
- data/sorbet/rbi/gems/highline@2.0.3.rbi +8 -0
- data/sorbet/rbi/gems/html_tokenizer@0.0.7.rbi +46 -0
- data/sorbet/rbi/gems/i18n@1.8.2.rbi +633 -0
- data/sorbet/rbi/gems/jaro_winkler@1.5.4.rbi +8 -0
- data/sorbet/rbi/gems/loofah@2.5.0.rbi +272 -0
- data/sorbet/rbi/gems/m@1.5.1.rbi +108 -0
- data/sorbet/rbi/gems/mail@2.7.1.rbi +2490 -0
- data/sorbet/rbi/gems/marcel@0.3.3.rbi +30 -0
- data/sorbet/rbi/gems/method_source@1.0.0.rbi +76 -0
- data/sorbet/rbi/gems/mimemagic@0.3.5.rbi +47 -0
- data/sorbet/rbi/gems/mini_mime@1.0.2.rbi +71 -0
- data/sorbet/rbi/gems/mini_portile2@2.4.0.rbi +8 -0
- data/sorbet/rbi/gems/minitest@5.14.0.rbi +542 -0
- data/sorbet/rbi/gems/mocha@1.11.2.rbi +964 -0
- data/sorbet/rbi/gems/nio4r@2.5.2.rbi +89 -0
- data/sorbet/rbi/gems/nokogiri@1.10.9.rbi +1608 -0
- data/sorbet/rbi/gems/parallel@1.19.1.rbi +8 -0
- data/sorbet/rbi/gems/parlour@4.0.1.rbi +561 -0
- data/sorbet/rbi/gems/parser@2.7.1.4.rbi +1632 -0
- data/sorbet/rbi/gems/pry@0.13.1.rbi +8 -0
- data/sorbet/rbi/gems/rack-test@1.1.0.rbi +335 -0
- data/sorbet/rbi/gems/rack@2.2.2.rbi +1730 -0
- data/sorbet/rbi/gems/rails-dom-testing@2.0.3.rbi +123 -0
- data/sorbet/rbi/gems/rails-html-sanitizer@1.3.0.rbi +213 -0
- data/sorbet/rbi/gems/rails@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi +8 -0
- data/sorbet/rbi/gems/railties@6.1.0.alpha-d80c18a391e33552ae2d943e68af56946f883f65.rbi +869 -0
- data/sorbet/rbi/gems/rainbow@3.0.0.rbi +155 -0
- data/sorbet/rbi/gems/rake@13.0.1.rbi +841 -0
- data/sorbet/rbi/gems/rexml@3.2.4.rbi +8 -0
- data/sorbet/rbi/gems/rubocop-performance@1.5.2.rbi +8 -0
- data/sorbet/rbi/gems/rubocop-shopify@1.0.2.rbi +8 -0
- data/sorbet/rbi/gems/rubocop-sorbet@0.3.7.rbi +8 -0
- data/sorbet/rbi/gems/rubocop@0.82.0.rbi +8 -0
- data/sorbet/rbi/gems/ruby-progressbar@1.10.1.rbi +8 -0
- data/sorbet/rbi/gems/smart_properties@1.15.0.rbi +168 -0
- data/sorbet/rbi/gems/spoom@1.0.4.rbi +418 -0
- data/sorbet/rbi/gems/spring@2.1.0.rbi +160 -0
- data/sorbet/rbi/gems/sprockets-rails@3.2.1.rbi +431 -0
- data/sorbet/rbi/gems/sprockets@4.0.0.rbi +1132 -0
- data/sorbet/rbi/gems/tapioca@0.4.5.rbi +518 -0
- data/sorbet/rbi/gems/thor@1.0.1.rbi +892 -0
- data/sorbet/rbi/gems/tzinfo@2.0.2.rbi +547 -0
- data/sorbet/rbi/gems/unicode-display_width@1.7.0.rbi +8 -0
- data/sorbet/rbi/gems/websocket-driver@0.7.1.rbi +438 -0
- data/sorbet/rbi/gems/websocket-extensions@0.1.4.rbi +71 -0
- data/sorbet/rbi/gems/zeitwerk@2.3.0.rbi +8 -0
- data/sorbet/tapioca/require.rb +25 -0
- data/static/packwerk-check-demo.png +0 -0
- data/static/packwerk_check.gif +0 -0
- data/static/packwerk_check_violation.gif +0 -0
- data/static/packwerk_update.gif +0 -0
- data/static/packwerk_validate.gif +0 -0
- metadata +341 -0
@@ -0,0 +1,518 @@
|
|
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 `dev typecheck update`.
|
4
|
+
|
5
|
+
# typed: true
|
6
|
+
|
7
|
+
module Tapioca
|
8
|
+
class << self
|
9
|
+
def silence_warnings(&blk); end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
class Tapioca::Cli < ::Thor
|
14
|
+
include(::Thor::Actions)
|
15
|
+
extend(::Thor::Actions::ClassMethods)
|
16
|
+
|
17
|
+
def dsl(*constants); end
|
18
|
+
def generate(*gems); end
|
19
|
+
def generator; end
|
20
|
+
def init; end
|
21
|
+
def require; end
|
22
|
+
def sync; end
|
23
|
+
def todo; end
|
24
|
+
|
25
|
+
class << self
|
26
|
+
def exit_on_failure?; end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
module Tapioca::Compilers
|
31
|
+
end
|
32
|
+
|
33
|
+
module Tapioca::Compilers::Dsl
|
34
|
+
end
|
35
|
+
|
36
|
+
class Tapioca::Compilers::Dsl::Base
|
37
|
+
abstract!
|
38
|
+
|
39
|
+
sig { void }
|
40
|
+
def initialize; end
|
41
|
+
|
42
|
+
sig { abstract.type_parameters(:T).params(root: Parlour::RbiGenerator::Namespace, constant: T.type_parameter(:T)).void }
|
43
|
+
def decorate(root, constant); end
|
44
|
+
sig { abstract.returns(T::Enumerable[Module]) }
|
45
|
+
def gather_constants; end
|
46
|
+
sig { params(constant: Module).returns(T::Boolean) }
|
47
|
+
def handles?(constant); end
|
48
|
+
sig { returns(T::Set[Module]) }
|
49
|
+
def processable_constants; end
|
50
|
+
|
51
|
+
private
|
52
|
+
|
53
|
+
sig { params(method_def: T.any(Method, UnboundMethod)).returns(T::Array[Parlour::RbiGenerator::Parameter]) }
|
54
|
+
def compile_method_parameters_to_parlour(method_def); end
|
55
|
+
sig { params(method_def: T.any(Method, UnboundMethod)).returns(String) }
|
56
|
+
def compile_method_return_type_to_parlour(method_def); end
|
57
|
+
sig { params(namespace: Parlour::RbiGenerator::Namespace, name: String, options: T::Hash[T.untyped, T.untyped]).void }
|
58
|
+
def create_method(namespace, name, options = T.unsafe(nil)); end
|
59
|
+
sig { params(namespace: Parlour::RbiGenerator::Namespace, method_def: T.any(Method, UnboundMethod), class_method: T::Boolean).void }
|
60
|
+
def create_method_from_def(namespace, method_def, class_method: T.unsafe(nil)); end
|
61
|
+
sig { params(method_def: T.any(Method, UnboundMethod), signature: T.untyped).returns(T::Array[String]) }
|
62
|
+
def parameters_types_from_signature(method_def, signature); end
|
63
|
+
sig { params(name: String).returns(T::Boolean) }
|
64
|
+
def valid_method_name?(name); end
|
65
|
+
end
|
66
|
+
|
67
|
+
Tapioca::Compilers::Dsl::Base::SPECIAL_METHOD_NAMES = T.let(T.unsafe(nil), Array)
|
68
|
+
|
69
|
+
class Tapioca::Compilers::DslCompiler
|
70
|
+
sig { params(requested_constants: T::Array[Module], requested_generators: T::Array[String], error_handler: T.nilable(T.proc.params(error: String).void)).void }
|
71
|
+
def initialize(requested_constants:, requested_generators: T.unsafe(nil), error_handler: T.unsafe(nil)); end
|
72
|
+
|
73
|
+
sig { returns(T.proc.params(error: String).void) }
|
74
|
+
def error_handler; end
|
75
|
+
sig { returns(T::Enumerable[Tapioca::Compilers::Dsl::Base]) }
|
76
|
+
def generators; end
|
77
|
+
sig { returns(T::Array[Module]) }
|
78
|
+
def requested_constants; end
|
79
|
+
sig { params(blk: T.proc.params(constant: Module, rbi: String).void).void }
|
80
|
+
def run(&blk); end
|
81
|
+
|
82
|
+
private
|
83
|
+
|
84
|
+
sig { params(requested_constants: T::Array[Module]).returns(T::Set[Module]) }
|
85
|
+
def gather_constants(requested_constants); end
|
86
|
+
sig { params(requested_generators: T::Array[String]).returns(T::Enumerable[Tapioca::Compilers::Dsl::Base]) }
|
87
|
+
def gather_generators(requested_generators); end
|
88
|
+
sig { params(requested_generators: T::Array[String]).returns(Proc) }
|
89
|
+
def generator_filter(requested_generators); end
|
90
|
+
sig { params(constant: Module).returns(T.nilable(String)) }
|
91
|
+
def rbi_for_constant(constant); end
|
92
|
+
sig { params(error: String).returns(T.noreturn) }
|
93
|
+
def report_error(error); end
|
94
|
+
sig { params(parlour: Parlour::RbiGenerator).void }
|
95
|
+
def resolve_conflicts(parlour); end
|
96
|
+
end
|
97
|
+
|
98
|
+
class Tapioca::Compilers::RequiresCompiler
|
99
|
+
sig { params(sorbet_path: String).void }
|
100
|
+
def initialize(sorbet_path); end
|
101
|
+
|
102
|
+
sig { returns(String) }
|
103
|
+
def compile; end
|
104
|
+
|
105
|
+
private
|
106
|
+
|
107
|
+
sig { params(config: Spoom::Sorbet::Config).returns(T::Array[String]) }
|
108
|
+
def collect_files(config); end
|
109
|
+
sig { params(file_path: String).returns(T::Enumerable[String]) }
|
110
|
+
def collect_requires(file_path); end
|
111
|
+
sig { params(config: Spoom::Sorbet::Config, file: String).returns(T::Boolean) }
|
112
|
+
def file_ignored_by_sorbet?(config, file); end
|
113
|
+
sig { params(files: T::Enumerable[String], name: String).returns(T::Boolean) }
|
114
|
+
def name_in_project?(files, name); end
|
115
|
+
end
|
116
|
+
|
117
|
+
module Tapioca::Compilers::Sorbet
|
118
|
+
class << self
|
119
|
+
sig { params(args: String).returns(String) }
|
120
|
+
def run(*args); end
|
121
|
+
sig { returns(String) }
|
122
|
+
def sorbet_path; end
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
Tapioca::Compilers::Sorbet::SORBET = T.let(T.unsafe(nil), Pathname)
|
127
|
+
|
128
|
+
module Tapioca::Compilers::SymbolTable
|
129
|
+
end
|
130
|
+
|
131
|
+
class Tapioca::Compilers::SymbolTable::SymbolGenerator
|
132
|
+
sig { params(gem: Tapioca::Gemfile::Gem, indent: Integer).void }
|
133
|
+
def initialize(gem, indent = T.unsafe(nil)); end
|
134
|
+
|
135
|
+
def gem; end
|
136
|
+
sig { returns(String) }
|
137
|
+
def generate; end
|
138
|
+
def indent; end
|
139
|
+
|
140
|
+
private
|
141
|
+
|
142
|
+
sig { params(name: String).void }
|
143
|
+
def add_to_alias_namespace(name); end
|
144
|
+
sig { params(name: String).returns(T::Boolean) }
|
145
|
+
def alias_namespaced?(name); end
|
146
|
+
sig { params(constant: Module, other: BasicObject).returns(T::Boolean) }
|
147
|
+
def are_equal?(constant, other); end
|
148
|
+
sig { params(constant: BasicObject).returns(Class) }
|
149
|
+
def class_of(constant); end
|
150
|
+
sig { params(name: T.nilable(String), constant: BasicObject).returns(T.nilable(String)) }
|
151
|
+
def compile(name, constant); end
|
152
|
+
sig { params(name: String, constant: Module).returns(T.nilable(String)) }
|
153
|
+
def compile_alias(name, constant); end
|
154
|
+
sig { params(name: String, constant: Module).returns(T.nilable(String)) }
|
155
|
+
def compile_body(name, constant); end
|
156
|
+
sig { params(name: String, constant: BasicObject).returns(T.nilable(String)) }
|
157
|
+
def compile_constant(name, constant); end
|
158
|
+
sig { params(module_name: String, mod: Module, for_visibility: T::Array[Symbol]).returns(String) }
|
159
|
+
def compile_directly_owned_methods(module_name, mod, for_visibility = T.unsafe(nil)); end
|
160
|
+
sig { params(symbol_name: String, constant: Module, method: T.nilable(UnboundMethod)).returns(T.nilable(String)) }
|
161
|
+
def compile_method(symbol_name, constant, method); end
|
162
|
+
sig { params(name: String, constant: Module).returns(T.nilable(String)) }
|
163
|
+
def compile_methods(name, constant); end
|
164
|
+
sig { params(constant: Module).returns(String) }
|
165
|
+
def compile_mixes_in_class_methods(constant); end
|
166
|
+
sig { params(constant: Module).returns(String) }
|
167
|
+
def compile_mixins(constant); end
|
168
|
+
sig { params(name: String, constant: Module).returns(T.nilable(String)) }
|
169
|
+
def compile_module(name, constant); end
|
170
|
+
sig { params(constant: Module).returns(String) }
|
171
|
+
def compile_module_helpers(constant); end
|
172
|
+
sig { params(name: String, value: BasicObject).returns(T.nilable(String)) }
|
173
|
+
def compile_object(name, value); end
|
174
|
+
sig { params(constant: Module).returns(String) }
|
175
|
+
def compile_props(constant); end
|
176
|
+
sig { params(signature: T.untyped, parameters: T::Array[[Symbol, String]]).returns(String) }
|
177
|
+
def compile_signature(signature, parameters); end
|
178
|
+
sig { params(name: String, constant: Module).returns(T.nilable(String)) }
|
179
|
+
def compile_subconstants(name, constant); end
|
180
|
+
sig { params(constant: Class).returns(String) }
|
181
|
+
def compile_superclass(constant); end
|
182
|
+
sig { params(constant: Module).returns(T::Array[Symbol]) }
|
183
|
+
def constants_of(constant); end
|
184
|
+
sig { params(constant: Module, strict: T::Boolean).returns(T::Boolean) }
|
185
|
+
def defined_in_gem?(constant, strict: T.unsafe(nil)); end
|
186
|
+
sig { params(symbols: T::Set[String]).returns(T::Set[String]) }
|
187
|
+
def engine_symbols(symbols); end
|
188
|
+
sig { params(symbol: String).returns(T.nilable(String)) }
|
189
|
+
def generate_from_symbol(symbol); end
|
190
|
+
sig { params(constant: Module).returns(T::Array[String]) }
|
191
|
+
def get_file_candidates(constant); end
|
192
|
+
sig { params(str: String).returns(String) }
|
193
|
+
def indented(str); end
|
194
|
+
def initialize_method_for(constant); end
|
195
|
+
sig { params(name: String).void }
|
196
|
+
def mark_seen(name); end
|
197
|
+
sig { params(method: UnboundMethod).returns(T::Boolean) }
|
198
|
+
def method_in_gem?(method); end
|
199
|
+
sig { params(mod: Module).returns(T::Hash[Symbol, T::Array[Symbol]]) }
|
200
|
+
def method_names_by_visibility(mod); end
|
201
|
+
sig { params(constant: Module).returns(T.nilable(String)) }
|
202
|
+
def name_of(constant); end
|
203
|
+
sig { params(constant: Module).returns(T.nilable(String)) }
|
204
|
+
def name_of_proxy_target(constant); end
|
205
|
+
def parent_declares_constant?(name); end
|
206
|
+
sig { params(constant: Module).returns(T::Boolean) }
|
207
|
+
def public_module?(constant); end
|
208
|
+
sig { params(constant: Module).returns(T.nilable(String)) }
|
209
|
+
def qualified_name_of(constant); end
|
210
|
+
sig { params(constant: Module).returns(T.nilable(String)) }
|
211
|
+
def raw_name_of(constant); end
|
212
|
+
sig { params(symbol: String).returns(BasicObject) }
|
213
|
+
def resolve_constant(symbol); end
|
214
|
+
sig { params(name: String).returns(T::Boolean) }
|
215
|
+
def seen?(name); end
|
216
|
+
sig { params(method: T.any(Method, UnboundMethod)).returns(T.untyped) }
|
217
|
+
def signature_of(method); end
|
218
|
+
sig { params(constant: BasicObject).returns(Class) }
|
219
|
+
def singleton_class_of(constant); end
|
220
|
+
sig { params(constant: Module, method_name: String).returns(T::Boolean) }
|
221
|
+
def struct_method?(constant, method_name); end
|
222
|
+
sig { params(constant: Class).returns(T.nilable(Class)) }
|
223
|
+
def superclass_of(constant); end
|
224
|
+
sig { params(symbol_name: String).returns(T::Boolean) }
|
225
|
+
def symbol_ignored?(symbol_name); end
|
226
|
+
sig { returns(T::Set[String]) }
|
227
|
+
def symbols; end
|
228
|
+
sig { params(constant: Module).returns(String) }
|
229
|
+
def type_of(constant); end
|
230
|
+
sig { params(name: String).returns(T::Boolean) }
|
231
|
+
def valid_method_name?(name); end
|
232
|
+
sig { type_parameters(:U).params(step: Integer, _blk: T.proc.params().returns(T.type_parameter(:U))).returns(T.type_parameter(:U)) }
|
233
|
+
def with_indentation(step = T.unsafe(nil), &_blk); end
|
234
|
+
end
|
235
|
+
|
236
|
+
Tapioca::Compilers::SymbolTable::SymbolGenerator::IGNORED_SYMBOLS = T.let(T.unsafe(nil), Array)
|
237
|
+
|
238
|
+
Tapioca::Compilers::SymbolTable::SymbolGenerator::SPECIAL_METHOD_NAMES = T.let(T.unsafe(nil), Array)
|
239
|
+
|
240
|
+
Tapioca::Compilers::SymbolTable::SymbolGenerator::TYPE_PARAMETER_MATCHER = T.let(T.unsafe(nil), Regexp)
|
241
|
+
|
242
|
+
module Tapioca::Compilers::SymbolTable::SymbolLoader
|
243
|
+
class << self
|
244
|
+
def ignore_symbol?(symbol); end
|
245
|
+
sig { params(paths: T::Array[Pathname]).returns(T::Set[String]) }
|
246
|
+
def list_from_paths(paths); end
|
247
|
+
|
248
|
+
private
|
249
|
+
|
250
|
+
def ignored_symbols; end
|
251
|
+
sig { params(paths: T::Array[String]).returns(T::Set[String]) }
|
252
|
+
def load_symbols(paths); end
|
253
|
+
def symbol_table_json_from(input, table_type: T.unsafe(nil)); end
|
254
|
+
end
|
255
|
+
end
|
256
|
+
|
257
|
+
class Tapioca::Compilers::SymbolTable::SymbolLoader::SymbolTableParser
|
258
|
+
class << self
|
259
|
+
def parse(object, parents = T.unsafe(nil)); end
|
260
|
+
end
|
261
|
+
end
|
262
|
+
|
263
|
+
class Tapioca::Compilers::SymbolTableCompiler
|
264
|
+
sig { params(gem: Tapioca::Gemfile::Gem, indent: Integer).returns(String) }
|
265
|
+
def compile(gem, indent = T.unsafe(nil)); end
|
266
|
+
end
|
267
|
+
|
268
|
+
class Tapioca::Compilers::TodosCompiler
|
269
|
+
sig { returns(String) }
|
270
|
+
def compile; end
|
271
|
+
|
272
|
+
private
|
273
|
+
|
274
|
+
sig { returns(String) }
|
275
|
+
def list_todos; end
|
276
|
+
end
|
277
|
+
|
278
|
+
class Tapioca::Config < ::T::Struct
|
279
|
+
const :outdir, String
|
280
|
+
const :prerequire, T.nilable(String)
|
281
|
+
const :postrequire, String
|
282
|
+
const :generate_command, String
|
283
|
+
const :exclude, T::Array[String]
|
284
|
+
const :typed_overrides, T::Hash[String, String]
|
285
|
+
const :todos_path, String
|
286
|
+
const :generators, T::Array[String]
|
287
|
+
|
288
|
+
sig { returns(Pathname) }
|
289
|
+
def outpath; end
|
290
|
+
|
291
|
+
class << self
|
292
|
+
def inherited(s); end
|
293
|
+
end
|
294
|
+
end
|
295
|
+
|
296
|
+
Tapioca::Config::DEFAULT_DSLDIR = T.let(T.unsafe(nil), String)
|
297
|
+
|
298
|
+
Tapioca::Config::DEFAULT_GEMDIR = T.let(T.unsafe(nil), String)
|
299
|
+
|
300
|
+
Tapioca::Config::DEFAULT_OVERRIDES = T.let(T.unsafe(nil), Hash)
|
301
|
+
|
302
|
+
Tapioca::Config::DEFAULT_POSTREQUIRE = T.let(T.unsafe(nil), String)
|
303
|
+
|
304
|
+
Tapioca::Config::DEFAULT_RBIDIR = T.let(T.unsafe(nil), String)
|
305
|
+
|
306
|
+
Tapioca::Config::DEFAULT_TODOSPATH = T.let(T.unsafe(nil), String)
|
307
|
+
|
308
|
+
Tapioca::Config::SORBET_CONFIG = T.let(T.unsafe(nil), String)
|
309
|
+
|
310
|
+
Tapioca::Config::SORBET_PATH = T.let(T.unsafe(nil), String)
|
311
|
+
|
312
|
+
Tapioca::Config::TAPIOCA_CONFIG = T.let(T.unsafe(nil), String)
|
313
|
+
|
314
|
+
Tapioca::Config::TAPIOCA_PATH = T.let(T.unsafe(nil), String)
|
315
|
+
|
316
|
+
class Tapioca::ConfigBuilder
|
317
|
+
class << self
|
318
|
+
sig { params(command: Symbol, options: T::Hash[String, T.untyped]).returns(Tapioca::Config) }
|
319
|
+
def from_options(command, options); end
|
320
|
+
|
321
|
+
private
|
322
|
+
|
323
|
+
sig { returns(T::Hash[String, T.untyped]) }
|
324
|
+
def config_options; end
|
325
|
+
sig { returns(String) }
|
326
|
+
def default_command; end
|
327
|
+
sig { params(command: Symbol).returns(T::Hash[String, T.untyped]) }
|
328
|
+
def default_options(command); end
|
329
|
+
sig { params(options: T::Hash[String, T.untyped]).returns(T::Hash[String, T.untyped]) }
|
330
|
+
def merge_options(*options); end
|
331
|
+
end
|
332
|
+
end
|
333
|
+
|
334
|
+
Tapioca::ConfigBuilder::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash)
|
335
|
+
|
336
|
+
module Tapioca::ConstantLocator
|
337
|
+
|
338
|
+
private
|
339
|
+
|
340
|
+
def files_for(klass); end
|
341
|
+
|
342
|
+
class << self
|
343
|
+
def files_for(klass); end
|
344
|
+
end
|
345
|
+
end
|
346
|
+
|
347
|
+
class Tapioca::Error < ::StandardError
|
348
|
+
end
|
349
|
+
|
350
|
+
class Tapioca::Gemfile
|
351
|
+
sig { void }
|
352
|
+
def initialize; end
|
353
|
+
|
354
|
+
sig { returns(T::Array[Tapioca::Gemfile::Gem]) }
|
355
|
+
def dependencies; end
|
356
|
+
sig { params(gem_name: String).returns(T.nilable(Tapioca::Gemfile::Gem)) }
|
357
|
+
def gem(gem_name); end
|
358
|
+
sig { void }
|
359
|
+
def require; end
|
360
|
+
|
361
|
+
private
|
362
|
+
|
363
|
+
sig { returns(Bundler::Definition) }
|
364
|
+
def definition; end
|
365
|
+
sig { returns(String) }
|
366
|
+
def dir; end
|
367
|
+
sig { returns(File) }
|
368
|
+
def gemfile; end
|
369
|
+
sig { returns(T::Array[Symbol]) }
|
370
|
+
def groups; end
|
371
|
+
def lockfile; end
|
372
|
+
sig { returns(Bundler::Runtime) }
|
373
|
+
def runtime; end
|
374
|
+
end
|
375
|
+
|
376
|
+
class Tapioca::Gemfile::Gem
|
377
|
+
sig { params(spec: T.any(Gem::Specification, T.all(Bundler::RemoteSpecification, Bundler::StubSpecification))).void }
|
378
|
+
def initialize(spec); end
|
379
|
+
|
380
|
+
sig { params(path: String).returns(T::Boolean) }
|
381
|
+
def contains_path?(path); end
|
382
|
+
sig { returns(T::Array[Pathname]) }
|
383
|
+
def files; end
|
384
|
+
sig { returns(String) }
|
385
|
+
def full_gem_path; end
|
386
|
+
sig { params(gemfile_dir: String).returns(T::Boolean) }
|
387
|
+
def ignore?(gemfile_dir); end
|
388
|
+
sig { returns(String) }
|
389
|
+
def name; end
|
390
|
+
sig { returns(String) }
|
391
|
+
def rbi_file_name; end
|
392
|
+
def version; end
|
393
|
+
|
394
|
+
private
|
395
|
+
|
396
|
+
sig { returns(T::Boolean) }
|
397
|
+
def gem_ignored?; end
|
398
|
+
sig { params(gemfile_dir: String).returns(T::Boolean) }
|
399
|
+
def gem_in_app_dir?(gemfile_dir); end
|
400
|
+
sig { returns(T::Boolean) }
|
401
|
+
def gem_in_bundle_path?; end
|
402
|
+
sig { params(path: String).returns(T::Boolean) }
|
403
|
+
def has_parent_gemspec?(path); end
|
404
|
+
sig { params(path: T.any(Pathname, String)).returns(String) }
|
405
|
+
def to_realpath(path); end
|
406
|
+
sig { returns(String) }
|
407
|
+
def version_string; end
|
408
|
+
end
|
409
|
+
|
410
|
+
Tapioca::Gemfile::Gem::IGNORED_GEMS = T.let(T.unsafe(nil), Array)
|
411
|
+
|
412
|
+
class Tapioca::Generator < ::Thor::Shell::Color
|
413
|
+
sig { params(config: Tapioca::Config).void }
|
414
|
+
def initialize(config); end
|
415
|
+
|
416
|
+
sig { params(requested_constants: T::Array[String]).void }
|
417
|
+
def build_dsl(requested_constants); end
|
418
|
+
sig { params(gem_names: T::Array[String]).void }
|
419
|
+
def build_gem_rbis(gem_names); end
|
420
|
+
sig { void }
|
421
|
+
def build_requires; end
|
422
|
+
sig { void }
|
423
|
+
def build_todos; end
|
424
|
+
sig { returns(Tapioca::Config) }
|
425
|
+
def config; end
|
426
|
+
sig { void }
|
427
|
+
def sync_rbis_with_gemfile; end
|
428
|
+
|
429
|
+
private
|
430
|
+
|
431
|
+
sig { params(filename: Pathname).void }
|
432
|
+
def add(filename); end
|
433
|
+
sig { returns(T::Array[String]) }
|
434
|
+
def added_rbis; end
|
435
|
+
sig { returns(Tapioca::Gemfile) }
|
436
|
+
def bundle; end
|
437
|
+
sig { params(constant: Module, contents: String).void }
|
438
|
+
def compile_dsl_rbi(constant, contents); end
|
439
|
+
sig { params(gem: Tapioca::Gemfile::Gem).void }
|
440
|
+
def compile_gem_rbi(gem); end
|
441
|
+
sig { returns(Tapioca::Compilers::SymbolTableCompiler) }
|
442
|
+
def compiler; end
|
443
|
+
sig { params(constant_names: T::Array[String]).returns(T::Array[Module]) }
|
444
|
+
def constantize(constant_names); end
|
445
|
+
sig { params(gem_name: String).returns(Pathname) }
|
446
|
+
def existing_rbi(gem_name); end
|
447
|
+
sig { returns(T::Hash[String, String]) }
|
448
|
+
def existing_rbis; end
|
449
|
+
sig { params(gem_name: String).returns(Pathname) }
|
450
|
+
def expected_rbi(gem_name); end
|
451
|
+
sig { returns(T::Hash[String, String]) }
|
452
|
+
def expected_rbis; end
|
453
|
+
sig { params(file: String, error: LoadError).void }
|
454
|
+
def explain_failed_require(file, error); end
|
455
|
+
sig { params(gem_name: String).returns(T::Boolean) }
|
456
|
+
def gem_rbi_exists?(gem_name); end
|
457
|
+
sig { params(gem_name: String, version: String).returns(Pathname) }
|
458
|
+
def gem_rbi_filename(gem_name, version); end
|
459
|
+
sig { params(gem_names: T::Array[String]).returns(T::Array[Tapioca::Gemfile::Gem]) }
|
460
|
+
def gems_to_generate(gem_names); end
|
461
|
+
sig { params(eager_load: T::Boolean).void }
|
462
|
+
def load_application(eager_load:); end
|
463
|
+
sig { void }
|
464
|
+
def load_dsl_generators; end
|
465
|
+
sig { returns(Tapioca::Loader) }
|
466
|
+
def loader; end
|
467
|
+
sig { params(old_filename: Pathname, new_filename: Pathname).void }
|
468
|
+
def move(old_filename, new_filename); end
|
469
|
+
sig { void }
|
470
|
+
def perform_additions; end
|
471
|
+
sig { void }
|
472
|
+
def perform_removals; end
|
473
|
+
sig { params(command: String, reason: T.nilable(String), strictness: T.nilable(String)).returns(String) }
|
474
|
+
def rbi_header(command, reason: T.unsafe(nil), strictness: T.unsafe(nil)); end
|
475
|
+
sig { params(filename: Pathname).void }
|
476
|
+
def remove(filename); end
|
477
|
+
sig { returns(T::Array[String]) }
|
478
|
+
def removed_rbis; end
|
479
|
+
sig { void }
|
480
|
+
def require_gem_file; end
|
481
|
+
sig { params(message: String, color: T.any(Symbol, T::Array[Symbol])).void }
|
482
|
+
def say_error(message = T.unsafe(nil), *color); end
|
483
|
+
end
|
484
|
+
|
485
|
+
Tapioca::Generator::EMPTY_RBI_COMMENT = T.let(T.unsafe(nil), String)
|
486
|
+
|
487
|
+
class Tapioca::Loader
|
488
|
+
sig { params(gemfile: Tapioca::Gemfile).void }
|
489
|
+
def initialize(gemfile); end
|
490
|
+
|
491
|
+
sig { params(initialize_file: T.nilable(String), require_file: T.nilable(String)).void }
|
492
|
+
def load_bundle(initialize_file, require_file); end
|
493
|
+
sig { params(environment_load: T::Boolean, eager_load: T::Boolean).void }
|
494
|
+
def load_rails(environment_load: T.unsafe(nil), eager_load: T.unsafe(nil)); end
|
495
|
+
|
496
|
+
private
|
497
|
+
|
498
|
+
sig { void }
|
499
|
+
def eager_load_rails_app; end
|
500
|
+
sig { returns(Tapioca::Gemfile) }
|
501
|
+
def gemfile; end
|
502
|
+
sig { void }
|
503
|
+
def load_rails_engines; end
|
504
|
+
sig { void }
|
505
|
+
def load_rake; end
|
506
|
+
sig { returns(T::Array[T.untyped]) }
|
507
|
+
def rails_engines; end
|
508
|
+
sig { void }
|
509
|
+
def require_bundle; end
|
510
|
+
sig { params(file: T.nilable(String)).void }
|
511
|
+
def require_helper(file); end
|
512
|
+
sig { params(path: String).void }
|
513
|
+
def safe_require(path); end
|
514
|
+
sig { void }
|
515
|
+
def silence_deprecations; end
|
516
|
+
end
|
517
|
+
|
518
|
+
Tapioca::VERSION = T.let(T.unsafe(nil), String)
|