packwerk_yard 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -0
  3. data/README.md +1 -1
  4. data/Rakefile +5 -1
  5. data/lib/packwerk_yard/parser.rb +19 -10
  6. data/lib/packwerk_yard/version.rb +2 -2
  7. data/lib/packwerk_yard.rb +1 -1
  8. data/sorbet/config +4 -0
  9. data/sorbet/rbi/annotations/.gitattributes +1 -0
  10. data/sorbet/rbi/annotations/actionview.rbi +75 -0
  11. data/sorbet/rbi/annotations/activesupport.rbi +264 -0
  12. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  13. data/sorbet/rbi/gems/.gitattributes +1 -0
  14. data/sorbet/rbi/gems/actionview@7.1.2.rbi +15002 -0
  15. data/sorbet/rbi/gems/activesupport@7.1.2.rbi +18797 -0
  16. data/sorbet/rbi/gems/ast@2.4.2.rbi +584 -0
  17. data/sorbet/rbi/gems/base64@0.2.0.rbi +508 -0
  18. data/sorbet/rbi/gems/better_html@2.0.2.rbi +529 -0
  19. data/sorbet/rbi/gems/bigdecimal@3.1.5.rbi +77 -0
  20. data/sorbet/rbi/gems/builder@3.2.4.rbi +8 -0
  21. data/sorbet/rbi/gems/concurrent-ruby@1.2.2.rbi +11545 -0
  22. data/sorbet/rbi/gems/connection_pool@2.4.1.rbi +8 -0
  23. data/sorbet/rbi/gems/constant_resolver@0.2.0.rbi +90 -0
  24. data/sorbet/rbi/gems/crass@1.0.6.rbi +622 -0
  25. data/sorbet/rbi/gems/drb@2.2.0.rbi +1346 -0
  26. data/sorbet/rbi/gems/erubi@1.12.0.rbi +145 -0
  27. data/sorbet/rbi/gems/i18n@1.14.1.rbi +2325 -0
  28. data/sorbet/rbi/gems/json@2.7.1.rbi +1561 -0
  29. data/sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi +14237 -0
  30. data/sorbet/rbi/gems/loofah@2.22.0.rbi +1080 -0
  31. data/sorbet/rbi/gems/minitest@5.20.0.rbi +1497 -0
  32. data/sorbet/rbi/gems/mutex_m@0.2.0.rbi +93 -0
  33. data/sorbet/rbi/gems/netrc@0.11.0.rbi +158 -0
  34. data/sorbet/rbi/gems/nokogiri@1.16.0.rbi +7286 -0
  35. data/sorbet/rbi/gems/packwerk@3.1.0-bf972227a1caaeed4d07b0302a7b74f20632fc06.rbi +2370 -0
  36. data/sorbet/rbi/gems/parallel@1.24.0.rbi +280 -0
  37. data/sorbet/rbi/gems/parser@3.2.2.4.rbi +7253 -0
  38. data/sorbet/rbi/gems/prettier_print@1.2.1.rbi +951 -0
  39. data/sorbet/rbi/gems/prism@0.19.0.rbi +29883 -0
  40. data/sorbet/rbi/gems/racc@1.7.3.rbi +161 -0
  41. data/sorbet/rbi/gems/rails-dom-testing@2.2.0.rbi +8 -0
  42. data/sorbet/rbi/gems/rails-html-sanitizer@1.6.0.rbi +716 -0
  43. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +402 -0
  44. data/sorbet/rbi/gems/rake@13.1.0.rbi +3045 -0
  45. data/sorbet/rbi/gems/rbi@0.1.6.rbi +2922 -0
  46. data/sorbet/rbi/gems/regexp_parser@2.8.3.rbi +3749 -0
  47. data/sorbet/rbi/gems/rexml@3.2.6.rbi +4781 -0
  48. data/sorbet/rbi/gems/rubocop-ast@1.30.0.rbi +7099 -0
  49. data/sorbet/rbi/gems/rubocop-performance@1.20.1.rbi +3248 -0
  50. data/sorbet/rbi/gems/rubocop-shopify@2.14.0.rbi +8 -0
  51. data/sorbet/rbi/gems/rubocop-sorbet@0.7.6.rbi +1510 -0
  52. data/sorbet/rbi/gems/rubocop@1.59.0.rbi +57240 -0
  53. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1317 -0
  54. data/sorbet/rbi/gems/ruby2_keywords@0.0.5.rbi +8 -0
  55. data/sorbet/rbi/gems/smart_properties@1.17.0.rbi +474 -0
  56. data/sorbet/rbi/gems/spoom@1.2.4.rbi +3777 -0
  57. data/sorbet/rbi/gems/syntax_tree@6.2.0.rbi +23136 -0
  58. data/sorbet/rbi/gems/tapioca@0.11.14.rbi +3509 -0
  59. data/sorbet/rbi/gems/thor@1.3.0.rbi +4345 -0
  60. data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +5917 -0
  61. data/sorbet/rbi/gems/unicode-display_width@2.5.0.rbi +65 -0
  62. data/sorbet/rbi/gems/yard-sorbet@0.8.1.rbi +428 -0
  63. data/sorbet/rbi/gems/yard@0.9.34.rbi +18219 -0
  64. data/sorbet/rbi/gems/zeitwerk@2.6.12.rbi +8 -0
  65. data/sorbet/rbi/todo.rbi +7 -0
  66. data/sorbet/tapioca/config.yml +13 -0
  67. data/sorbet/tapioca/require.rb +4 -0
  68. metadata +75 -1
@@ -0,0 +1,2370 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `packwerk` gem.
5
+ # Please instead update this file by running `bin/tapioca gem packwerk`.
6
+
7
+ # source://packwerk//lib/packwerk.rb#13
8
+ module Packwerk
9
+ extend ::ActiveSupport::Autoload
10
+ end
11
+
12
+ # Checks the structure of the application and its packwerk configuration to make sure we can run a check and deliver
13
+ # correct results.
14
+ #
15
+ # source://packwerk//lib/packwerk/application_validator.rb#11
16
+ class Packwerk::ApplicationValidator
17
+ include ::Packwerk::Validator
18
+ extend ::ActiveSupport::Autoload
19
+
20
+ # source://packwerk//lib/packwerk/application_validator.rb#25
21
+ sig do
22
+ override
23
+ .params(
24
+ package_set: Packwerk::PackageSet,
25
+ configuration: ::Packwerk::Configuration
26
+ ).returns(::Packwerk::Validator::Result)
27
+ end
28
+ def call(package_set, configuration); end
29
+
30
+ # source://packwerk//lib/packwerk/application_validator.rb#19
31
+ sig do
32
+ params(
33
+ package_set: Packwerk::PackageSet,
34
+ configuration: ::Packwerk::Configuration
35
+ ).returns(::Packwerk::Validator::Result)
36
+ end
37
+ def check_all(package_set, configuration); end
38
+
39
+ # source://packwerk//lib/packwerk/application_validator.rb#72
40
+ sig { params(configuration: ::Packwerk::Configuration).returns(::Packwerk::Validator::Result) }
41
+ def check_application_structure(configuration); end
42
+
43
+ # source://packwerk//lib/packwerk/application_validator.rb#87
44
+ sig { params(configuration: ::Packwerk::Configuration).returns(::Packwerk::Validator::Result) }
45
+ def check_package_manifest_paths(configuration); end
46
+
47
+ # source://packwerk//lib/packwerk/application_validator.rb#44
48
+ sig { params(configuration: ::Packwerk::Configuration).returns(::Packwerk::Validator::Result) }
49
+ def check_package_manifest_syntax(configuration); end
50
+
51
+ # source://packwerk//lib/packwerk/application_validator.rb#108
52
+ sig { params(configuration: ::Packwerk::Configuration).returns(::Packwerk::Validator::Result) }
53
+ def check_root_package_exists(configuration); end
54
+
55
+ # source://packwerk//lib/packwerk/application_validator.rb#37
56
+ sig { override.returns(T::Array[::String]) }
57
+ def permitted_keys; end
58
+
59
+ private
60
+
61
+ # source://packwerk//lib/packwerk/application_validator.rb#127
62
+ sig { params(list: T.untyped).returns(T.untyped) }
63
+ def format_yaml_strings(list); end
64
+
65
+ # source://packwerk//lib/packwerk/application_validator.rb#132
66
+ sig { params(configuration: ::Packwerk::Configuration, paths: T::Array[::String]).returns(T::Array[::Pathname]) }
67
+ def relative_paths(configuration, paths); end
68
+ end
69
+
70
+ # Extracts the implicit constant reference from an active record association
71
+ #
72
+ # source://packwerk//lib/packwerk/association_inspector.rb#6
73
+ class Packwerk::AssociationInspector
74
+ include ::Packwerk::ConstantNameInspector
75
+
76
+ # source://packwerk//lib/packwerk/association_inspector.rb#23
77
+ sig do
78
+ params(
79
+ inflector: T.class_of(ActiveSupport::Inflector),
80
+ custom_associations: T.any(T::Array[::Symbol], T::Set[::Symbol])
81
+ ).void
82
+ end
83
+ def initialize(inflector:, custom_associations: T.unsafe(nil)); end
84
+
85
+ # source://packwerk//lib/packwerk/association_inspector.rb#33
86
+ sig { override.params(node: ::AST::Node, ancestors: T::Array[::AST::Node]).returns(T.nilable(::String)) }
87
+ def constant_name_from_node(node, ancestors:); end
88
+
89
+ private
90
+
91
+ # source://packwerk//lib/packwerk/association_inspector.rb#52
92
+ sig { params(node: ::AST::Node).returns(T::Boolean) }
93
+ def association?(node); end
94
+
95
+ # source://packwerk//lib/packwerk/association_inspector.rb#66
96
+ sig { params(arguments: T::Array[::AST::Node]).returns(T.nilable(T.any(::String, ::Symbol))) }
97
+ def association_name(arguments); end
98
+
99
+ # source://packwerk//lib/packwerk/association_inspector.rb#58
100
+ sig { params(arguments: T::Array[::AST::Node]).returns(T.nilable(::AST::Node)) }
101
+ def custom_class_name(arguments); end
102
+ end
103
+
104
+ # source://packwerk//lib/packwerk/association_inspector.rb#10
105
+ Packwerk::AssociationInspector::CustomAssociations = T.type_alias { T.any(T::Array[::Symbol], T::Set[::Symbol]) }
106
+
107
+ # source://packwerk//lib/packwerk/association_inspector.rb#12
108
+ Packwerk::AssociationInspector::RAILS_ASSOCIATIONS = T.let(T.unsafe(nil), Set)
109
+
110
+ # source://packwerk//lib/packwerk/cache.rb#7
111
+ class Packwerk::Cache
112
+ # source://packwerk//lib/packwerk/cache.rb#52
113
+ sig { params(enable_cache: T::Boolean, cache_directory: ::Pathname, config_path: T.nilable(::String)).void }
114
+ def initialize(enable_cache:, cache_directory:, config_path:); end
115
+
116
+ # source://packwerk//lib/packwerk/cache.rb#67
117
+ sig { void }
118
+ def bust_cache!; end
119
+
120
+ # source://packwerk//lib/packwerk/cache.rb#133
121
+ sig { params(contents: ::String, contents_key: ::Symbol).void }
122
+ def bust_cache_if_contents_have_changed(contents, contents_key); end
123
+
124
+ # source://packwerk//lib/packwerk/cache.rb#128
125
+ sig { void }
126
+ def bust_cache_if_inflections_have_changed!; end
127
+
128
+ # source://packwerk//lib/packwerk/cache.rb#121
129
+ sig { void }
130
+ def bust_cache_if_packwerk_yml_has_changed!; end
131
+
132
+ # source://packwerk//lib/packwerk/cache.rb#157
133
+ sig { void }
134
+ def create_cache_directory!; end
135
+
136
+ # source://packwerk//lib/packwerk/cache.rb#109
137
+ sig { params(file: ::String).returns(::String) }
138
+ def digest_for_file(file); end
139
+
140
+ # source://packwerk//lib/packwerk/cache.rb#114
141
+ sig { params(str: ::String).returns(::String) }
142
+ def digest_for_string(str); end
143
+
144
+ # source://packwerk//lib/packwerk/cache.rb#77
145
+ sig do
146
+ params(
147
+ file_path: ::String,
148
+ block: T.proc.returns(T::Array[::Packwerk::UnresolvedReference])
149
+ ).returns(T::Array[::Packwerk::UnresolvedReference])
150
+ end
151
+ def with_cache(file_path, &block); end
152
+ end
153
+
154
+ # source://packwerk//lib/packwerk/cache.rb#10
155
+ class Packwerk::Cache::CacheContents < ::T::Struct
156
+ const :file_contents_digest, ::String
157
+ const :unresolved_references, T::Array[::Packwerk::UnresolvedReference]
158
+
159
+ # source://packwerk//lib/packwerk/cache.rb#39
160
+ sig { returns(::String) }
161
+ def serialize; end
162
+
163
+ class << self
164
+ # source://packwerk//lib/packwerk/cache.rb#20
165
+ sig { params(serialized_cache_contents: ::String).returns(::Packwerk::Cache::CacheContents) }
166
+ def deserialize(serialized_cache_contents); end
167
+
168
+ # source://sorbet-runtime/0.5.11175/lib/types/struct.rb#13
169
+ def inherited(s); end
170
+ end
171
+ end
172
+
173
+ # source://packwerk//lib/packwerk/cache.rb#44
174
+ Packwerk::Cache::CacheShape = T.type_alias { T::Hash[::String, ::Packwerk::Cache::CacheContents] }
175
+
176
+ # @abstract Subclasses must implement the `abstract` methods below.
177
+ #
178
+ # source://packwerk//lib/packwerk/checker.rb#5
179
+ module Packwerk::Checker
180
+ abstract!
181
+
182
+ # @abstract
183
+ #
184
+ # source://packwerk//lib/packwerk/checker.rb#58
185
+ sig { abstract.params(reference: ::Packwerk::Reference).returns(T::Boolean) }
186
+ def invalid_reference?(reference); end
187
+
188
+ # @abstract
189
+ #
190
+ # source://packwerk//lib/packwerk/checker.rb#61
191
+ sig { abstract.params(reference: ::Packwerk::Reference).returns(::String) }
192
+ def message(reference); end
193
+
194
+ # @abstract
195
+ #
196
+ # source://packwerk//lib/packwerk/checker.rb#55
197
+ sig { abstract.params(listed_offense: ::Packwerk::ReferenceOffense).returns(T::Boolean) }
198
+ def strict_mode_violation?(listed_offense); end
199
+
200
+ # @abstract
201
+ #
202
+ # source://packwerk//lib/packwerk/checker.rb#52
203
+ sig { abstract.returns(::String) }
204
+ def violation_type; end
205
+
206
+ class << self
207
+ # source://packwerk//lib/packwerk/checker.rb#20
208
+ sig { returns(T::Array[::Packwerk::Checker]) }
209
+ def all; end
210
+
211
+ # source://packwerk//lib/packwerk/checker.rb#26
212
+ sig { params(violation_type: ::String).returns(::Packwerk::Checker) }
213
+ def find(violation_type); end
214
+
215
+ # source://packwerk//lib/packwerk/checker.rb#15
216
+ sig { params(base: ::Class).void }
217
+ def included(base); end
218
+
219
+ private
220
+
221
+ # source://packwerk//lib/packwerk/checker.rb#43
222
+ sig { params(name: ::String).returns(::Packwerk::Checker) }
223
+ def checker_by_violation_type(name); end
224
+
225
+ # source://packwerk//lib/packwerk/checker.rb#38
226
+ sig { returns(T::Array[::Class]) }
227
+ def checkers; end
228
+
229
+ # source://packwerk//lib/packwerk/checker.rb#33
230
+ sig { void }
231
+ def load_defaults; end
232
+ end
233
+ end
234
+
235
+ # A command-line interface to Packwerk.
236
+ #
237
+ # source://packwerk//lib/packwerk/cli.rb#6
238
+ class Packwerk::Cli
239
+ # source://packwerk//lib/packwerk/cli.rb#19
240
+ sig do
241
+ params(
242
+ configuration: T.nilable(::Packwerk::Configuration),
243
+ out: T.any(::IO, ::StringIO),
244
+ err_out: T.any(::IO, ::StringIO),
245
+ environment: ::String,
246
+ style: ::Packwerk::OutputStyle,
247
+ offenses_formatter: T.nilable(::Packwerk::OffensesFormatter)
248
+ ).void
249
+ end
250
+ def initialize(configuration: T.unsafe(nil), out: T.unsafe(nil), err_out: T.unsafe(nil), environment: T.unsafe(nil), style: T.unsafe(nil), offenses_formatter: T.unsafe(nil)); end
251
+
252
+ # source://packwerk//lib/packwerk/cli.rb#46
253
+ sig { params(args: T::Array[::String]).returns(T::Boolean) }
254
+ def execute_command(args); end
255
+
256
+ # source://packwerk//lib/packwerk/cli.rb#40
257
+ sig { params(args: T::Array[::String]).returns(T.noreturn) }
258
+ def run(args); end
259
+ end
260
+
261
+ # source://packwerk//lib/packwerk/commands.rb#5
262
+ module Packwerk::Commands
263
+ extend ::ActiveSupport::Autoload
264
+
265
+ class << self
266
+ # source://packwerk//lib/packwerk/commands.rb#35
267
+ sig { returns(T::Array[::Packwerk::Commands::LazyLoadedEntry]) }
268
+ def all; end
269
+
270
+ # source://packwerk//lib/packwerk/commands.rb#28
271
+ sig { params(name_or_alias: ::String).returns(T.nilable(T.class_of(Packwerk::Commands::BaseCommand))) }
272
+ def for(name_or_alias); end
273
+
274
+ # source://packwerk//lib/packwerk/commands.rb#23
275
+ sig { params(name: ::String, aliases: T::Array[::String]).void }
276
+ def register(name, aliases: T.unsafe(nil)); end
277
+
278
+ private
279
+
280
+ # source://packwerk//lib/packwerk/commands.rb#42
281
+ sig { returns(T::Array[::Packwerk::Commands::LazyLoadedEntry]) }
282
+ def registry; end
283
+ end
284
+ end
285
+
286
+ # @abstract It cannot be directly instantiated. Subclasses must implement the `abstract` methods below.
287
+ #
288
+ # source://packwerk//lib/packwerk/commands/base_command.rb#6
289
+ class Packwerk::Commands::BaseCommand
290
+ abstract!
291
+
292
+ # source://packwerk//lib/packwerk/commands/base_command.rb#36
293
+ sig do
294
+ params(
295
+ args: T::Array[::String],
296
+ configuration: ::Packwerk::Configuration,
297
+ out: T.any(::IO, ::StringIO),
298
+ err_out: T.any(::IO, ::StringIO),
299
+ progress_formatter: ::Packwerk::Formatters::ProgressFormatter,
300
+ offenses_formatter: ::Packwerk::OffensesFormatter
301
+ ).void
302
+ end
303
+ def initialize(args, configuration:, out:, err_out:, progress_formatter:, offenses_formatter:); end
304
+
305
+ # @abstract
306
+ #
307
+ # source://packwerk//lib/packwerk/commands/base_command.rb#46
308
+ sig { abstract.returns(T::Boolean) }
309
+ def run; end
310
+
311
+ private
312
+
313
+ # source://packwerk//lib/packwerk/commands/base_command.rb#51
314
+ sig { returns(T::Array[::String]) }
315
+ def args; end
316
+
317
+ # source://packwerk//lib/packwerk/commands/base_command.rb#54
318
+ sig { returns(::Packwerk::Configuration) }
319
+ def configuration; end
320
+
321
+ # source://packwerk//lib/packwerk/commands/base_command.rb#60
322
+ sig { returns(T.any(::IO, ::StringIO)) }
323
+ def err_out; end
324
+
325
+ # source://packwerk//lib/packwerk/commands/base_command.rb#66
326
+ sig { returns(::Packwerk::OffensesFormatter) }
327
+ def offenses_formatter; end
328
+
329
+ # source://packwerk//lib/packwerk/commands/base_command.rb#57
330
+ sig { returns(T.any(::IO, ::StringIO)) }
331
+ def out; end
332
+
333
+ # source://packwerk//lib/packwerk/commands/base_command.rb#63
334
+ sig { returns(::Packwerk::Formatters::ProgressFormatter) }
335
+ def progress_formatter; end
336
+
337
+ class << self
338
+ # source://packwerk//lib/packwerk/commands/base_command.rb#17
339
+ sig { params(description: T.nilable(::String)).returns(::String) }
340
+ def description(description = T.unsafe(nil)); end
341
+ end
342
+ end
343
+
344
+ # source://packwerk//lib/packwerk/commands/check_command.rb#6
345
+ class Packwerk::Commands::CheckCommand < ::Packwerk::Commands::BaseCommand
346
+ include ::Packwerk::Commands::UsesParseRun
347
+
348
+ # source://packwerk//lib/packwerk/commands/check_command.rb#13
349
+ sig { override.returns(T::Boolean) }
350
+ def run; end
351
+
352
+ private
353
+
354
+ # source://packwerk//lib/packwerk/commands/check_command.rb#55
355
+ sig { returns(::Packwerk::OffenseCollection) }
356
+ def offense_collection; end
357
+
358
+ # source://packwerk//lib/packwerk/commands/check_command.rb#50
359
+ sig { returns(::Packwerk::RunContext) }
360
+ def run_context; end
361
+ end
362
+
363
+ # source://packwerk//lib/packwerk/commands/help_command.rb#6
364
+ class Packwerk::Commands::HelpCommand < ::Packwerk::Commands::BaseCommand
365
+ # source://packwerk//lib/packwerk/commands/help_command.rb#12
366
+ sig { override.returns(T::Boolean) }
367
+ def run; end
368
+
369
+ private
370
+
371
+ # source://packwerk//lib/packwerk/commands/help_command.rb#26
372
+ sig { returns(::String) }
373
+ def command_help_lines; end
374
+ end
375
+
376
+ # source://packwerk//lib/packwerk/commands/init_command.rb#6
377
+ class Packwerk::Commands::InitCommand < ::Packwerk::Commands::BaseCommand
378
+ # source://packwerk//lib/packwerk/commands/init_command.rb#12
379
+ sig { override.returns(T::Boolean) }
380
+ def run; end
381
+ end
382
+
383
+ # source://packwerk//lib/packwerk/commands/lazy_loaded_entry.rb#6
384
+ class Packwerk::Commands::LazyLoadedEntry
385
+ # source://packwerk//lib/packwerk/commands/lazy_loaded_entry.rb#13
386
+ sig { params(name: ::String, aliases: T::Array[::String]).void }
387
+ def initialize(name, aliases: T.unsafe(nil)); end
388
+
389
+ # source://packwerk//lib/packwerk/commands/lazy_loaded_entry.rb#19
390
+ sig { returns(T.class_of(Packwerk::Commands::BaseCommand)) }
391
+ def command_class; end
392
+
393
+ # source://packwerk//lib/packwerk/commands/lazy_loaded_entry.rb#25
394
+ sig { returns(::String) }
395
+ def description; end
396
+
397
+ # source://packwerk//lib/packwerk/commands/lazy_loaded_entry.rb#30
398
+ sig { params(name_or_alias: ::String).returns(T::Boolean) }
399
+ def matches_command?(name_or_alias); end
400
+
401
+ # source://packwerk//lib/packwerk/commands/lazy_loaded_entry.rb#10
402
+ sig { returns(::String) }
403
+ def name; end
404
+ end
405
+
406
+ # source://packwerk//lib/packwerk/commands/update_todo_command.rb#6
407
+ class Packwerk::Commands::UpdateTodoCommand < ::Packwerk::Commands::BaseCommand
408
+ include ::Packwerk::Commands::UsesParseRun
409
+
410
+ # source://packwerk//lib/packwerk/commands/update_todo_command.rb#13
411
+ sig { override.returns(T::Boolean) }
412
+ def run; end
413
+ end
414
+
415
+ # source://packwerk//lib/packwerk/commands/uses_parse_run.rb#8
416
+ module Packwerk::Commands::UsesParseRun
417
+ requires_ancestor { Packwerk::Commands::BaseCommand }
418
+
419
+ # source://packwerk//lib/packwerk/commands/uses_parse_run.rb#24
420
+ sig do
421
+ params(
422
+ args: T::Array[::String],
423
+ configuration: ::Packwerk::Configuration,
424
+ out: T.any(::IO, ::StringIO),
425
+ err_out: T.any(::IO, ::StringIO),
426
+ progress_formatter: ::Packwerk::Formatters::ProgressFormatter,
427
+ offenses_formatter: ::Packwerk::OffensesFormatter
428
+ ).void
429
+ end
430
+ def initialize(args, configuration:, out:, err_out:, progress_formatter:, offenses_formatter:); end
431
+
432
+ private
433
+
434
+ # source://packwerk//lib/packwerk/commands/uses_parse_run.rb#34
435
+ sig { returns(::Packwerk::FilesForProcessing) }
436
+ def fetch_files_to_process; end
437
+
438
+ # source://packwerk//lib/packwerk/commands/uses_parse_run.rb#43
439
+ sig { returns(T.nilable(::Packwerk::OffensesFormatter)) }
440
+ def offenses_formatter_from_options; end
441
+
442
+ # source://packwerk//lib/packwerk/commands/uses_parse_run.rb#48
443
+ sig { returns(::Packwerk::ParseRun) }
444
+ def parse_run; end
445
+
446
+ # source://packwerk//lib/packwerk/commands/uses_parse_run.rb#56
447
+ sig { returns(T::Hash[::Symbol, T.untyped]) }
448
+ def parsed_options; end
449
+ end
450
+
451
+ # source://packwerk//lib/packwerk/commands/validate_command.rb#6
452
+ class Packwerk::Commands::ValidateCommand < ::Packwerk::Commands::BaseCommand
453
+ # source://packwerk//lib/packwerk/commands/validate_command.rb#12
454
+ sig { override.returns(T::Boolean) }
455
+ def run; end
456
+
457
+ private
458
+
459
+ # source://packwerk//lib/packwerk/commands/validate_command.rb#38
460
+ sig { returns(Packwerk::PackageSet) }
461
+ def package_set; end
462
+
463
+ # source://packwerk//lib/packwerk/commands/validate_command.rb#33
464
+ sig { returns(::Packwerk::ApplicationValidator) }
465
+ def validator; end
466
+ end
467
+
468
+ # source://packwerk//lib/packwerk/commands/version_command.rb#6
469
+ class Packwerk::Commands::VersionCommand < ::Packwerk::Commands::BaseCommand
470
+ # source://packwerk//lib/packwerk/commands/version_command.rb#12
471
+ sig { override.returns(T::Boolean) }
472
+ def run; end
473
+ end
474
+
475
+ # source://packwerk//lib/packwerk/configuration.rb#8
476
+ class Packwerk::Configuration
477
+ # source://packwerk//lib/packwerk/configuration.rb#72
478
+ sig { params(configs: T::Hash[::String, T.untyped], config_path: T.nilable(::String)).void }
479
+ def initialize(configs = T.unsafe(nil), config_path: T.unsafe(nil)); end
480
+
481
+ # source://packwerk//lib/packwerk/configuration.rb#61
482
+ sig { returns(::Pathname) }
483
+ def cache_directory; end
484
+
485
+ # source://packwerk//lib/packwerk/configuration.rb#114
486
+ sig { returns(T::Boolean) }
487
+ def cache_enabled?; end
488
+
489
+ # source://packwerk//lib/packwerk/configuration.rb#58
490
+ sig { returns(T.nilable(::String)) }
491
+ def config_path; end
492
+
493
+ # source://packwerk//lib/packwerk/configuration.rb#55
494
+ sig { returns(T::Array[::Symbol]) }
495
+ def custom_associations; end
496
+
497
+ # source://packwerk//lib/packwerk/configuration.rb#46
498
+ sig { returns(T::Array[::String]) }
499
+ def exclude; end
500
+
501
+ # source://packwerk//lib/packwerk/configuration.rb#43
502
+ sig { returns(T::Array[::String]) }
503
+ def include; end
504
+
505
+ # source://packwerk//lib/packwerk/configuration.rb#96
506
+ sig { returns(T::Hash[::String, ::Module]) }
507
+ def load_paths; end
508
+
509
+ # source://packwerk//lib/packwerk/configuration.rb#109
510
+ sig { returns(::Packwerk::OffensesFormatter) }
511
+ def offenses_formatter; end
512
+
513
+ # source://packwerk//lib/packwerk/configuration.rb#52
514
+ sig { returns(T.any(::String, T::Array[::String])) }
515
+ def package_paths; end
516
+
517
+ # source://packwerk//lib/packwerk/configuration.rb#64
518
+ sig { params(parallel: T::Boolean).returns(T::Boolean) }
519
+ def parallel=(parallel); end
520
+
521
+ # source://packwerk//lib/packwerk/configuration.rb#104
522
+ sig { returns(T::Boolean) }
523
+ def parallel?; end
524
+
525
+ # source://packwerk//lib/packwerk/configuration.rb#49
526
+ sig { returns(::String) }
527
+ def root_path; end
528
+
529
+ class << self
530
+ # @raise [ArgumentError]
531
+ #
532
+ # source://packwerk//lib/packwerk/configuration.rb#15
533
+ sig { params(path: ::String).returns(::Packwerk::Configuration) }
534
+ def from_path(path = T.unsafe(nil)); end
535
+
536
+ private
537
+
538
+ # source://packwerk//lib/packwerk/configuration.rb#30
539
+ sig { params(path: ::String).returns(::Packwerk::Configuration) }
540
+ def from_packwerk_config(path); end
541
+ end
542
+ end
543
+
544
+ # source://packwerk//lib/packwerk/configuration.rb#38
545
+ Packwerk::Configuration::DEFAULT_CONFIG_PATH = T.let(T.unsafe(nil), String)
546
+
547
+ # source://packwerk//lib/packwerk/configuration.rb#40
548
+ Packwerk::Configuration::DEFAULT_EXCLUDE_GLOBS = T.let(T.unsafe(nil), Array)
549
+
550
+ # source://packwerk//lib/packwerk/configuration.rb#39
551
+ Packwerk::Configuration::DEFAULT_INCLUDE_GLOBS = T.let(T.unsafe(nil), Array)
552
+
553
+ # Extracts a constant name from an AST node of type :const
554
+ #
555
+ # source://packwerk//lib/packwerk/const_node_inspector.rb#6
556
+ class Packwerk::ConstNodeInspector
557
+ include ::Packwerk::ConstantNameInspector
558
+
559
+ # source://packwerk//lib/packwerk/const_node_inspector.rb#15
560
+ sig { override.params(node: ::AST::Node, ancestors: T::Array[::AST::Node]).returns(T.nilable(::String)) }
561
+ def constant_name_from_node(node, ancestors:); end
562
+
563
+ private
564
+
565
+ # source://packwerk//lib/packwerk/const_node_inspector.rb#43
566
+ sig { params(node: ::AST::Node, parent: ::AST::Node).returns(T.nilable(T::Boolean)) }
567
+ def constant_in_module_or_class_definition?(node, parent:); end
568
+
569
+ # source://packwerk//lib/packwerk/const_node_inspector.rb#49
570
+ sig { params(ancestors: T::Array[::AST::Node]).returns(::String) }
571
+ def fully_qualify_constant(ancestors); end
572
+
573
+ # source://packwerk//lib/packwerk/const_node_inspector.rb#38
574
+ sig { params(parent: T.nilable(::AST::Node)).returns(T::Boolean) }
575
+ def root_constant?(parent); end
576
+ end
577
+
578
+ # source://packwerk//lib/packwerk/constant_context.rb#7
579
+ class Packwerk::ConstantContext < ::Struct
580
+ # Returns the value of attribute location
581
+ #
582
+ # @return [Object] the current value of location
583
+ def location; end
584
+
585
+ # Sets the attribute location
586
+ #
587
+ # @param value [Object] the value to set the attribute location to.
588
+ # @return [Object] the newly set value
589
+ def location=(_); end
590
+
591
+ # Returns the value of attribute name
592
+ #
593
+ # @return [Object] the current value of name
594
+ def name; end
595
+
596
+ # Sets the attribute name
597
+ #
598
+ # @param value [Object] the value to set the attribute name to.
599
+ # @return [Object] the newly set value
600
+ def name=(_); end
601
+
602
+ # Returns the value of attribute package
603
+ #
604
+ # @return [Object] the current value of package
605
+ def package; end
606
+
607
+ # Sets the attribute package
608
+ #
609
+ # @param value [Object] the value to set the attribute package to.
610
+ # @return [Object] the newly set value
611
+ def package=(_); end
612
+
613
+ class << self
614
+ def [](*_arg0); end
615
+ def inspect; end
616
+ def keyword_init?; end
617
+ def members; end
618
+ def new(*_arg0); end
619
+ end
620
+ end
621
+
622
+ # Get information about unresolved constants without loading the application code.
623
+ # Information gathered: Fully qualified name, path to file containing the definition, package,
624
+ # and visibility (public/private to the package).
625
+ #
626
+ # The implementation makes a few assumptions about the code base:
627
+ # - `Something::SomeOtherThing` is defined in a path of either `something/some_other_thing.rb` or `something.rb`,
628
+ # relative to the load path. Rails' `zeitwerk` autoloader makes the same assumption.
629
+ # - It is OK to not always infer the exact file defining the constant. For example, when a constant is inherited, we
630
+ # have no way of inferring the file it is defined in. You could argue though that inheritance means that another
631
+ # constant with the same name exists in the inheriting class, and this view is sufficient for all our use cases.
632
+ #
633
+ # source://packwerk//lib/packwerk/constant_discovery.rb#17
634
+ class Packwerk::ConstantDiscovery
635
+ # source://packwerk//lib/packwerk/constant_discovery.rb#25
636
+ sig { params(constant_resolver: ::ConstantResolver, packages: Packwerk::PackageSet).void }
637
+ def initialize(constant_resolver:, packages:); end
638
+
639
+ # Analyze a constant via its name.
640
+ # If the constant is unresolved, we need the current namespace path to correctly infer its full name
641
+ #
642
+ # source://packwerk//lib/packwerk/constant_discovery.rb#58
643
+ sig do
644
+ params(
645
+ const_name: ::String,
646
+ current_namespace_path: T.nilable(T::Array[::String])
647
+ ).returns(T.nilable(::Packwerk::ConstantContext))
648
+ end
649
+ def context_for(const_name, current_namespace_path: T.unsafe(nil)); end
650
+
651
+ # Get the package that owns a given file path.
652
+ #
653
+ # source://packwerk//lib/packwerk/constant_discovery.rb#41
654
+ sig { params(path: ::String).returns(::Packwerk::Package) }
655
+ def package_from_path(path); end
656
+ end
657
+
658
+ # An interface describing an object that can extract a constant name from an AST node.
659
+ #
660
+ # @abstract Subclasses must implement the `abstract` methods below.
661
+ #
662
+ # source://packwerk//lib/packwerk/constant_name_inspector.rb#8
663
+ module Packwerk::ConstantNameInspector
664
+ interface!
665
+
666
+ # @abstract
667
+ #
668
+ # source://packwerk//lib/packwerk/constant_name_inspector.rb#19
669
+ sig { abstract.params(node: ::AST::Node, ancestors: T::Array[::AST::Node]).returns(T.nilable(::String)) }
670
+ def constant_name_from_node(node, ancestors:); end
671
+ end
672
+
673
+ # source://packwerk//lib/packwerk/cache.rb#162
674
+ class Packwerk::Debug
675
+ class << self
676
+ # source://packwerk//lib/packwerk/cache.rb#167
677
+ sig { params(out: ::String).void }
678
+ def out(out); end
679
+ end
680
+ end
681
+
682
+ # This class handles loading extensions to packwerk using the `require` directive
683
+ # in the `packwerk.yml` configuration.
684
+ #
685
+ # source://packwerk//lib/packwerk/extension_loader.rb#7
686
+ module Packwerk::ExtensionLoader
687
+ class << self
688
+ # source://packwerk//lib/packwerk/extension_loader.rb#11
689
+ sig { params(require_directive: ::String, config_dir_path: ::String).void }
690
+ def load(require_directive, config_dir_path); end
691
+ end
692
+ end
693
+
694
+ # @abstract Subclasses must implement the `abstract` methods below.
695
+ #
696
+ # source://packwerk//lib/packwerk/file_parser.rb#5
697
+ module Packwerk::FileParser
698
+ requires_ancestor { Kernel }
699
+
700
+ interface!
701
+
702
+ # @abstract
703
+ #
704
+ # source://packwerk//lib/packwerk/file_parser.rb#35
705
+ sig { abstract.params(io: T.any(::IO, ::StringIO), file_path: ::String).returns(T.untyped) }
706
+ def call(io:, file_path:); end
707
+
708
+ # @abstract
709
+ #
710
+ # source://packwerk//lib/packwerk/file_parser.rb#39
711
+ sig { abstract.params(path: ::String).returns(T::Boolean) }
712
+ def match?(path:); end
713
+
714
+ class << self
715
+ # source://packwerk//lib/packwerk/file_parser.rb#24
716
+ sig { returns(T::Array[::Packwerk::FileParser]) }
717
+ def all; end
718
+
719
+ # source://packwerk//lib/packwerk/file_parser.rb#19
720
+ sig { params(base: ::Class).void }
721
+ def included(base); end
722
+
723
+ # source://packwerk//lib/packwerk/file_parser.rb#29
724
+ sig { params(base: ::Class).void }
725
+ def remove(base); end
726
+ end
727
+ end
728
+
729
+ # source://packwerk//lib/packwerk/file_processor.rb#7
730
+ class Packwerk::FileProcessor
731
+ # source://packwerk//lib/packwerk/file_processor.rb#26
732
+ sig do
733
+ params(
734
+ node_processor_factory: ::Packwerk::NodeProcessorFactory,
735
+ cache: ::Packwerk::Cache,
736
+ parser_factory: T.nilable(::Packwerk::Parsers::Factory)
737
+ ).void
738
+ end
739
+ def initialize(node_processor_factory:, cache:, parser_factory: T.unsafe(nil)); end
740
+
741
+ # source://packwerk//lib/packwerk/file_processor.rb#40
742
+ sig { params(relative_file: ::String).returns(::Packwerk::FileProcessor::ProcessedFile) }
743
+ def call(relative_file); end
744
+
745
+ private
746
+
747
+ # source://packwerk//lib/packwerk/file_processor.rb#87
748
+ sig { params(relative_file: ::String, parser: ::Packwerk::FileParser).returns(T.untyped) }
749
+ def parse_into_ast(relative_file, parser); end
750
+
751
+ # source://packwerk//lib/packwerk/file_processor.rb#94
752
+ sig { params(file_path: ::String).returns(T::Array[::Packwerk::FileParser]) }
753
+ def parsers_for(file_path); end
754
+
755
+ # source://packwerk//lib/packwerk/file_processor.rb#76
756
+ sig { params(node: ::Parser::AST::Node, relative_file: ::String).returns(T::Array[::Packwerk::UnresolvedReference]) }
757
+ def references_from_ast(node, relative_file); end
758
+ end
759
+
760
+ # source://packwerk//lib/packwerk/file_processor.rb#32
761
+ class Packwerk::FileProcessor::ProcessedFile < ::T::Struct
762
+ const :unresolved_references, T::Array[::Packwerk::UnresolvedReference], default: T.unsafe(nil)
763
+ const :offenses, T::Array[::Packwerk::Offense], default: T.unsafe(nil)
764
+
765
+ class << self
766
+ # source://sorbet-runtime/0.5.11175/lib/types/struct.rb#13
767
+ def inherited(s); end
768
+ end
769
+ end
770
+
771
+ # source://packwerk//lib/packwerk/file_processor.rb#10
772
+ class Packwerk::FileProcessor::UnknownFileTypeResult < ::Packwerk::Offense
773
+ # source://packwerk//lib/packwerk/file_processor.rb#14
774
+ sig { params(file: ::String).void }
775
+ def initialize(file:); end
776
+ end
777
+
778
+ # source://packwerk//lib/packwerk/files_for_processing.rb#5
779
+ class Packwerk::FilesForProcessing
780
+ # source://packwerk//lib/packwerk/files_for_processing.rb#32
781
+ sig do
782
+ params(
783
+ relative_file_paths: T::Array[::String],
784
+ configuration: ::Packwerk::Configuration,
785
+ ignore_nested_packages: T::Boolean
786
+ ).void
787
+ end
788
+ def initialize(relative_file_paths, configuration, ignore_nested_packages); end
789
+
790
+ # source://packwerk//lib/packwerk/files_for_processing.rb#41
791
+ sig { returns(T::Set[::String]) }
792
+ def files; end
793
+
794
+ # source://packwerk//lib/packwerk/files_for_processing.rb#46
795
+ sig { returns(T::Boolean) }
796
+ def files_specified?; end
797
+
798
+ private
799
+
800
+ # source://packwerk//lib/packwerk/files_for_processing.rb#105
801
+ sig { returns(T::Set[::String]) }
802
+ def configured_excluded_files; end
803
+
804
+ # source://packwerk//lib/packwerk/files_for_processing.rb#100
805
+ sig { returns(T::Set[::String]) }
806
+ def configured_included_files; end
807
+
808
+ # source://packwerk//lib/packwerk/files_for_processing.rb#53
809
+ sig { returns(T::Set[::String]) }
810
+ def files_for_processing; end
811
+
812
+ # source://packwerk//lib/packwerk/files_for_processing.rb#110
813
+ sig { params(relative_globs: T::Array[::String]).returns(T::Set[::String]) }
814
+ def relative_files_for_globs(relative_globs); end
815
+
816
+ # source://packwerk//lib/packwerk/files_for_processing.rb#64
817
+ sig { returns(T::Set[::String]) }
818
+ def specified_files; end
819
+
820
+ # source://packwerk//lib/packwerk/files_for_processing.rb#77
821
+ sig { params(relative_file_path: ::String).returns(T::Set[::String]) }
822
+ def specified_included_files(relative_file_path); end
823
+
824
+ class << self
825
+ # source://packwerk//lib/packwerk/files_for_processing.rb#20
826
+ sig do
827
+ params(
828
+ relative_file_paths: T::Array[::String],
829
+ configuration: ::Packwerk::Configuration,
830
+ ignore_nested_packages: T::Boolean
831
+ ).returns(::Packwerk::FilesForProcessing)
832
+ end
833
+ def fetch(relative_file_paths:, configuration:, ignore_nested_packages: T.unsafe(nil)); end
834
+ end
835
+ end
836
+
837
+ # source://packwerk//lib/packwerk/files_for_processing.rb#8
838
+ Packwerk::FilesForProcessing::RelativeFileSet = T.type_alias { T::Set[::String] }
839
+
840
+ # source://packwerk//lib/packwerk.rb#44
841
+ module Packwerk::Formatters
842
+ extend ::ActiveSupport::Autoload
843
+ end
844
+
845
+ # source://packwerk//lib/packwerk/formatters/default_offenses_formatter.rb#6
846
+ class Packwerk::Formatters::DefaultOffensesFormatter
847
+ include ::Packwerk::OffensesFormatter
848
+
849
+ # source://packwerk//lib/packwerk/formatters/default_offenses_formatter.rb#33
850
+ sig { override.returns(::String) }
851
+ def identifier; end
852
+
853
+ # source://packwerk//lib/packwerk/formatters/default_offenses_formatter.rb#14
854
+ sig { override.params(offenses: T::Array[T.nilable(::Packwerk::Offense)]).returns(::String) }
855
+ def show_offenses(offenses); end
856
+
857
+ # source://packwerk//lib/packwerk/formatters/default_offenses_formatter.rb#24
858
+ sig do
859
+ override
860
+ .params(
861
+ offense_collection: ::Packwerk::OffenseCollection,
862
+ file_set: T::Set[::String]
863
+ ).returns(::String)
864
+ end
865
+ def show_stale_violations(offense_collection, file_set); end
866
+
867
+ # source://packwerk//lib/packwerk/formatters/default_offenses_formatter.rb#38
868
+ sig { override.params(strict_mode_violations: T::Array[::Packwerk::ReferenceOffense]).returns(::String) }
869
+ def show_strict_mode_violations(strict_mode_violations); end
870
+
871
+ private
872
+
873
+ # source://packwerk//lib/packwerk/formatters/default_offenses_formatter.rb#54
874
+ sig { params(offense: ::Packwerk::ReferenceOffense).returns(::String) }
875
+ def format_strict_mode_violation(offense); end
876
+
877
+ # source://packwerk//lib/packwerk/formatters/default_offenses_formatter.rb#63
878
+ sig { params(offenses: T::Array[T.nilable(::Packwerk::Offense)]).returns(::String) }
879
+ def offenses_list(offenses); end
880
+
881
+ # source://packwerk//lib/packwerk/formatters/default_offenses_formatter.rb#71
882
+ sig { params(offenses: T::Array[T.nilable(::Packwerk::Offense)]).returns(::String) }
883
+ def offenses_summary(offenses); end
884
+
885
+ # source://packwerk//lib/packwerk/formatters/default_offenses_formatter.rb#49
886
+ sig { returns(::Packwerk::OutputStyle) }
887
+ def style; end
888
+ end
889
+
890
+ # source://packwerk//lib/packwerk/formatters/default_offenses_formatter.rb#9
891
+ Packwerk::Formatters::DefaultOffensesFormatter::IDENTIFIER = T.let(T.unsafe(nil), String)
892
+
893
+ # source://packwerk//lib/packwerk/formatters/progress_formatter.rb#8
894
+ class Packwerk::Formatters::ProgressFormatter
895
+ # source://packwerk//lib/packwerk/formatters/progress_formatter.rb#12
896
+ sig { params(out: T.any(::IO, ::StringIO), style: ::Packwerk::OutputStyle).void }
897
+ def initialize(out, style: T.unsafe(nil)); end
898
+
899
+ # source://packwerk//lib/packwerk/formatters/progress_formatter.rb#34
900
+ sig { params(failed: T::Boolean).void }
901
+ def increment_progress(failed = T.unsafe(nil)); end
902
+
903
+ # source://packwerk//lib/packwerk/formatters/progress_formatter.rb#53
904
+ sig { void }
905
+ def interrupted; end
906
+
907
+ # source://packwerk//lib/packwerk/formatters/progress_formatter.rb#48
908
+ sig { void }
909
+ def mark_as_failed; end
910
+
911
+ # source://packwerk//lib/packwerk/formatters/progress_formatter.rb#43
912
+ sig { void }
913
+ def mark_as_inspected; end
914
+
915
+ # source://packwerk//lib/packwerk/formatters/progress_formatter.rb#26
916
+ sig { params(target_files: T::Set[::String], block: T.proc.void).void }
917
+ def started_inspection(target_files, &block); end
918
+
919
+ # source://packwerk//lib/packwerk/formatters/progress_formatter.rb#18
920
+ sig { params(block: T.proc.void).void }
921
+ def started_validation(&block); end
922
+
923
+ private
924
+
925
+ # source://packwerk//lib/packwerk/formatters/progress_formatter.rb#62
926
+ sig { params(execution_time: ::Float).void }
927
+ def finished(execution_time); end
928
+
929
+ # source://packwerk//lib/packwerk/formatters/progress_formatter.rb#74
930
+ sig { params(target_files: T::Set[::String]).void }
931
+ def start_inspection(target_files); end
932
+
933
+ # source://packwerk//lib/packwerk/formatters/progress_formatter.rb#69
934
+ sig { void }
935
+ def start_validation; end
936
+ end
937
+
938
+ # source://packwerk//lib/packwerk.rb#79
939
+ module Packwerk::Generators
940
+ extend ::ActiveSupport::Autoload
941
+ end
942
+
943
+ # source://packwerk//lib/packwerk/generators/configuration_file.rb#8
944
+ class Packwerk::Generators::ConfigurationFile
945
+ # source://packwerk//lib/packwerk/generators/configuration_file.rb#23
946
+ sig { params(root: ::String, out: T.any(::IO, ::StringIO)).void }
947
+ def initialize(root:, out: T.unsafe(nil)); end
948
+
949
+ # source://packwerk//lib/packwerk/generators/configuration_file.rb#29
950
+ sig { returns(T::Boolean) }
951
+ def generate; end
952
+
953
+ private
954
+
955
+ # source://packwerk//lib/packwerk/generators/configuration_file.rb#47
956
+ sig { returns(::String) }
957
+ def render; end
958
+
959
+ # source://packwerk//lib/packwerk/generators/configuration_file.rb#52
960
+ sig { returns(::String) }
961
+ def template; end
962
+
963
+ class << self
964
+ # source://packwerk//lib/packwerk/generators/configuration_file.rb#17
965
+ sig { params(root: ::String, out: T.any(::IO, ::StringIO)).returns(T::Boolean) }
966
+ def generate(root:, out:); end
967
+ end
968
+ end
969
+
970
+ # source://packwerk//lib/packwerk/generators/configuration_file.rb#11
971
+ Packwerk::Generators::ConfigurationFile::CONFIGURATION_TEMPLATE_FILE_PATH = T.let(T.unsafe(nil), String)
972
+
973
+ # source://packwerk//lib/packwerk/generators/root_package.rb#6
974
+ class Packwerk::Generators::RootPackage
975
+ # source://packwerk//lib/packwerk/generators/root_package.rb#19
976
+ sig { params(root: ::String, out: T.any(::IO, ::StringIO)).void }
977
+ def initialize(root:, out: T.unsafe(nil)); end
978
+
979
+ # source://packwerk//lib/packwerk/generators/root_package.rb#25
980
+ sig { returns(T::Boolean) }
981
+ def generate; end
982
+
983
+ class << self
984
+ # source://packwerk//lib/packwerk/generators/root_package.rb#13
985
+ sig { params(root: ::String, out: T.any(::IO, ::StringIO)).returns(T::Boolean) }
986
+ def generate(root:, out:); end
987
+ end
988
+ end
989
+
990
+ # A general implementation of a graph data structure with the ability to check for - and list - cycles.
991
+ #
992
+ # source://packwerk//lib/packwerk/graph.rb#6
993
+ class Packwerk::Graph
994
+ # source://packwerk//lib/packwerk/graph.rb#14
995
+ sig { params(edges: T::Array[T::Array[T.nilable(T.any(::Integer, ::String))]]).void }
996
+ def initialize(edges); end
997
+
998
+ # @return [Boolean]
999
+ #
1000
+ # source://packwerk//lib/packwerk/graph.rb#24
1001
+ def acyclic?; end
1002
+
1003
+ # source://packwerk//lib/packwerk/graph.rb#20
1004
+ def cycles; end
1005
+
1006
+ private
1007
+
1008
+ # source://packwerk//lib/packwerk/graph.rb#74
1009
+ def add_cycle(cycle); end
1010
+
1011
+ # source://packwerk//lib/packwerk/graph.rb#67
1012
+ def neighbours(node); end
1013
+
1014
+ # source://packwerk//lib/packwerk/graph.rb#30
1015
+ def nodes; end
1016
+
1017
+ # source://packwerk//lib/packwerk/graph.rb#34
1018
+ def process; end
1019
+
1020
+ # source://packwerk//lib/packwerk/graph.rb#42
1021
+ def visit(node, visited_nodes: T.unsafe(nil), path: T.unsafe(nil)); end
1022
+ end
1023
+
1024
+ # source://packwerk//lib/packwerk/node.rb#5
1025
+ module Packwerk::Node; end
1026
+
1027
+ # source://packwerk//lib/packwerk/node.rb#6
1028
+ class Packwerk::Node::Location < ::Struct
1029
+ # Returns the value of attribute column
1030
+ #
1031
+ # @return [Object] the current value of column
1032
+ def column; end
1033
+
1034
+ # Sets the attribute column
1035
+ #
1036
+ # @param value [Object] the value to set the attribute column to.
1037
+ # @return [Object] the newly set value
1038
+ def column=(_); end
1039
+
1040
+ # Returns the value of attribute line
1041
+ #
1042
+ # @return [Object] the current value of line
1043
+ def line; end
1044
+
1045
+ # Sets the attribute line
1046
+ #
1047
+ # @param value [Object] the value to set the attribute line to.
1048
+ # @return [Object] the newly set value
1049
+ def line=(_); end
1050
+
1051
+ class << self
1052
+ def [](*_arg0); end
1053
+ def inspect; end
1054
+ def keyword_init?; end
1055
+ def members; end
1056
+ def new(*_arg0); end
1057
+ end
1058
+ end
1059
+
1060
+ # Convenience methods for working with Parser::AST::Node nodes.
1061
+ #
1062
+ # source://packwerk//lib/packwerk/node_helpers.rb#9
1063
+ module Packwerk::NodeHelpers
1064
+ class << self
1065
+ # source://packwerk//lib/packwerk/node_helpers.rb#122
1066
+ sig { params(node: ::AST::Node).returns(T::Boolean) }
1067
+ def class?(node); end
1068
+
1069
+ # source://packwerk//lib/packwerk/node_helpers.rb#16
1070
+ sig { params(class_or_module_node: ::AST::Node).returns(::String) }
1071
+ def class_or_module_name(class_or_module_node); end
1072
+
1073
+ # source://packwerk//lib/packwerk/node_helpers.rb#112
1074
+ sig { params(node: ::AST::Node).returns(T::Boolean) }
1075
+ def constant?(node); end
1076
+
1077
+ # source://packwerk//lib/packwerk/node_helpers.rb#117
1078
+ sig { params(node: ::AST::Node).returns(T::Boolean) }
1079
+ def constant_assignment?(node); end
1080
+
1081
+ # source://packwerk//lib/packwerk/node_helpers.rb#31
1082
+ sig { params(constant_node: ::AST::Node).returns(::String) }
1083
+ def constant_name(constant_node); end
1084
+
1085
+ # source://packwerk//lib/packwerk/node_helpers.rb#68
1086
+ sig do
1087
+ params(
1088
+ node: ::AST::Node,
1089
+ block: T.nilable(T.proc.params(arg0: ::Parser::AST::Node).void)
1090
+ ).returns(T::Enumerable[::AST::Node])
1091
+ end
1092
+ def each_child(node, &block); end
1093
+
1094
+ # source://packwerk//lib/packwerk/node_helpers.rb#79
1095
+ sig { params(starting_node: ::AST::Node, ancestors: T::Array[::AST::Node]).returns(T::Array[::String]) }
1096
+ def enclosing_namespace_path(starting_node, ancestors:); end
1097
+
1098
+ # source://packwerk//lib/packwerk/node_helpers.rb#132
1099
+ sig { params(node: ::AST::Node).returns(T::Boolean) }
1100
+ def hash?(node); end
1101
+
1102
+ # source://packwerk//lib/packwerk/node_helpers.rb#92
1103
+ sig { params(string_or_symbol_node: ::AST::Node).returns(T.any(::String, ::Symbol)) }
1104
+ def literal_value(string_or_symbol_node); end
1105
+
1106
+ # source://packwerk//lib/packwerk/node_helpers.rb#106
1107
+ sig { params(node: ::Parser::AST::Node).returns(::Packwerk::Node::Location) }
1108
+ def location(node); end
1109
+
1110
+ # @raise [TypeError]
1111
+ #
1112
+ # source://packwerk//lib/packwerk/node_helpers.rb#147
1113
+ sig { params(method_call_node: ::AST::Node).returns(T::Array[::AST::Node]) }
1114
+ def method_arguments(method_call_node); end
1115
+
1116
+ # source://packwerk//lib/packwerk/node_helpers.rb#127
1117
+ sig { params(node: ::AST::Node).returns(T::Boolean) }
1118
+ def method_call?(node); end
1119
+
1120
+ # @raise [TypeError]
1121
+ #
1122
+ # source://packwerk//lib/packwerk/node_helpers.rb#156
1123
+ sig { params(method_call_node: ::AST::Node).returns(::Symbol) }
1124
+ def method_name(method_call_node); end
1125
+
1126
+ # source://packwerk//lib/packwerk/node_helpers.rb#165
1127
+ sig { params(node: ::AST::Node).returns(T.nilable(::String)) }
1128
+ def module_name_from_definition(node); end
1129
+
1130
+ # source://packwerk//lib/packwerk/node_helpers.rb#190
1131
+ sig { params(node: ::AST::Node).returns(T.nilable(::Packwerk::Node::Location)) }
1132
+ def name_location(node); end
1133
+
1134
+ # @raise [TypeError]
1135
+ #
1136
+ # source://packwerk//lib/packwerk/node_helpers.rb#200
1137
+ sig { params(class_node: ::AST::Node).returns(T.nilable(::AST::Node)) }
1138
+ def parent_class(class_node); end
1139
+
1140
+ # source://packwerk//lib/packwerk/node_helpers.rb#209
1141
+ sig { params(ancestors: T::Array[::AST::Node]).returns(::String) }
1142
+ def parent_module_name(ancestors:); end
1143
+
1144
+ # source://packwerk//lib/packwerk/node_helpers.rb#137
1145
+ sig { params(node: ::AST::Node).returns(T::Boolean) }
1146
+ def string?(node); end
1147
+
1148
+ # source://packwerk//lib/packwerk/node_helpers.rb#142
1149
+ sig { params(node: ::AST::Node).returns(T::Boolean) }
1150
+ def symbol?(node); end
1151
+
1152
+ # @raise [TypeError]
1153
+ #
1154
+ # source://packwerk//lib/packwerk/node_helpers.rb#221
1155
+ sig { params(hash_node: ::AST::Node, key: ::Symbol).returns(T.untyped) }
1156
+ def value_from_hash(hash_node, key); end
1157
+
1158
+ private
1159
+
1160
+ # source://packwerk//lib/packwerk/node_helpers.rb#303
1161
+ sig { params(node: T.nilable(::AST::Node)).returns(T::Boolean) }
1162
+ def dynamic_class_creation?(node); end
1163
+
1164
+ # @raise [TypeError]
1165
+ #
1166
+ # source://packwerk//lib/packwerk/node_helpers.rb#254
1167
+ sig { params(hash_pair_node: ::AST::Node).returns(T.untyped) }
1168
+ def hash_pair_key(hash_pair_node); end
1169
+
1170
+ # @raise [TypeError]
1171
+ #
1172
+ # source://packwerk//lib/packwerk/node_helpers.rb#265
1173
+ sig { params(hash_pair_node: ::AST::Node).returns(T.untyped) }
1174
+ def hash_pair_value(hash_pair_node); end
1175
+
1176
+ # @raise [TypeError]
1177
+ #
1178
+ # source://packwerk//lib/packwerk/node_helpers.rb#276
1179
+ sig { params(hash_node: ::AST::Node).returns(T::Array[::AST::Node]) }
1180
+ def hash_pairs(hash_node); end
1181
+
1182
+ # @raise [TypeError]
1183
+ #
1184
+ # source://packwerk//lib/packwerk/node_helpers.rb#285
1185
+ sig { params(block_node: ::AST::Node).returns(::AST::Node) }
1186
+ def method_call_node(block_node); end
1187
+
1188
+ # source://packwerk//lib/packwerk/node_helpers.rb#294
1189
+ sig { params(node: ::AST::Node).returns(T::Boolean) }
1190
+ def module_creation?(node); end
1191
+
1192
+ # source://packwerk//lib/packwerk/node_helpers.rb#310
1193
+ sig { params(node: ::AST::Node).returns(T.nilable(::String)) }
1194
+ def name_from_block_definition(node); end
1195
+
1196
+ # source://packwerk//lib/packwerk/node_helpers.rb#318
1197
+ sig { params(node: ::AST::Node).returns(T.nilable(::String)) }
1198
+ def name_part_from_definition(node); end
1199
+
1200
+ # source://packwerk//lib/packwerk/node_helpers.rb#328
1201
+ sig { params(method_call_or_block_node: ::AST::Node).returns(T.nilable(::AST::Node)) }
1202
+ def receiver(method_call_or_block_node); end
1203
+
1204
+ # source://packwerk//lib/packwerk/node_helpers.rb#249
1205
+ sig { params(node: ::AST::Node).returns(::Symbol) }
1206
+ def type_of(node); end
1207
+ end
1208
+ end
1209
+
1210
+ # source://packwerk//lib/packwerk/node_helpers.rb#10
1211
+ class Packwerk::NodeHelpers::TypeError < ::ArgumentError; end
1212
+
1213
+ # Processes a single node in an abstract syntax tree (AST) using the provided checkers.
1214
+ #
1215
+ # source://packwerk//lib/packwerk/node_processor.rb#6
1216
+ class Packwerk::NodeProcessor
1217
+ # source://packwerk//lib/packwerk/node_processor.rb#15
1218
+ sig { params(reference_extractor: ::Packwerk::ReferenceExtractor, relative_file: ::String).void }
1219
+ def initialize(reference_extractor:, relative_file:); end
1220
+
1221
+ # source://packwerk//lib/packwerk/node_processor.rb#26
1222
+ sig do
1223
+ params(
1224
+ node: ::Parser::AST::Node,
1225
+ ancestors: T::Array[::Parser::AST::Node]
1226
+ ).returns(T.nilable(::Packwerk::UnresolvedReference))
1227
+ end
1228
+ def call(node, ancestors); end
1229
+ end
1230
+
1231
+ # source://packwerk//lib/packwerk/node_processor_factory.rb#5
1232
+ class Packwerk::NodeProcessorFactory < ::T::Struct
1233
+ const :root_path, ::String
1234
+ const :context_provider, ::Packwerk::ConstantDiscovery
1235
+ const :constant_name_inspectors, T::Array[::Packwerk::ConstantNameInspector]
1236
+
1237
+ # source://packwerk//lib/packwerk/node_processor_factory.rb#13
1238
+ sig { params(relative_file: ::String, node: ::AST::Node).returns(::Packwerk::NodeProcessor) }
1239
+ def for(relative_file:, node:); end
1240
+
1241
+ private
1242
+
1243
+ # source://packwerk//lib/packwerk/node_processor_factory.rb#23
1244
+ sig { params(node: ::AST::Node).returns(::Packwerk::ReferenceExtractor) }
1245
+ def reference_extractor(node:); end
1246
+
1247
+ class << self
1248
+ # source://sorbet-runtime/0.5.11175/lib/types/struct.rb#13
1249
+ def inherited(s); end
1250
+ end
1251
+ end
1252
+
1253
+ # Visits all nodes of an AST, processing them using a given node processor.
1254
+ #
1255
+ # source://packwerk//lib/packwerk/node_visitor.rb#6
1256
+ class Packwerk::NodeVisitor
1257
+ # source://packwerk//lib/packwerk/node_visitor.rb#10
1258
+ sig { params(node_processor: ::Packwerk::NodeProcessor).void }
1259
+ def initialize(node_processor:); end
1260
+
1261
+ # source://packwerk//lib/packwerk/node_visitor.rb#21
1262
+ sig do
1263
+ params(
1264
+ node: ::Parser::AST::Node,
1265
+ ancestors: T::Array[::Parser::AST::Node],
1266
+ result: T::Array[::Packwerk::UnresolvedReference]
1267
+ ).void
1268
+ end
1269
+ def visit(node, ancestors:, result:); end
1270
+ end
1271
+
1272
+ # source://packwerk//lib/packwerk/offense.rb#7
1273
+ class Packwerk::Offense
1274
+ # source://packwerk//lib/packwerk/offense.rb#24
1275
+ sig { params(file: ::String, message: ::String, location: T.nilable(::Packwerk::Node::Location)).void }
1276
+ def initialize(file:, message:, location: T.unsafe(nil)); end
1277
+
1278
+ # source://packwerk//lib/packwerk/offense.rb#15
1279
+ sig { returns(::String) }
1280
+ def file; end
1281
+
1282
+ # source://packwerk//lib/packwerk/offense.rb#12
1283
+ sig { returns(T.nilable(::Packwerk::Node::Location)) }
1284
+ def location; end
1285
+
1286
+ # source://packwerk//lib/packwerk/offense.rb#18
1287
+ sig { returns(::String) }
1288
+ def message; end
1289
+
1290
+ # source://packwerk//lib/packwerk/offense.rb#31
1291
+ sig { params(style: ::Packwerk::OutputStyle).returns(::String) }
1292
+ def to_s(style = T.unsafe(nil)); end
1293
+ end
1294
+
1295
+ # source://packwerk//lib/packwerk/offense_collection.rb#7
1296
+ class Packwerk::OffenseCollection
1297
+ # source://packwerk//lib/packwerk/offense_collection.rb#17
1298
+ sig { params(root_path: ::String, package_todos: T::Hash[::Packwerk::Package, ::Packwerk::PackageTodo]).void }
1299
+ def initialize(root_path, package_todos = T.unsafe(nil)); end
1300
+
1301
+ # source://packwerk//lib/packwerk/offense_collection.rb#52
1302
+ sig { params(offense: ::Packwerk::Offense).void }
1303
+ def add_offense(offense); end
1304
+
1305
+ # source://packwerk//lib/packwerk/offense_collection.rb#45
1306
+ sig { params(offenses: T::Array[::Packwerk::Offense]).void }
1307
+ def add_offenses(offenses); end
1308
+
1309
+ # source://packwerk//lib/packwerk/offense_collection.rb#29
1310
+ sig { returns(T::Array[::Packwerk::Offense]) }
1311
+ def errors; end
1312
+
1313
+ # source://packwerk//lib/packwerk/offense_collection.rb#38
1314
+ sig { params(offense: ::Packwerk::Offense).returns(T::Boolean) }
1315
+ def listed?(offense); end
1316
+
1317
+ # source://packwerk//lib/packwerk/offense_collection.rb#26
1318
+ sig { returns(T::Array[::Packwerk::ReferenceOffense]) }
1319
+ def new_violations; end
1320
+
1321
+ # source://packwerk//lib/packwerk/offense_collection.rb#84
1322
+ sig { returns(T::Array[::Packwerk::Offense]) }
1323
+ def outstanding_offenses; end
1324
+
1325
+ # source://packwerk//lib/packwerk/offense_collection.rb#78
1326
+ sig { params(package_set: Packwerk::PackageSet).void }
1327
+ def persist_package_todo_files(package_set); end
1328
+
1329
+ # source://packwerk//lib/packwerk/offense_collection.rb#71
1330
+ sig { params(for_files: T::Set[::String]).returns(T::Boolean) }
1331
+ def stale_violations?(for_files); end
1332
+
1333
+ # source://packwerk//lib/packwerk/offense_collection.rb#32
1334
+ sig { returns(T::Array[::Packwerk::ReferenceOffense]) }
1335
+ def strict_mode_violations; end
1336
+
1337
+ # source://packwerk//lib/packwerk/offense_collection.rb#89
1338
+ sig { returns(T::Array[::Packwerk::ReferenceOffense]) }
1339
+ def unlisted_strict_mode_violations; end
1340
+
1341
+ private
1342
+
1343
+ # source://packwerk//lib/packwerk/offense_collection.rb#102
1344
+ sig { params(offense: ::Packwerk::ReferenceOffense).returns(T::Boolean) }
1345
+ def add_to_package_todo(offense); end
1346
+
1347
+ # source://packwerk//lib/packwerk/offense_collection.rb#96
1348
+ sig { params(offense: ::Packwerk::ReferenceOffense).returns(T::Boolean) }
1349
+ def already_listed?(offense); end
1350
+
1351
+ # source://packwerk//lib/packwerk/offense_collection.rb#114
1352
+ sig { params(package_set: Packwerk::PackageSet).void }
1353
+ def cleanup_extra_package_todo_files(package_set); end
1354
+
1355
+ # source://packwerk//lib/packwerk/offense_collection.rb#126
1356
+ sig { void }
1357
+ def dump_package_todo_files; end
1358
+
1359
+ # source://packwerk//lib/packwerk/offense_collection.rb#139
1360
+ sig { params(package: ::Packwerk::Package).returns(::String) }
1361
+ def package_todo_file_for(package); end
1362
+
1363
+ # source://packwerk//lib/packwerk/offense_collection.rb#131
1364
+ sig { params(package: ::Packwerk::Package).returns(::Packwerk::PackageTodo) }
1365
+ def package_todo_for(package); end
1366
+
1367
+ # source://packwerk//lib/packwerk/offense_collection.rb#108
1368
+ sig { params(offense: ::Packwerk::ReferenceOffense).returns(T::Boolean) }
1369
+ def strict_mode_violation?(offense); end
1370
+ end
1371
+
1372
+ # @abstract Subclasses must implement the `abstract` methods below.
1373
+ #
1374
+ # source://packwerk//lib/packwerk/offenses_formatter.rb#5
1375
+ module Packwerk::OffensesFormatter
1376
+ abstract!
1377
+
1378
+ # @abstract
1379
+ #
1380
+ # source://packwerk//lib/packwerk/offenses_formatter.rb#78
1381
+ sig { abstract.returns(::String) }
1382
+ def identifier; end
1383
+
1384
+ # @abstract
1385
+ #
1386
+ # source://packwerk//lib/packwerk/offenses_formatter.rb#70
1387
+ sig { abstract.params(offenses: T::Array[T.nilable(::Packwerk::Offense)]).returns(::String) }
1388
+ def show_offenses(offenses); end
1389
+
1390
+ # @abstract
1391
+ #
1392
+ # source://packwerk//lib/packwerk/offenses_formatter.rb#74
1393
+ sig do
1394
+ abstract
1395
+ .params(
1396
+ offense_collection: ::Packwerk::OffenseCollection,
1397
+ for_files: T::Set[::String]
1398
+ ).returns(::String)
1399
+ end
1400
+ def show_stale_violations(offense_collection, for_files); end
1401
+
1402
+ # @abstract
1403
+ #
1404
+ # source://packwerk//lib/packwerk/offenses_formatter.rb#82
1405
+ sig { abstract.params(strict_mode_violations: T::Array[::Packwerk::ReferenceOffense]).returns(::String) }
1406
+ def show_strict_mode_violations(strict_mode_violations); end
1407
+
1408
+ class << self
1409
+ # source://packwerk//lib/packwerk/offenses_formatter.rb#29
1410
+ sig { returns(T::Array[::Packwerk::OffensesFormatter]) }
1411
+ def all; end
1412
+
1413
+ # source://packwerk//lib/packwerk/offenses_formatter.rb#35
1414
+ sig { params(identifier: ::String).returns(::Packwerk::OffensesFormatter) }
1415
+ def find(identifier); end
1416
+
1417
+ # source://packwerk//lib/packwerk/offenses_formatter.rb#24
1418
+ sig { params(base: ::Class).void }
1419
+ def included(base); end
1420
+
1421
+ private
1422
+
1423
+ # source://packwerk//lib/packwerk/offenses_formatter.rb#52
1424
+ sig { params(name: ::String).returns(::Packwerk::OffensesFormatter) }
1425
+ def formatter_by_identifier(name); end
1426
+
1427
+ # source://packwerk//lib/packwerk/offenses_formatter.rb#42
1428
+ sig { void }
1429
+ def load_defaults; end
1430
+
1431
+ # source://packwerk//lib/packwerk/offenses_formatter.rb#47
1432
+ sig { returns(T::Array[::Class]) }
1433
+ def offenses_formatters; end
1434
+ end
1435
+ end
1436
+
1437
+ # source://packwerk//lib/packwerk/offenses_formatter.rb#11
1438
+ class Packwerk::OffensesFormatter::DuplicateFormatterError < ::StandardError
1439
+ # source://packwerk//lib/packwerk/offenses_formatter.rb#15
1440
+ sig { params(identifier: ::String).void }
1441
+ def initialize(identifier); end
1442
+ end
1443
+
1444
+ # @abstract Subclasses must implement the `abstract` methods below.
1445
+ #
1446
+ # source://packwerk//lib/packwerk/output_style.rb#5
1447
+ module Packwerk::OutputStyle
1448
+ interface!
1449
+
1450
+ # @abstract
1451
+ #
1452
+ # source://packwerk//lib/packwerk/output_style.rb#18
1453
+ sig { abstract.returns(::String) }
1454
+ def error; end
1455
+
1456
+ # @abstract
1457
+ #
1458
+ # source://packwerk//lib/packwerk/output_style.rb#15
1459
+ sig { abstract.returns(::String) }
1460
+ def filename; end
1461
+
1462
+ # @abstract
1463
+ #
1464
+ # source://packwerk//lib/packwerk/output_style.rb#12
1465
+ sig { abstract.returns(::String) }
1466
+ def reset; end
1467
+ end
1468
+
1469
+ # source://packwerk//lib/packwerk.rb#37
1470
+ module Packwerk::OutputStyles
1471
+ extend ::ActiveSupport::Autoload
1472
+ end
1473
+
1474
+ # See https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit for ANSI escape colour codes
1475
+ #
1476
+ # source://packwerk//lib/packwerk/output_styles/coloured.rb#7
1477
+ class Packwerk::OutputStyles::Coloured
1478
+ include ::Packwerk::OutputStyle
1479
+
1480
+ # source://packwerk//lib/packwerk/output_styles/coloured.rb#23
1481
+ sig { override.returns(::String) }
1482
+ def error; end
1483
+
1484
+ # source://packwerk//lib/packwerk/output_styles/coloured.rb#17
1485
+ sig { override.returns(::String) }
1486
+ def filename; end
1487
+
1488
+ # source://packwerk//lib/packwerk/output_styles/coloured.rb#12
1489
+ sig { override.returns(::String) }
1490
+ def reset; end
1491
+ end
1492
+
1493
+ # source://packwerk//lib/packwerk/output_styles/plain.rb#6
1494
+ class Packwerk::OutputStyles::Plain
1495
+ include ::Packwerk::OutputStyle
1496
+
1497
+ # source://packwerk//lib/packwerk/output_styles/plain.rb#21
1498
+ sig { override.returns(::String) }
1499
+ def error; end
1500
+
1501
+ # source://packwerk//lib/packwerk/output_styles/plain.rb#16
1502
+ sig { override.returns(::String) }
1503
+ def filename; end
1504
+
1505
+ # source://packwerk//lib/packwerk/output_styles/plain.rb#11
1506
+ sig { override.returns(::String) }
1507
+ def reset; end
1508
+ end
1509
+
1510
+ # The basic unit of modularity for packwerk; a folder that has been declared to define a package.
1511
+ # The package contains all constants defined in files in this folder and all subfolders that are not packages
1512
+ # themselves.
1513
+ #
1514
+ # source://packwerk//lib/packwerk/package.rb#8
1515
+ class Packwerk::Package
1516
+ include ::Comparable
1517
+
1518
+ # source://packwerk//lib/packwerk/package.rb#24
1519
+ sig { params(name: ::String, config: T.nilable(T::Hash[::String, T.untyped])).void }
1520
+ def initialize(name:, config: T.unsafe(nil)); end
1521
+
1522
+ # source://packwerk//lib/packwerk/package.rb#49
1523
+ sig { params(other: T.untyped).returns(T.nilable(::Integer)) }
1524
+ def <=>(other); end
1525
+
1526
+ # source://packwerk//lib/packwerk/package.rb#21
1527
+ sig { returns(T::Hash[T.untyped, T.untyped]) }
1528
+ def config; end
1529
+
1530
+ # source://packwerk//lib/packwerk/package.rb#18
1531
+ sig { returns(T::Array[::String]) }
1532
+ def dependencies; end
1533
+
1534
+ # source://packwerk//lib/packwerk/package.rb#37
1535
+ sig { params(package: ::Packwerk::Package).returns(T::Boolean) }
1536
+ def dependency?(package); end
1537
+
1538
+ # source://packwerk//lib/packwerk/package.rb#32
1539
+ sig { returns(T::Boolean) }
1540
+ def enforce_dependencies?; end
1541
+
1542
+ # source://packwerk//lib/packwerk/package.rb#56
1543
+ sig { params(other: T.untyped).returns(T::Boolean) }
1544
+ def eql?(other); end
1545
+
1546
+ # source://packwerk//lib/packwerk/package.rb#61
1547
+ sig { returns(::Integer) }
1548
+ def hash; end
1549
+
1550
+ # source://packwerk//lib/packwerk/package.rb#15
1551
+ sig { returns(::String) }
1552
+ def name; end
1553
+
1554
+ # source://packwerk//lib/packwerk/package.rb#42
1555
+ sig { params(path: ::String).returns(T::Boolean) }
1556
+ def package_path?(path); end
1557
+
1558
+ # source://packwerk//lib/packwerk/package.rb#71
1559
+ sig { returns(T::Boolean) }
1560
+ def root?; end
1561
+
1562
+ # source://packwerk//lib/packwerk/package.rb#66
1563
+ sig { returns(::String) }
1564
+ def to_s; end
1565
+ end
1566
+
1567
+ # source://packwerk//lib/packwerk/package.rb#12
1568
+ Packwerk::Package::ROOT_PACKAGE_NAME = T.let(T.unsafe(nil), String)
1569
+
1570
+ # A set of {Packwerk::Package}s as well as methods to parse packages from the filesystem.
1571
+ #
1572
+ # source://packwerk//lib/packwerk/package_set.rb#11
1573
+ class Packwerk::PackageSet
1574
+ extend T::Generic
1575
+ include ::Enumerable
1576
+
1577
+ Elem = type_member { { fixed: Packwerk::Package } }
1578
+
1579
+ # source://packwerk//lib/packwerk/package_set.rb#79
1580
+ sig { params(packages: T::Array[::Packwerk::Package]).void }
1581
+ def initialize(packages); end
1582
+
1583
+ # source://packwerk//lib/packwerk/package_set.rb#88
1584
+ sig { override.params(blk: T.proc.params(arg0: ::Packwerk::Package).returns(T.untyped)).returns(T.untyped) }
1585
+ def each(&blk); end
1586
+
1587
+ # source://packwerk//lib/packwerk/package_set.rb#93
1588
+ sig { params(name: ::String).returns(T.nilable(::Packwerk::Package)) }
1589
+ def fetch(name); end
1590
+
1591
+ # source://packwerk//lib/packwerk/package_set.rb#98
1592
+ sig { params(file_path: T.any(::Pathname, ::String)).returns(::Packwerk::Package) }
1593
+ def package_from_path(file_path); end
1594
+
1595
+ # source://packwerk//lib/packwerk/package_set.rb#76
1596
+ sig { returns(T::Hash[::String, ::Packwerk::Package]) }
1597
+ def packages; end
1598
+
1599
+ class << self
1600
+ # source://packwerk//lib/packwerk/package_set.rb#24
1601
+ sig do
1602
+ params(
1603
+ root_path: ::String,
1604
+ package_pathspec: T.nilable(T.any(::String, T::Array[::String]))
1605
+ ).returns(Packwerk::PackageSet)
1606
+ end
1607
+ def load_all_from(root_path, package_pathspec: T.unsafe(nil)); end
1608
+
1609
+ # source://packwerk//lib/packwerk/package_set.rb#44
1610
+ sig do
1611
+ params(
1612
+ root_path: ::String,
1613
+ package_pathspec: T.any(::String, T::Array[::String]),
1614
+ exclude_pathspec: T.nilable(T.any(::String, T::Array[::String]))
1615
+ ).returns(T::Array[::Pathname])
1616
+ end
1617
+ def package_paths(root_path, package_pathspec, exclude_pathspec = T.unsafe(nil)); end
1618
+
1619
+ private
1620
+
1621
+ # source://packwerk//lib/packwerk/package_set.rb#61
1622
+ sig { params(packages: T::Array[::Packwerk::Package]).void }
1623
+ def create_root_package_if_none_in(packages); end
1624
+
1625
+ # source://packwerk//lib/packwerk/package_set.rb#68
1626
+ sig { params(globs: T::Array[::String], path: ::Pathname).returns(T::Boolean) }
1627
+ def exclude_path?(globs, path); end
1628
+ end
1629
+ end
1630
+
1631
+ # source://packwerk//lib/packwerk/package_set.rb#18
1632
+ Packwerk::PackageSet::PACKAGE_CONFIG_FILENAME = T.let(T.unsafe(nil), String)
1633
+
1634
+ # source://packwerk//lib/packwerk/package_todo.rb#7
1635
+ class Packwerk::PackageTodo
1636
+ # source://packwerk//lib/packwerk/package_todo.rb#19
1637
+ sig { params(package: ::Packwerk::Package, path: ::String).void }
1638
+ def initialize(package, path); end
1639
+
1640
+ # source://packwerk//lib/packwerk/package_todo.rb#43
1641
+ sig { params(reference: ::Packwerk::Reference, violation_type: ::String).returns(T::Boolean) }
1642
+ def add_entries(reference, violation_type); end
1643
+
1644
+ # source://packwerk//lib/packwerk/package_todo.rb#97
1645
+ sig { void }
1646
+ def delete_if_exists; end
1647
+
1648
+ # source://packwerk//lib/packwerk/package_todo.rb#75
1649
+ sig { void }
1650
+ def dump; end
1651
+
1652
+ # source://packwerk//lib/packwerk/package_todo.rb#30
1653
+ sig { params(reference: ::Packwerk::Reference, violation_type: ::String).returns(T::Boolean) }
1654
+ def listed?(reference, violation_type:); end
1655
+
1656
+ # source://packwerk//lib/packwerk/package_todo.rb#58
1657
+ sig { params(for_files: T::Set[::String]).returns(T::Boolean) }
1658
+ def stale_violations?(for_files); end
1659
+
1660
+ private
1661
+
1662
+ # source://packwerk//lib/packwerk/package_todo.rb#107
1663
+ sig { params(package: ::String).returns(T::Array[::String]) }
1664
+ def deleted_files_for(package); end
1665
+
1666
+ # source://packwerk//lib/packwerk/package_todo.rb#171
1667
+ sig { params(path: ::String).returns(T::Hash[::String, T::Hash[::String, T::Hash[::String, T::Array[::String]]]]) }
1668
+ def load_yaml_file(path); end
1669
+
1670
+ # source://packwerk//lib/packwerk/package_todo.rb#104
1671
+ sig { returns(T::Hash[::String, T::Hash[::String, T::Hash[::String, T::Array[::String]]]]) }
1672
+ def new_entries; end
1673
+
1674
+ # source://packwerk//lib/packwerk/package_todo.rb#166
1675
+ sig { returns(T::Hash[::String, T::Hash[::String, T::Hash[::String, T::Array[::String]]]]) }
1676
+ def old_entries; end
1677
+
1678
+ # source://packwerk//lib/packwerk/package_todo.rb#136
1679
+ sig do
1680
+ params(
1681
+ package_violations: T::Hash[::String, T::Hash[::String, T::Array[::String]]],
1682
+ files: T::Set[::String]
1683
+ ).returns(T::Hash[::String, T::Hash[::String, T::Array[::String]]])
1684
+ end
1685
+ def package_violations_for(package_violations, files:); end
1686
+
1687
+ # source://packwerk//lib/packwerk/package_todo.rb#153
1688
+ sig { returns(T::Hash[::String, T::Hash[::String, T::Hash[::String, T::Array[::String]]]]) }
1689
+ def prepare_entries_for_dump; end
1690
+
1691
+ # source://packwerk//lib/packwerk/package_todo.rb#114
1692
+ sig do
1693
+ params(
1694
+ package: ::String,
1695
+ violations: T::Hash[::String, T::Hash[::String, T::Array[::String]]]
1696
+ ).returns(T::Boolean)
1697
+ end
1698
+ def stale_violation_for_package?(package, violations:); end
1699
+ end
1700
+
1701
+ # source://packwerk//lib/packwerk/package_todo.rb#11
1702
+ Packwerk::PackageTodo::ConstantName = T.type_alias { ::String }
1703
+
1704
+ # source://packwerk//lib/packwerk/package_todo.rb#14
1705
+ Packwerk::PackageTodo::Entries = T.type_alias { T::Hash[::String, T::Hash[::String, T::Hash[::String, T::Array[::String]]]] }
1706
+
1707
+ # source://packwerk//lib/packwerk/package_todo.rb#13
1708
+ Packwerk::PackageTodo::Entry = T.type_alias { T::Hash[::String, T::Hash[::String, T::Array[::String]]] }
1709
+
1710
+ # source://packwerk//lib/packwerk/package_todo.rb#12
1711
+ Packwerk::PackageTodo::FilePath = T.type_alias { ::String }
1712
+
1713
+ # source://packwerk//lib/packwerk/package_todo.rb#10
1714
+ Packwerk::PackageTodo::PackageName = T.type_alias { ::String }
1715
+
1716
+ # source://packwerk//lib/packwerk/parse_run.rb#7
1717
+ class Packwerk::ParseRun
1718
+ # source://packwerk//lib/packwerk/parse_run.rb#20
1719
+ sig { params(relative_file_set: T::Set[::String], parallel: T::Boolean).void }
1720
+ def initialize(relative_file_set:, parallel:); end
1721
+
1722
+ # source://packwerk//lib/packwerk/parse_run.rb#34
1723
+ sig do
1724
+ params(
1725
+ run_context: ::Packwerk::RunContext,
1726
+ on_interrupt: T.nilable(T.proc.void),
1727
+ block: T.nilable(T.proc.params(offenses: T::Array[::Packwerk::Offense]).void)
1728
+ ).returns(T::Array[::Packwerk::Offense])
1729
+ end
1730
+ def find_offenses(run_context, on_interrupt: T.unsafe(nil), &block); end
1731
+
1732
+ private
1733
+
1734
+ # source://packwerk//lib/packwerk/parse_run.rb#54
1735
+ sig do
1736
+ params(
1737
+ run_context: ::Packwerk::RunContext,
1738
+ block: T.nilable(T.proc.params(offenses: T::Array[::Packwerk::Offense]).void)
1739
+ ).returns(T.proc.params(path: ::String).returns(T::Array[::Packwerk::Offense]))
1740
+ end
1741
+ def process_file_proc(run_context, &block); end
1742
+
1743
+ # source://packwerk//lib/packwerk/parse_run.rb#72
1744
+ sig do
1745
+ params(
1746
+ on_interrupt: T.nilable(T.proc.void),
1747
+ block: T.proc.params(path: ::String).returns(T::Array[::Packwerk::Offense])
1748
+ ).returns(T::Array[::Packwerk::Offense])
1749
+ end
1750
+ def serial_find_offenses(on_interrupt: T.unsafe(nil), &block); end
1751
+ end
1752
+
1753
+ # source://packwerk//lib/packwerk/parse_run.rb#10
1754
+ Packwerk::ParseRun::ProcessFileProc = T.type_alias { T.proc.params(path: ::String).returns(T::Array[::Packwerk::Offense]) }
1755
+
1756
+ # A collection of constant definitions parsed from an Abstract Syntax Tree (AST).
1757
+ #
1758
+ # source://packwerk//lib/packwerk/parsed_constant_definitions.rb#8
1759
+ class Packwerk::ParsedConstantDefinitions
1760
+ # source://packwerk//lib/packwerk/parsed_constant_definitions.rb#30
1761
+ sig { params(root_node: T.nilable(::AST::Node)).void }
1762
+ def initialize(root_node:); end
1763
+
1764
+ # source://packwerk//lib/packwerk/parsed_constant_definitions.rb#43
1765
+ sig do
1766
+ params(
1767
+ constant_name: ::String,
1768
+ location: T.nilable(::Packwerk::Node::Location),
1769
+ namespace_path: T::Array[::String]
1770
+ ).returns(T::Boolean)
1771
+ end
1772
+ def local_reference?(constant_name, location: T.unsafe(nil), namespace_path: T.unsafe(nil)); end
1773
+
1774
+ private
1775
+
1776
+ # source://packwerk//lib/packwerk/parsed_constant_definitions.rb#79
1777
+ sig do
1778
+ params(
1779
+ constant_name: ::String,
1780
+ current_namespace_path: T::Array[T.nilable(::String)],
1781
+ location: T.nilable(::Packwerk::Node::Location)
1782
+ ).void
1783
+ end
1784
+ def add_definition(constant_name, current_namespace_path, location); end
1785
+
1786
+ # source://packwerk//lib/packwerk/parsed_constant_definitions.rb#55
1787
+ sig { params(node: ::AST::Node, current_namespace_path: T::Array[T.nilable(::String)]).void }
1788
+ def collect_local_definitions_from_root(node, current_namespace_path = T.unsafe(nil)); end
1789
+
1790
+ class << self
1791
+ # What fully qualified constants can this constant refer to in this context?
1792
+ #
1793
+ # source://packwerk//lib/packwerk/parsed_constant_definitions.rb#16
1794
+ sig { params(constant_name: ::String, namespace_path: T::Array[T.nilable(::String)]).returns(T::Array[::String]) }
1795
+ def reference_qualifications(constant_name, namespace_path:); end
1796
+ end
1797
+ end
1798
+
1799
+ # source://packwerk//lib/packwerk/parsers.rb#5
1800
+ module Packwerk::Parsers; end
1801
+
1802
+ # source://packwerk//lib/packwerk/parsers/erb.rb#11
1803
+ class Packwerk::Parsers::Erb
1804
+ include ::Packwerk::FileParser
1805
+
1806
+ # source://packwerk//lib/packwerk/parsers/erb.rb#20
1807
+ sig { params(parser_class: T.untyped, ruby_parser: ::Packwerk::Parsers::Ruby).void }
1808
+ def initialize(parser_class: T.unsafe(nil), ruby_parser: T.unsafe(nil)); end
1809
+
1810
+ # source://packwerk//lib/packwerk/parsers/erb.rb#26
1811
+ sig { override.params(io: T.any(::IO, ::StringIO), file_path: ::String).returns(T.untyped) }
1812
+ def call(io:, file_path: T.unsafe(nil)); end
1813
+
1814
+ # source://packwerk//lib/packwerk/parsers/erb.rb#45
1815
+ sig { override.params(path: ::String).returns(T::Boolean) }
1816
+ def match?(path:); end
1817
+
1818
+ # source://packwerk//lib/packwerk/parsers/erb.rb#33
1819
+ sig { params(buffer: ::Parser::Source::Buffer, file_path: ::String).returns(T.nilable(::AST::Node)) }
1820
+ def parse_buffer(buffer, file_path:); end
1821
+
1822
+ private
1823
+
1824
+ # @yield [node]
1825
+ #
1826
+ # source://packwerk//lib/packwerk/parsers/erb.rb#79
1827
+ sig do
1828
+ params(
1829
+ node: T.nilable(T.any(::AST::Node, ::String)),
1830
+ block: T.nilable(T.proc.params(arg0: ::AST::Node).void)
1831
+ ).returns(T.nilable(T.any(T::Array[::String], T::Enumerator[::AST::Node])))
1832
+ end
1833
+ def code_nodes(node, &block); end
1834
+
1835
+ # source://packwerk//lib/packwerk/parsers/erb.rb#57
1836
+ sig { params(erb_ast: T.all(::AST::Node, ::Object), file_path: ::String).returns(T.nilable(::AST::Node)) }
1837
+ def to_ruby_ast(erb_ast, file_path); end
1838
+ end
1839
+
1840
+ # source://packwerk//lib/packwerk/parsers/erb.rb#16
1841
+ Packwerk::Parsers::Erb::ERB_REGEX = T.let(T.unsafe(nil), Regexp)
1842
+
1843
+ # source://packwerk//lib/packwerk/parsers/factory.rb#8
1844
+ class Packwerk::Parsers::Factory
1845
+ include ::Singleton
1846
+ extend ::Singleton::SingletonClassMethods
1847
+
1848
+ # source://packwerk//lib/packwerk/parsers/factory.rb#13
1849
+ sig { params(path: ::String).returns(T::Array[::Packwerk::FileParser]) }
1850
+ def for_path(path); end
1851
+
1852
+ class << self
1853
+ private
1854
+
1855
+ def allocate; end
1856
+ def new(*_arg0); end
1857
+ end
1858
+ end
1859
+
1860
+ # source://packwerk//lib/packwerk/parsers.rb#13
1861
+ class Packwerk::Parsers::ParseError < ::StandardError
1862
+ # source://packwerk//lib/packwerk/parsers.rb#20
1863
+ sig { params(result: ::Packwerk::Parsers::ParseResult).void }
1864
+ def initialize(result); end
1865
+
1866
+ # source://packwerk//lib/packwerk/parsers.rb#17
1867
+ sig { returns(::Packwerk::Parsers::ParseResult) }
1868
+ def result; end
1869
+ end
1870
+
1871
+ # source://packwerk//lib/packwerk/parsers.rb#11
1872
+ class Packwerk::Parsers::ParseResult < ::Packwerk::Offense; end
1873
+
1874
+ # source://packwerk//lib/packwerk/parsers/ruby.rb#9
1875
+ class Packwerk::Parsers::Ruby
1876
+ include ::Packwerk::FileParser
1877
+
1878
+ # source://packwerk//lib/packwerk/parsers/ruby.rb#42
1879
+ sig { params(parser_class: T.untyped).void }
1880
+ def initialize(parser_class: T.unsafe(nil)); end
1881
+
1882
+ # source://packwerk//lib/packwerk/parsers/ruby.rb#48
1883
+ sig { override.params(io: T.any(::IO, ::StringIO), file_path: ::String).returns(T.nilable(::Parser::AST::Node)) }
1884
+ def call(io:, file_path: T.unsafe(nil)); end
1885
+
1886
+ # source://packwerk//lib/packwerk/parsers/ruby.rb#62
1887
+ sig { override.params(path: ::String).returns(T::Boolean) }
1888
+ def match?(path:); end
1889
+ end
1890
+
1891
+ # source://packwerk//lib/packwerk/parsers/ruby.rb#14
1892
+ Packwerk::Parsers::Ruby::RUBY_REGEX = T.let(T.unsafe(nil), Regexp)
1893
+
1894
+ # source://packwerk//lib/packwerk/parsers/ruby.rb#22
1895
+ class Packwerk::Parsers::Ruby::RaiseExceptionsParser < ::Parser::Ruby32
1896
+ # source://packwerk//lib/packwerk/parsers/ruby.rb#26
1897
+ sig { params(builder: T.untyped).void }
1898
+ def initialize(builder); end
1899
+ end
1900
+
1901
+ # source://packwerk//lib/packwerk/parsers/ruby.rb#32
1902
+ class Packwerk::Parsers::Ruby::TolerateInvalidUtf8Builder < ::Parser::Builders::Default
1903
+ # source://packwerk//lib/packwerk/parsers/ruby.rb#36
1904
+ sig { params(token: T.untyped).returns(T.untyped) }
1905
+ def string_value(token); end
1906
+ end
1907
+
1908
+ # source://packwerk//lib/packwerk/package_set.rb#8
1909
+ Packwerk::PathSpec = T.type_alias { T.any(::String, T::Array[::String]) }
1910
+
1911
+ # A reference from a file in one package to a constant that may be defined in a different package.
1912
+ #
1913
+ # source://packwerk//lib/packwerk/reference.rb#6
1914
+ class Packwerk::Reference < ::Struct
1915
+ # Returns the value of attribute constant
1916
+ #
1917
+ # @return [Object] the current value of constant
1918
+ def constant; end
1919
+
1920
+ # Sets the attribute constant
1921
+ #
1922
+ # @param value [Object] the value to set the attribute constant to.
1923
+ # @return [Object] the newly set value
1924
+ def constant=(_); end
1925
+
1926
+ # Returns the value of attribute package
1927
+ #
1928
+ # @return [Object] the current value of package
1929
+ def package; end
1930
+
1931
+ # Sets the attribute package
1932
+ #
1933
+ # @param value [Object] the value to set the attribute package to.
1934
+ # @return [Object] the newly set value
1935
+ def package=(_); end
1936
+
1937
+ # Returns the value of attribute relative_path
1938
+ #
1939
+ # @return [Object] the current value of relative_path
1940
+ def relative_path; end
1941
+
1942
+ # Sets the attribute relative_path
1943
+ #
1944
+ # @param value [Object] the value to set the attribute relative_path to.
1945
+ # @return [Object] the newly set value
1946
+ def relative_path=(_); end
1947
+
1948
+ # Returns the value of attribute source_location
1949
+ #
1950
+ # @return [Object] the current value of source_location
1951
+ def source_location; end
1952
+
1953
+ # Sets the attribute source_location
1954
+ #
1955
+ # @param value [Object] the value to set the attribute source_location to.
1956
+ # @return [Object] the newly set value
1957
+ def source_location=(_); end
1958
+
1959
+ class << self
1960
+ def [](*_arg0); end
1961
+ def inspect; end
1962
+ def keyword_init?; end
1963
+ def members; end
1964
+ def new(*_arg0); end
1965
+ end
1966
+ end
1967
+
1968
+ # source://packwerk//lib/packwerk.rb#88
1969
+ module Packwerk::ReferenceChecking
1970
+ extend ::ActiveSupport::Autoload
1971
+ end
1972
+
1973
+ # source://packwerk//lib/packwerk.rb#93
1974
+ module Packwerk::ReferenceChecking::Checkers
1975
+ extend ::ActiveSupport::Autoload
1976
+ end
1977
+
1978
+ # Checks whether a given reference conforms to the configured graph of dependencies.
1979
+ #
1980
+ # source://packwerk//lib/packwerk/reference_checking/checkers/dependency_checker.rb#8
1981
+ class Packwerk::ReferenceChecking::Checkers::DependencyChecker
1982
+ include ::Packwerk::Checker
1983
+
1984
+ # source://packwerk//lib/packwerk/reference_checking/checkers/dependency_checker.rb#24
1985
+ sig { override.params(reference: ::Packwerk::Reference).returns(T::Boolean) }
1986
+ def invalid_reference?(reference); end
1987
+
1988
+ # source://packwerk//lib/packwerk/reference_checking/checkers/dependency_checker.rb#36
1989
+ sig { override.params(reference: ::Packwerk::Reference).returns(::String) }
1990
+ def message(reference); end
1991
+
1992
+ # source://packwerk//lib/packwerk/reference_checking/checkers/dependency_checker.rb#51
1993
+ sig { override.params(listed_offense: ::Packwerk::ReferenceOffense).returns(T::Boolean) }
1994
+ def strict_mode_violation?(listed_offense); end
1995
+
1996
+ # source://packwerk//lib/packwerk/reference_checking/checkers/dependency_checker.rb#15
1997
+ sig { override.returns(::String) }
1998
+ def violation_type; end
1999
+
2000
+ private
2001
+
2002
+ # source://packwerk//lib/packwerk/reference_checking/checkers/dependency_checker.rb#59
2003
+ sig { params(reference: ::Packwerk::Reference).returns(::String) }
2004
+ def standard_help_message(reference); end
2005
+ end
2006
+
2007
+ # source://packwerk//lib/packwerk/reference_checking/checkers/dependency_checker.rb#12
2008
+ Packwerk::ReferenceChecking::Checkers::DependencyChecker::VIOLATION_TYPE = T.let(T.unsafe(nil), String)
2009
+
2010
+ # source://packwerk//lib/packwerk/reference_checking/reference_checker.rb#6
2011
+ class Packwerk::ReferenceChecking::ReferenceChecker
2012
+ # source://packwerk//lib/packwerk/reference_checking/reference_checker.rb#10
2013
+ sig { params(checkers: T::Array[::Packwerk::Checker]).void }
2014
+ def initialize(checkers); end
2015
+
2016
+ # source://packwerk//lib/packwerk/reference_checking/reference_checker.rb#19
2017
+ sig { params(reference: ::Packwerk::Reference).returns(T::Array[::Packwerk::Offense]) }
2018
+ def call(reference); end
2019
+ end
2020
+
2021
+ # Extracts a possible constant reference from a given AST node.
2022
+ #
2023
+ # source://packwerk//lib/packwerk/reference_extractor.rb#6
2024
+ class Packwerk::ReferenceExtractor
2025
+ # source://packwerk//lib/packwerk/reference_extractor.rb#59
2026
+ sig do
2027
+ params(
2028
+ constant_name_inspectors: T::Array[::Packwerk::ConstantNameInspector],
2029
+ root_node: ::AST::Node,
2030
+ root_path: ::String
2031
+ ).void
2032
+ end
2033
+ def initialize(constant_name_inspectors:, root_node:, root_path:); end
2034
+
2035
+ # source://packwerk//lib/packwerk/reference_extractor.rb#79
2036
+ sig do
2037
+ params(
2038
+ node: ::Parser::AST::Node,
2039
+ ancestors: T::Array[::Parser::AST::Node],
2040
+ relative_file: ::String
2041
+ ).returns(T.nilable(::Packwerk::UnresolvedReference))
2042
+ end
2043
+ def reference_from_node(node, ancestors:, relative_file:); end
2044
+
2045
+ private
2046
+
2047
+ # source://packwerk//lib/packwerk/reference_extractor.rb#130
2048
+ sig do
2049
+ params(
2050
+ constant_name: ::String,
2051
+ name_location: T.nilable(::Packwerk::Node::Location),
2052
+ namespace_path: T::Array[::String]
2053
+ ).returns(T::Boolean)
2054
+ end
2055
+ def local_reference?(constant_name, name_location, namespace_path); end
2056
+
2057
+ # source://packwerk//lib/packwerk/reference_extractor.rb#108
2058
+ sig do
2059
+ params(
2060
+ constant_name: ::String,
2061
+ node: ::Parser::AST::Node,
2062
+ ancestors: T::Array[::Parser::AST::Node],
2063
+ relative_file: ::String
2064
+ ).returns(T.nilable(::Packwerk::UnresolvedReference))
2065
+ end
2066
+ def reference_from_constant(constant_name, node:, ancestors:, relative_file:); end
2067
+
2068
+ class << self
2069
+ # source://packwerk//lib/packwerk/reference_extractor.rb#18
2070
+ sig do
2071
+ params(
2072
+ unresolved_references: T::Array[::Packwerk::UnresolvedReference],
2073
+ context_provider: ::Packwerk::ConstantDiscovery
2074
+ ).returns(T::Array[::Packwerk::Reference])
2075
+ end
2076
+ def get_fully_qualified_references_from(unresolved_references, context_provider); end
2077
+ end
2078
+ end
2079
+
2080
+ # An offense related to a {Packwerk::Reference}.
2081
+ #
2082
+ # source://packwerk//lib/packwerk/reference_offense.rb#6
2083
+ class Packwerk::ReferenceOffense < ::Packwerk::Offense
2084
+ # source://packwerk//lib/packwerk/reference_offense.rb#25
2085
+ sig do
2086
+ params(
2087
+ reference: ::Packwerk::Reference,
2088
+ violation_type: ::String,
2089
+ message: ::String,
2090
+ location: T.nilable(::Packwerk::Node::Location)
2091
+ ).void
2092
+ end
2093
+ def initialize(reference:, violation_type:, message:, location: T.unsafe(nil)); end
2094
+
2095
+ # source://packwerk//lib/packwerk/reference_offense.rb#11
2096
+ sig { returns(::Packwerk::Reference) }
2097
+ def reference; end
2098
+
2099
+ # source://packwerk//lib/packwerk/reference_offense.rb#14
2100
+ sig { returns(::String) }
2101
+ def violation_type; end
2102
+ end
2103
+
2104
+ # Holds the context of a Packwerk run across multiple files.
2105
+ #
2106
+ # source://packwerk//lib/packwerk/run_context.rb#8
2107
+ class Packwerk::RunContext
2108
+ # source://packwerk//lib/packwerk/run_context.rb#46
2109
+ sig do
2110
+ params(
2111
+ root_path: ::String,
2112
+ load_paths: T::Hash[::String, ::Module],
2113
+ inflector: T.class_of(ActiveSupport::Inflector),
2114
+ cache_directory: ::Pathname,
2115
+ config_path: T.nilable(::String),
2116
+ package_paths: T.nilable(T.any(::String, T::Array[::String])),
2117
+ custom_associations: T.any(T::Array[::Symbol], T::Set[::Symbol]),
2118
+ checkers: T::Array[::Packwerk::Checker],
2119
+ cache_enabled: T::Boolean
2120
+ ).void
2121
+ end
2122
+ def initialize(root_path:, load_paths:, inflector:, cache_directory:, config_path: T.unsafe(nil), package_paths: T.unsafe(nil), custom_associations: T.unsafe(nil), checkers: T.unsafe(nil), cache_enabled: T.unsafe(nil)); end
2123
+
2124
+ # source://packwerk//lib/packwerk/run_context.rb#90
2125
+ sig { returns(Packwerk::PackageSet) }
2126
+ def package_set; end
2127
+
2128
+ # source://packwerk//lib/packwerk/run_context.rb#77
2129
+ sig { params(relative_file: ::String).returns(T::Array[::Packwerk::Offense]) }
2130
+ def process_file(relative_file:); end
2131
+
2132
+ private
2133
+
2134
+ # source://packwerk//lib/packwerk/run_context.rb#128
2135
+ sig { returns(T::Array[::Packwerk::ConstantNameInspector]) }
2136
+ def constant_name_inspectors; end
2137
+
2138
+ # source://packwerk//lib/packwerk/run_context.rb#111
2139
+ sig { returns(::Packwerk::ConstantDiscovery) }
2140
+ def context_provider; end
2141
+
2142
+ # source://packwerk//lib/packwerk/run_context.rb#97
2143
+ sig { returns(::Packwerk::FileProcessor) }
2144
+ def file_processor; end
2145
+
2146
+ # source://packwerk//lib/packwerk/run_context.rb#102
2147
+ sig { returns(::Packwerk::NodeProcessorFactory) }
2148
+ def node_processor_factory; end
2149
+
2150
+ # source://packwerk//lib/packwerk/run_context.rb#119
2151
+ sig { returns(::ConstantResolver) }
2152
+ def resolver; end
2153
+
2154
+ class << self
2155
+ # source://packwerk//lib/packwerk/run_context.rb#17
2156
+ sig { params(configuration: ::Packwerk::Configuration).returns(::Packwerk::RunContext) }
2157
+ def from_configuration(configuration); end
2158
+ end
2159
+ end
2160
+
2161
+ # An unresolved reference from a file in one package to a constant that may be defined in a different package.
2162
+ # Unresolved means that we know how it's referred to in the file,
2163
+ # and we have enough context on that reference to figure out the fully qualified reference such that we
2164
+ # can produce a Reference in a separate pass. However, we have not yet resolved it to its fully qualified version.
2165
+ #
2166
+ # source://packwerk//lib/packwerk/unresolved_reference.rb#9
2167
+ class Packwerk::UnresolvedReference < ::Struct
2168
+ # Returns the value of attribute constant_name
2169
+ #
2170
+ # @return [Object] the current value of constant_name
2171
+ def constant_name; end
2172
+
2173
+ # Sets the attribute constant_name
2174
+ #
2175
+ # @param value [Object] the value to set the attribute constant_name to.
2176
+ # @return [Object] the newly set value
2177
+ def constant_name=(_); end
2178
+
2179
+ # Returns the value of attribute namespace_path
2180
+ #
2181
+ # @return [Object] the current value of namespace_path
2182
+ def namespace_path; end
2183
+
2184
+ # Sets the attribute namespace_path
2185
+ #
2186
+ # @param value [Object] the value to set the attribute namespace_path to.
2187
+ # @return [Object] the newly set value
2188
+ def namespace_path=(_); end
2189
+
2190
+ # Returns the value of attribute relative_path
2191
+ #
2192
+ # @return [Object] the current value of relative_path
2193
+ def relative_path; end
2194
+
2195
+ # Sets the attribute relative_path
2196
+ #
2197
+ # @param value [Object] the value to set the attribute relative_path to.
2198
+ # @return [Object] the newly set value
2199
+ def relative_path=(_); end
2200
+
2201
+ # Returns the value of attribute source_location
2202
+ #
2203
+ # @return [Object] the current value of source_location
2204
+ def source_location; end
2205
+
2206
+ # Sets the attribute source_location
2207
+ #
2208
+ # @param value [Object] the value to set the attribute source_location to.
2209
+ # @return [Object] the newly set value
2210
+ def source_location=(_); end
2211
+
2212
+ class << self
2213
+ def [](*_arg0); end
2214
+ def inspect; end
2215
+ def keyword_init?; end
2216
+ def members; end
2217
+ def new(*_arg0); end
2218
+ end
2219
+ end
2220
+
2221
+ # source://packwerk//lib/packwerk/version.rb#5
2222
+ Packwerk::VERSION = T.let(T.unsafe(nil), String)
2223
+
2224
+ # @abstract Subclasses must implement the `abstract` methods below.
2225
+ #
2226
+ # source://packwerk//lib/packwerk/validator.rb#9
2227
+ module Packwerk::Validator
2228
+ extend ::ActiveSupport::Autoload
2229
+
2230
+ abstract!
2231
+
2232
+ # @abstract
2233
+ #
2234
+ # source://packwerk//lib/packwerk/validator.rb#50
2235
+ sig do
2236
+ abstract
2237
+ .params(
2238
+ package_set: Packwerk::PackageSet,
2239
+ configuration: ::Packwerk::Configuration
2240
+ ).returns(::Packwerk::Validator::Result)
2241
+ end
2242
+ def call(package_set, configuration); end
2243
+
2244
+ # source://packwerk//lib/packwerk/validator.rb#81
2245
+ sig do
2246
+ params(
2247
+ results: T::Array[::Packwerk::Validator::Result],
2248
+ separator: ::String,
2249
+ before_errors: ::String,
2250
+ after_errors: ::String
2251
+ ).returns(::Packwerk::Validator::Result)
2252
+ end
2253
+ def merge_results(results, separator: T.unsafe(nil), before_errors: T.unsafe(nil), after_errors: T.unsafe(nil)); end
2254
+
2255
+ # source://packwerk//lib/packwerk/validator.rb#69
2256
+ sig { params(configuration: ::Packwerk::Configuration).returns(T.any(::String, T::Array[::String])) }
2257
+ def package_glob(configuration); end
2258
+
2259
+ # source://packwerk//lib/packwerk/validator.rb#62
2260
+ sig do
2261
+ params(
2262
+ configuration: ::Packwerk::Configuration,
2263
+ glob_pattern: T.nilable(T.any(::String, T::Array[::String]))
2264
+ ).returns(T::Array[::String])
2265
+ end
2266
+ def package_manifests(configuration, glob_pattern = T.unsafe(nil)); end
2267
+
2268
+ # source://packwerk//lib/packwerk/validator.rb#54
2269
+ sig { params(configuration: ::Packwerk::Configuration, setting: T.untyped).returns(T.untyped) }
2270
+ def package_manifests_settings_for(configuration, setting); end
2271
+
2272
+ # @abstract
2273
+ #
2274
+ # source://packwerk//lib/packwerk/validator.rb#46
2275
+ sig { abstract.returns(T::Array[::String]) }
2276
+ def permitted_keys; end
2277
+
2278
+ # source://packwerk//lib/packwerk/validator.rb#100
2279
+ sig { params(configuration: ::Packwerk::Configuration, path: ::String).returns(::Pathname) }
2280
+ def relative_path(configuration, path); end
2281
+
2282
+ class << self
2283
+ # source://packwerk//lib/packwerk/validator.rb#27
2284
+ sig { returns(T::Array[::Packwerk::Validator]) }
2285
+ def all; end
2286
+
2287
+ # source://packwerk//lib/packwerk/validator.rb#22
2288
+ sig { params(base: ::Class).void }
2289
+ def included(base); end
2290
+
2291
+ private
2292
+
2293
+ # source://packwerk//lib/packwerk/validator.rb#35
2294
+ sig { void }
2295
+ def load_defaults; end
2296
+
2297
+ # source://packwerk//lib/packwerk/validator.rb#40
2298
+ sig { returns(T::Array[::Class]) }
2299
+ def validators; end
2300
+ end
2301
+ end
2302
+
2303
+ # source://packwerk//lib/packwerk/validator/result.rb#6
2304
+ class Packwerk::Validator::Result < ::T::Struct
2305
+ const :ok, T::Boolean
2306
+ const :error_value, T.nilable(::String)
2307
+
2308
+ # source://packwerk//lib/packwerk/validator/result.rb#13
2309
+ sig { returns(T::Boolean) }
2310
+ def ok?; end
2311
+
2312
+ class << self
2313
+ # source://sorbet-runtime/0.5.11175/lib/types/struct.rb#13
2314
+ def inherited(s); end
2315
+ end
2316
+ end
2317
+
2318
+ # source://packwerk//lib/packwerk.rb#51
2319
+ module Packwerk::Validators
2320
+ extend ::ActiveSupport::Autoload
2321
+ end
2322
+
2323
+ # source://packwerk//lib/packwerk/validators/dependency_validator.rb#6
2324
+ class Packwerk::Validators::DependencyValidator
2325
+ include ::Packwerk::Validator
2326
+
2327
+ # source://packwerk//lib/packwerk/validators/dependency_validator.rb#13
2328
+ sig do
2329
+ override
2330
+ .params(
2331
+ package_set: Packwerk::PackageSet,
2332
+ configuration: ::Packwerk::Configuration
2333
+ ).returns(::Packwerk::Validator::Result)
2334
+ end
2335
+ def call(package_set, configuration); end
2336
+
2337
+ # source://packwerk//lib/packwerk/validators/dependency_validator.rb#24
2338
+ sig { override.returns(T::Array[::String]) }
2339
+ def permitted_keys; end
2340
+
2341
+ private
2342
+
2343
+ # Convert the cycles:
2344
+ #
2345
+ # [[a, b, c], [b, c]]
2346
+ #
2347
+ # to the string:
2348
+ #
2349
+ # ["a -> b -> c -> a", "b -> c -> b"]
2350
+ #
2351
+ # source://packwerk//lib/packwerk/validators/dependency_validator.rb#145
2352
+ sig { params(cycles: T.untyped).returns(T::Array[::String]) }
2353
+ def build_cycle_strings(cycles); end
2354
+
2355
+ # source://packwerk//lib/packwerk/validators/dependency_validator.rb#67
2356
+ sig { params(package_set: Packwerk::PackageSet).returns(::Packwerk::Validator::Result) }
2357
+ def check_acyclic_graph(package_set); end
2358
+
2359
+ # source://packwerk//lib/packwerk/validators/dependency_validator.rb#34
2360
+ sig { params(configuration: ::Packwerk::Configuration).returns(::Packwerk::Validator::Result) }
2361
+ def check_package_manifest_syntax(configuration); end
2362
+
2363
+ # source://packwerk//lib/packwerk/validators/dependency_validator.rb#93
2364
+ sig { params(configuration: ::Packwerk::Configuration).returns(::Packwerk::Validator::Result) }
2365
+ def check_valid_package_dependencies(configuration); end
2366
+
2367
+ # source://packwerk//lib/packwerk/validators/dependency_validator.rb#129
2368
+ sig { params(configuration: ::Packwerk::Configuration, path: T.untyped).returns(T::Boolean) }
2369
+ def invalid_package_path?(configuration, path); end
2370
+ end