danger-packwerk 0.14.0 → 0.14.2

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