danger-packwerk 0.10.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 312a8c57ba777586f14b9464935701ec657c74537f5811e0cdd4d9484f6f1964
4
- data.tar.gz: 6590f28585fc4e0b03c303fb968dfd8cb889348adf2aa2a71f9d901b9e8749d9
3
+ metadata.gz: 0f8b77fc9b24c94b59f84416ca3a564d4bc83b2e0cb0e33608aa4ed08dc2fc69
4
+ data.tar.gz: df82d0bf21d6702747060d5d4d3e1ae8a3ed39973abdede4db7490d4e77aa2cd
5
5
  SHA512:
6
- metadata.gz: ef0f83f1481c5e3362e03fd684dc8aa9a404cda136669b3146666cd1bb26dae15c3c0660033d9bbac52affd23a83005a218462223d623e97d8c73a6be563e2ba
7
- data.tar.gz: 8cb95942be98ed171a421abd6008ed052803b3ec8502291e04201c5226b53f9a00dbd683c76618b25f3da5883d62bce1e6a9cdfbbe1d1c925feed404a6849890
6
+ metadata.gz: ab8300d69b2b95d6ee14c451d5cb266b4bea7b99b9c2e1a9691877a660128b367df2a65b6231c131591e19964aa2f75a0cb0c88277fba67a7c69f84ed9022e97
7
+ data.tar.gz: 97692e72e269be921be02e80094403e56ed9175089395827fd5443babbdbe7a6ae4ce47f8b75b821571c54df36734423426271f32fe293867be44e3f152e7ded
@@ -56,7 +56,9 @@ module DangerPackwerk
56
56
  ''
57
57
  end
58
58
 
59
- sig { override.params(offense_collection: Packwerk::OffenseCollection, for_files: T::Set[String]).returns(String) }
59
+ # T.untyped should be Packwerk::OffenseCollection, but is currently private until
60
+ # https://github.com/Shopify/packwerk/pull/289 merges
61
+ sig { override.params(offense_collection: T.untyped, for_files: T::Set[String]).returns(String) }
60
62
  def show_stale_violations(offense_collection, for_files)
61
63
  ''
62
64
  end
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module DangerPackwerk
5
- VERSION = '0.10.0'
5
+ VERSION = '0.11.0'
6
6
  end
@@ -67,7 +67,7 @@ class Packwerk::ApplicationValidator
67
67
  .params(
68
68
  package_set: Packwerk::PackageSet,
69
69
  configuration: ::Packwerk::Configuration
70
- ).returns(::Packwerk::ApplicationValidator::Result)
70
+ ).returns(::Packwerk::Validator::Result)
71
71
  end
72
72
  def call(package_set, configuration); end
73
73
 
@@ -76,24 +76,24 @@ class Packwerk::ApplicationValidator
76
76
  params(
77
77
  package_set: Packwerk::PackageSet,
78
78
  configuration: ::Packwerk::Configuration
79
- ).returns(::Packwerk::ApplicationValidator::Result)
79
+ ).returns(::Packwerk::Validator::Result)
80
80
  end
81
81
  def check_all(package_set, configuration); end
82
82
 
83
83
  # source://packwerk//lib/packwerk/application_validator.rb#69
84
- sig { params(configuration: ::Packwerk::Configuration).returns(::Packwerk::ApplicationValidator::Result) }
84
+ sig { params(configuration: ::Packwerk::Configuration).returns(::Packwerk::Validator::Result) }
85
85
  def check_application_structure(configuration); end
86
86
 
87
87
  # source://packwerk//lib/packwerk/application_validator.rb#84
88
- sig { params(configuration: ::Packwerk::Configuration).returns(::Packwerk::ApplicationValidator::Result) }
88
+ sig { params(configuration: ::Packwerk::Configuration).returns(::Packwerk::Validator::Result) }
89
89
  def check_package_manifest_paths(configuration); end
90
90
 
91
91
  # source://packwerk//lib/packwerk/application_validator.rb#41
92
- sig { params(configuration: ::Packwerk::Configuration).returns(::Packwerk::ApplicationValidator::Result) }
92
+ sig { params(configuration: ::Packwerk::Configuration).returns(::Packwerk::Validator::Result) }
93
93
  def check_package_manifest_syntax(configuration); end
94
94
 
95
95
  # source://packwerk//lib/packwerk/application_validator.rb#105
96
- sig { params(configuration: ::Packwerk::Configuration).returns(::Packwerk::ApplicationValidator::Result) }
96
+ sig { params(configuration: ::Packwerk::Configuration).returns(::Packwerk::Validator::Result) }
97
97
  def check_root_package_exists(configuration); end
98
98
 
99
99
  # source://packwerk//lib/packwerk/application_validator.rb#34
@@ -111,21 +111,6 @@ class Packwerk::ApplicationValidator
111
111
  def relative_paths(configuration, paths); end
112
112
  end
113
113
 
114
- # source://packwerk//lib/packwerk/application_validator/result.rb#6
115
- class Packwerk::ApplicationValidator::Result < ::T::Struct
116
- const :ok, T::Boolean
117
- const :error_value, T.nilable(::String)
118
-
119
- # source://packwerk//lib/packwerk/application_validator/result.rb#13
120
- sig { returns(T::Boolean) }
121
- def ok?; end
122
-
123
- class << self
124
- # source://sorbet-runtime/0.5.10588/lib/types/struct.rb#13
125
- def inherited(s); end
126
- end
127
- end
128
-
129
114
  # Extracts the implicit constant reference from an active record association
130
115
  #
131
116
  # source://packwerk//lib/packwerk/association_inspector.rb#6
@@ -287,6 +272,8 @@ end
287
272
  #
288
273
  # source://packwerk//lib/packwerk/cli.rb#8
289
274
  class Packwerk::Cli
275
+ extend ::ActiveSupport::Autoload
276
+
290
277
  # source://packwerk//lib/packwerk/cli.rb#21
291
278
  sig do
292
279
  params(
@@ -327,19 +314,19 @@ class Packwerk::Cli
327
314
  sig { returns(T::Boolean) }
328
315
  def init; end
329
316
 
330
- # source://packwerk//lib/packwerk/cli.rb#174
331
- sig { params(result: ::Packwerk::ApplicationValidator::Result).void }
317
+ # source://packwerk//lib/packwerk/cli.rb#176
318
+ sig { params(result: ::Packwerk::Validator::Result).void }
332
319
  def list_validation_errors(result); end
333
320
 
334
321
  # source://packwerk//lib/packwerk/cli.rb#123
335
- sig { params(result: ::Packwerk::Result).returns(T::Boolean) }
322
+ sig { params(result: ::Packwerk::Cli::Result).returns(T::Boolean) }
336
323
  def output_result(result); end
337
324
 
338
- # source://packwerk//lib/packwerk/cli.rb#166
325
+ # source://packwerk//lib/packwerk/cli.rb#168
339
326
  sig { returns(Packwerk::PackageSet) }
340
327
  def package_set; end
341
328
 
342
- # source://packwerk//lib/packwerk/cli.rb#186
329
+ # source://packwerk//lib/packwerk/cli.rb#188
343
330
  sig { params(args: T::Array[::String]).returns(::Packwerk::ParseRun) }
344
331
  def parse_run(args); end
345
332
 
@@ -351,11 +338,22 @@ class Packwerk::Cli
351
338
  sig { params(_paths: T::Array[::String]).returns(T::Boolean) }
352
339
  def validate(_paths); end
353
340
 
354
- # source://packwerk//lib/packwerk/cli.rb#161
341
+ # source://packwerk//lib/packwerk/cli.rb#163
355
342
  sig { returns(::Packwerk::ApplicationValidator) }
356
343
  def validator; end
357
344
  end
358
345
 
346
+ # source://packwerk//lib/packwerk/cli/result.rb#6
347
+ class Packwerk::Cli::Result < ::T::Struct
348
+ const :message, ::String
349
+ const :status, T::Boolean
350
+
351
+ class << self
352
+ # source://sorbet-runtime/0.5.10588/lib/types/struct.rb#13
353
+ def inherited(s); end
354
+ end
355
+ end
356
+
359
357
  # source://packwerk//lib/packwerk/configuration.rb#8
360
358
  class Packwerk::Configuration
361
359
  # @return [Configuration] a new instance of Configuration
@@ -462,44 +460,8 @@ class Packwerk::ConstNodeInspector
462
460
  def root_constant?(parent); end
463
461
  end
464
462
 
465
- # Get information about unresolved constants without loading the application code.
466
- # Information gathered: Fully qualified name, path to file containing the definition, package,
467
- # and visibility (public/private to the package).
468
- #
469
- # The implementation makes a few assumptions about the code base:
470
- # - `Something::SomeOtherThing` is defined in a path of either `something/some_other_thing.rb` or `something.rb`,
471
- # relative to the load path. Rails' `zeitwerk` autoloader makes the same assumption.
472
- # - It is OK to not always infer the exact file defining the constant. For example, when a constant is inherited, we
473
- # have no way of inferring the file it is defined in. You could argue though that inheritance means that another
474
- # constant with the same name exists in the inheriting class, and this view is sufficient for all our use cases.
475
- #
476
- # source://packwerk//lib/packwerk/constant_discovery.rb#17
477
- class Packwerk::ConstantDiscovery
478
- # source://packwerk//lib/packwerk/constant_discovery.rb#27
479
- sig { params(constant_resolver: ::ConstantResolver, packages: Packwerk::PackageSet).void }
480
- def initialize(constant_resolver:, packages:); end
481
-
482
- # Analyze a constant via its name.
483
- # If the constant is unresolved, we need the current namespace path to correctly infer its full name
484
- #
485
- # source://packwerk//lib/packwerk/constant_discovery.rb#60
486
- sig do
487
- params(
488
- const_name: ::String,
489
- current_namespace_path: T.nilable(T::Array[::String])
490
- ).returns(T.nilable(::Packwerk::ConstantDiscovery::ConstantContext))
491
- end
492
- def context_for(const_name, current_namespace_path: T.unsafe(nil)); end
493
-
494
- # Get the package that owns a given file path.
495
- #
496
- # source://packwerk//lib/packwerk/constant_discovery.rb#43
497
- sig { params(path: ::String).returns(::Packwerk::Package) }
498
- def package_from_path(path); end
499
- end
500
-
501
- # source://packwerk//lib/packwerk/constant_discovery.rb#20
502
- class Packwerk::ConstantDiscovery::ConstantContext < ::Struct
463
+ # source://packwerk//lib/packwerk/constant_context.rb#9
464
+ class Packwerk::ConstantContext < ::Struct
503
465
  # Returns the value of attribute location
504
466
  #
505
467
  # @return [Object] the current value of location
@@ -510,7 +472,7 @@ class Packwerk::ConstantDiscovery::ConstantContext < ::Struct
510
472
  # @param value [Object] the value to set the attribute location to.
511
473
  # @return [Object] the newly set value
512
474
  #
513
- # source://packwerk//lib/packwerk/constant_discovery.rb#20
475
+ # source://packwerk//lib/packwerk/constant_context.rb#9
514
476
  def location=(_); end
515
477
 
516
478
  # Returns the value of attribute name
@@ -523,7 +485,7 @@ class Packwerk::ConstantDiscovery::ConstantContext < ::Struct
523
485
  # @param value [Object] the value to set the attribute name to.
524
486
  # @return [Object] the newly set value
525
487
  #
526
- # source://packwerk//lib/packwerk/constant_discovery.rb#20
488
+ # source://packwerk//lib/packwerk/constant_context.rb#9
527
489
  def name=(_); end
528
490
 
529
491
  # Returns the value of attribute package
@@ -536,7 +498,7 @@ class Packwerk::ConstantDiscovery::ConstantContext < ::Struct
536
498
  # @param value [Object] the value to set the attribute package to.
537
499
  # @return [Object] the newly set value
538
500
  #
539
- # source://packwerk//lib/packwerk/constant_discovery.rb#20
501
+ # source://packwerk//lib/packwerk/constant_context.rb#9
540
502
  def package=(_); end
541
503
 
542
504
  class << self
@@ -547,6 +509,42 @@ class Packwerk::ConstantDiscovery::ConstantContext < ::Struct
547
509
  end
548
510
  end
549
511
 
512
+ # Get information about unresolved constants without loading the application code.
513
+ # Information gathered: Fully qualified name, path to file containing the definition, package,
514
+ # and visibility (public/private to the package).
515
+ #
516
+ # The implementation makes a few assumptions about the code base:
517
+ # - `Something::SomeOtherThing` is defined in a path of either `something/some_other_thing.rb` or `something.rb`,
518
+ # relative to the load path. Rails' `zeitwerk` autoloader makes the same assumption.
519
+ # - It is OK to not always infer the exact file defining the constant. For example, when a constant is inherited, we
520
+ # have no way of inferring the file it is defined in. You could argue though that inheritance means that another
521
+ # constant with the same name exists in the inheriting class, and this view is sufficient for all our use cases.
522
+ #
523
+ # source://packwerk//lib/packwerk/constant_discovery.rb#17
524
+ class Packwerk::ConstantDiscovery
525
+ # source://packwerk//lib/packwerk/constant_discovery.rb#25
526
+ sig { params(constant_resolver: ::ConstantResolver, packages: Packwerk::PackageSet).void }
527
+ def initialize(constant_resolver:, packages:); end
528
+
529
+ # Analyze a constant via its name.
530
+ # If the constant is unresolved, we need the current namespace path to correctly infer its full name
531
+ #
532
+ # source://packwerk//lib/packwerk/constant_discovery.rb#58
533
+ sig do
534
+ params(
535
+ const_name: ::String,
536
+ current_namespace_path: T.nilable(T::Array[::String])
537
+ ).returns(T.nilable(::Packwerk::ConstantContext))
538
+ end
539
+ def context_for(const_name, current_namespace_path: T.unsafe(nil)); end
540
+
541
+ # Get the package that owns a given file path.
542
+ #
543
+ # source://packwerk//lib/packwerk/constant_discovery.rb#41
544
+ sig { params(path: ::String).returns(::Packwerk::Package) }
545
+ def package_from_path(path); end
546
+ end
547
+
550
548
  # An interface describing an object that can extract a constant name from an AST node.
551
549
  #
552
550
  # @abstract Subclasses must implement the `abstract` methods below.
@@ -694,24 +692,24 @@ end
694
692
  # source://packwerk//lib/packwerk/files_for_processing.rb#8
695
693
  Packwerk::FilesForProcessing::RelativeFileSet = T.type_alias { T::Set[::String] }
696
694
 
697
- # source://packwerk//lib/packwerk.rb#66
695
+ # source://packwerk//lib/packwerk.rb#51
698
696
  module Packwerk::Formatters
699
697
  extend ::ActiveSupport::Autoload
700
698
  end
701
699
 
702
- # source://packwerk//lib/packwerk/formatters/offenses_formatter.rb#6
703
- class Packwerk::Formatters::OffensesFormatter
700
+ # source://packwerk//lib/packwerk/formatters/default_offenses_formatter.rb#6
701
+ class Packwerk::Formatters::DefaultOffensesFormatter
704
702
  include ::Packwerk::OffensesFormatter
705
703
 
706
- # source://packwerk//lib/packwerk/formatters/offenses_formatter.rb#33
704
+ # source://packwerk//lib/packwerk/formatters/default_offenses_formatter.rb#33
707
705
  sig { override.returns(::String) }
708
706
  def identifier; end
709
707
 
710
- # source://packwerk//lib/packwerk/formatters/offenses_formatter.rb#14
708
+ # source://packwerk//lib/packwerk/formatters/default_offenses_formatter.rb#14
711
709
  sig { override.params(offenses: T::Array[T.nilable(::Packwerk::Offense)]).returns(::String) }
712
710
  def show_offenses(offenses); end
713
711
 
714
- # source://packwerk//lib/packwerk/formatters/offenses_formatter.rb#24
712
+ # source://packwerk//lib/packwerk/formatters/default_offenses_formatter.rb#24
715
713
  sig do
716
714
  override
717
715
  .params(
@@ -721,31 +719,31 @@ class Packwerk::Formatters::OffensesFormatter
721
719
  end
722
720
  def show_stale_violations(offense_collection, fileset); end
723
721
 
724
- # source://packwerk//lib/packwerk/formatters/offenses_formatter.rb#38
722
+ # source://packwerk//lib/packwerk/formatters/default_offenses_formatter.rb#38
725
723
  sig { override.params(strict_mode_violations: T::Array[::Packwerk::ReferenceOffense]).returns(::String) }
726
724
  def show_strict_mode_violations(strict_mode_violations); end
727
725
 
728
726
  private
729
727
 
730
- # source://packwerk//lib/packwerk/formatters/offenses_formatter.rb#54
728
+ # source://packwerk//lib/packwerk/formatters/default_offenses_formatter.rb#54
731
729
  sig { params(offense: ::Packwerk::ReferenceOffense).returns(::String) }
732
730
  def format_strict_mode_violation(offense); end
733
731
 
734
- # source://packwerk//lib/packwerk/formatters/offenses_formatter.rb#62
732
+ # source://packwerk//lib/packwerk/formatters/default_offenses_formatter.rb#62
735
733
  sig { params(offenses: T::Array[T.nilable(::Packwerk::Offense)]).returns(::String) }
736
734
  def offenses_list(offenses); end
737
735
 
738
- # source://packwerk//lib/packwerk/formatters/offenses_formatter.rb#70
736
+ # source://packwerk//lib/packwerk/formatters/default_offenses_formatter.rb#70
739
737
  sig { params(offenses: T::Array[T.nilable(::Packwerk::Offense)]).returns(::String) }
740
738
  def offenses_summary(offenses); end
741
739
 
742
- # source://packwerk//lib/packwerk/formatters/offenses_formatter.rb#49
740
+ # source://packwerk//lib/packwerk/formatters/default_offenses_formatter.rb#49
743
741
  sig { returns(::Packwerk::OutputStyle) }
744
742
  def style; end
745
743
  end
746
744
 
747
- # source://packwerk//lib/packwerk/formatters/offenses_formatter.rb#9
748
- Packwerk::Formatters::OffensesFormatter::IDENTIFIER = T.let(T.unsafe(nil), String)
745
+ # source://packwerk//lib/packwerk/formatters/default_offenses_formatter.rb#9
746
+ Packwerk::Formatters::DefaultOffensesFormatter::IDENTIFIER = T.let(T.unsafe(nil), String)
749
747
 
750
748
  # source://packwerk//lib/packwerk/formatters/progress_formatter.rb#8
751
749
  class Packwerk::Formatters::ProgressFormatter
@@ -753,58 +751,69 @@ class Packwerk::Formatters::ProgressFormatter
753
751
  sig { params(out: T.any(::IO, ::StringIO), style: ::Packwerk::OutputStyle).void }
754
752
  def initialize(out, style: T.unsafe(nil)); end
755
753
 
756
- # source://packwerk//lib/packwerk/formatters/progress_formatter.rb#39
754
+ # source://packwerk//lib/packwerk/formatters/progress_formatter.rb#44
755
+ sig { void }
757
756
  def interrupted; end
758
757
 
759
- # source://packwerk//lib/packwerk/formatters/progress_formatter.rb#35
758
+ # source://packwerk//lib/packwerk/formatters/progress_formatter.rb#39
759
+ sig { void }
760
760
  def mark_as_failed; end
761
761
 
762
- # source://packwerk//lib/packwerk/formatters/progress_formatter.rb#31
762
+ # source://packwerk//lib/packwerk/formatters/progress_formatter.rb#34
763
+ sig { void }
763
764
  def mark_as_inspected; end
764
765
 
765
- # source://packwerk//lib/packwerk/formatters/progress_formatter.rb#24
766
+ # source://packwerk//lib/packwerk/formatters/progress_formatter.rb#26
767
+ sig { params(target_files: T::Set[::String], block: T.proc.void).void }
766
768
  def started_inspection(target_files, &block); end
767
769
 
768
- # source://packwerk//lib/packwerk/formatters/progress_formatter.rb#17
770
+ # source://packwerk//lib/packwerk/formatters/progress_formatter.rb#18
771
+ sig { params(block: T.proc.void).void }
769
772
  def started_validation(&block); end
770
773
 
771
774
  private
772
775
 
773
- # source://packwerk//lib/packwerk/formatters/progress_formatter.rb#46
776
+ # source://packwerk//lib/packwerk/formatters/progress_formatter.rb#52
777
+ sig { params(execution_time: ::Float).void }
774
778
  def finished(execution_time); end
775
779
 
776
- # source://packwerk//lib/packwerk/formatters/progress_formatter.rb#55
780
+ # source://packwerk//lib/packwerk/formatters/progress_formatter.rb#63
781
+ sig { params(target_files: T::Set[::String]).void }
777
782
  def start_inspection(target_files); end
778
783
 
779
- # source://packwerk//lib/packwerk/formatters/progress_formatter.rb#51
784
+ # source://packwerk//lib/packwerk/formatters/progress_formatter.rb#58
785
+ sig { void }
780
786
  def start_validation; end
781
787
  end
782
788
 
783
- # source://packwerk//lib/packwerk.rb#72
789
+ # source://packwerk//lib/packwerk.rb#87
784
790
  module Packwerk::Generators
785
791
  extend ::ActiveSupport::Autoload
786
792
  end
787
793
 
788
794
  # source://packwerk//lib/packwerk/generators/configuration_file.rb#8
789
795
  class Packwerk::Generators::ConfigurationFile
790
- # source://packwerk//lib/packwerk/generators/configuration_file.rb#20
796
+ # source://packwerk//lib/packwerk/generators/configuration_file.rb#23
791
797
  sig { params(root: ::String, out: T.any(::IO, ::StringIO)).void }
792
798
  def initialize(root:, out: T.unsafe(nil)); end
793
799
 
794
- # source://packwerk//lib/packwerk/generators/configuration_file.rb#26
800
+ # source://packwerk//lib/packwerk/generators/configuration_file.rb#29
795
801
  sig { returns(T::Boolean) }
796
802
  def generate; end
797
803
 
798
804
  private
799
805
 
800
- # source://packwerk//lib/packwerk/generators/configuration_file.rb#43
806
+ # source://packwerk//lib/packwerk/generators/configuration_file.rb#47
807
+ sig { returns(::String) }
801
808
  def render; end
802
809
 
803
- # source://packwerk//lib/packwerk/generators/configuration_file.rb#47
810
+ # source://packwerk//lib/packwerk/generators/configuration_file.rb#52
811
+ sig { returns(::String) }
804
812
  def template; end
805
813
 
806
814
  class << self
807
- # source://packwerk//lib/packwerk/generators/configuration_file.rb#14
815
+ # source://packwerk//lib/packwerk/generators/configuration_file.rb#17
816
+ sig { params(root: ::String, out: T.any(::IO, ::StringIO)).returns(T::Boolean) }
808
817
  def generate(root:, out:); end
809
818
  end
810
819
  end
@@ -814,17 +823,17 @@ Packwerk::Generators::ConfigurationFile::CONFIGURATION_TEMPLATE_FILE_PATH = T.le
814
823
 
815
824
  # source://packwerk//lib/packwerk/generators/root_package.rb#6
816
825
  class Packwerk::Generators::RootPackage
817
- # @return [RootPackage] a new instance of RootPackage
818
- #
819
- # source://packwerk//lib/packwerk/generators/root_package.rb#15
826
+ # source://packwerk//lib/packwerk/generators/root_package.rb#19
827
+ sig { params(root: ::String, out: T.any(::IO, ::StringIO)).void }
820
828
  def initialize(root:, out: T.unsafe(nil)); end
821
829
 
822
- # source://packwerk//lib/packwerk/generators/root_package.rb#21
830
+ # source://packwerk//lib/packwerk/generators/root_package.rb#25
823
831
  sig { returns(T::Boolean) }
824
832
  def generate; end
825
833
 
826
834
  class << self
827
- # source://packwerk//lib/packwerk/generators/root_package.rb#10
835
+ # source://packwerk//lib/packwerk/generators/root_package.rb#13
836
+ sig { params(root: ::String, out: T.any(::IO, ::StringIO)).returns(T::Boolean) }
828
837
  def generate(root:, out:); end
829
838
  end
830
839
  end
@@ -864,7 +873,7 @@ class Packwerk::Graph
864
873
  end
865
874
 
866
875
  # source://packwerk//lib/packwerk/node.rb#5
867
- class Packwerk::Node; end
876
+ module Packwerk::Node; end
868
877
 
869
878
  # source://packwerk//lib/packwerk/node.rb#6
870
879
  class Packwerk::Node::Location < ::Struct
@@ -1279,7 +1288,7 @@ module Packwerk::OutputStyle
1279
1288
  def reset; end
1280
1289
  end
1281
1290
 
1282
- # source://packwerk//lib/packwerk.rb#55
1291
+ # source://packwerk//lib/packwerk.rb#40
1283
1292
  module Packwerk::OutputStyles
1284
1293
  extend ::ActiveSupport::Autoload
1285
1294
  end
@@ -1503,11 +1512,11 @@ class Packwerk::ParseRun
1503
1512
  def initialize(relative_file_set:, configuration:, file_set_specified: T.unsafe(nil), offenses_formatter: T.unsafe(nil), progress_formatter: T.unsafe(nil)); end
1504
1513
 
1505
1514
  # source://packwerk//lib/packwerk/parse_run.rb#61
1506
- sig { returns(::Packwerk::Result) }
1515
+ sig { returns(::Packwerk::Cli::Result) }
1507
1516
  def check; end
1508
1517
 
1509
1518
  # source://packwerk//lib/packwerk/parse_run.rb#39
1510
- sig { returns(::Packwerk::Result) }
1519
+ sig { returns(::Packwerk::Cli::Result) }
1511
1520
  def update_todo; end
1512
1521
 
1513
1522
  private
@@ -1569,25 +1578,33 @@ module Packwerk::Parsers; end
1569
1578
  class Packwerk::Parsers::Erb
1570
1579
  include ::Packwerk::Parsers::ParserInterface
1571
1580
 
1572
- # @return [Erb] a new instance of Erb
1573
- #
1574
- # source://packwerk//lib/packwerk/parsers/erb.rb#14
1581
+ # source://packwerk//lib/packwerk/parsers/erb.rb#17
1582
+ sig { params(parser_class: T.untyped, ruby_parser: ::Packwerk::Parsers::Ruby).void }
1575
1583
  def initialize(parser_class: T.unsafe(nil), ruby_parser: T.unsafe(nil)); end
1576
1584
 
1577
- # source://packwerk//lib/packwerk/parsers/erb.rb#19
1585
+ # source://packwerk//lib/packwerk/parsers/erb.rb#23
1586
+ sig { override.params(io: T.any(::IO, ::StringIO), file_path: ::String).returns(T.untyped) }
1578
1587
  def call(io:, file_path: T.unsafe(nil)); end
1579
1588
 
1580
- # source://packwerk//lib/packwerk/parsers/erb.rb#25
1589
+ # source://packwerk//lib/packwerk/parsers/erb.rb#30
1590
+ sig { params(buffer: ::Parser::Source::Buffer, file_path: ::String).returns(T.nilable(::AST::Node)) }
1581
1591
  def parse_buffer(buffer, file_path:); end
1582
1592
 
1583
1593
  private
1584
1594
 
1585
1595
  # @yield [node]
1586
1596
  #
1587
- # source://packwerk//lib/packwerk/parsers/erb.rb#52
1597
+ # source://packwerk//lib/packwerk/parsers/erb.rb#71
1598
+ sig do
1599
+ params(
1600
+ node: T.nilable(T.any(::AST::Node, ::String)),
1601
+ block: T.nilable(T.proc.params(arg0: ::AST::Node).void)
1602
+ ).returns(T.nilable(T.any(T::Array[::String], T::Enumerator[::AST::Node])))
1603
+ end
1588
1604
  def code_nodes(node, &block); end
1589
1605
 
1590
- # source://packwerk//lib/packwerk/parsers/erb.rb#38
1606
+ # source://packwerk//lib/packwerk/parsers/erb.rb#49
1607
+ sig { params(erb_ast: T.all(::AST::Node, ::Object), file_path: ::String).returns(T.nilable(::AST::Node)) }
1591
1608
  def to_ruby_ast(erb_ast, file_path); end
1592
1609
  end
1593
1610
 
@@ -1596,13 +1613,19 @@ class Packwerk::Parsers::Factory
1596
1613
  include ::Singleton
1597
1614
  extend ::Singleton::SingletonClassMethods
1598
1615
 
1599
- # source://packwerk//lib/packwerk/parsers/factory.rb#33
1616
+ # source://packwerk//lib/packwerk/parsers/factory.rb#24
1617
+ sig { void }
1618
+ def initialize; end
1619
+
1620
+ # source://packwerk//lib/packwerk/parsers/factory.rb#41
1621
+ sig { returns(::Class) }
1600
1622
  def erb_parser_class; end
1601
1623
 
1602
- # source://packwerk//lib/packwerk/parsers/factory.rb#37
1624
+ # source://packwerk//lib/packwerk/parsers/factory.rb#46
1625
+ sig { params(klass: T.nilable(::Class)).void }
1603
1626
  def erb_parser_class=(klass); end
1604
1627
 
1605
- # source://packwerk//lib/packwerk/parsers/factory.rb#24
1628
+ # source://packwerk//lib/packwerk/parsers/factory.rb#31
1606
1629
  sig { params(path: ::String).returns(T.nilable(::Packwerk::Parsers::ParserInterface)) }
1607
1630
  def for_path(path); end
1608
1631
  end
@@ -1640,7 +1663,7 @@ module Packwerk::Parsers::ParserInterface
1640
1663
  # @abstract
1641
1664
  #
1642
1665
  # source://packwerk//lib/packwerk/parsers/parser_interface.rb#15
1643
- sig { abstract.params(io: ::File, file_path: ::String).returns(T.untyped) }
1666
+ sig { abstract.params(io: T.any(::IO, ::StringIO), file_path: ::String).returns(T.untyped) }
1644
1667
  def call(io:, file_path:); end
1645
1668
  end
1646
1669
 
@@ -1648,26 +1671,26 @@ end
1648
1671
  class Packwerk::Parsers::Ruby
1649
1672
  include ::Packwerk::Parsers::ParserInterface
1650
1673
 
1651
- # @return [Ruby] a new instance of Ruby
1652
- #
1653
- # source://packwerk//lib/packwerk/parsers/ruby.rb#25
1674
+ # source://packwerk//lib/packwerk/parsers/ruby.rb#34
1675
+ sig { params(parser_class: T.untyped).void }
1654
1676
  def initialize(parser_class: T.unsafe(nil)); end
1655
1677
 
1656
- # source://packwerk//lib/packwerk/parsers/ruby.rb#30
1678
+ # source://packwerk//lib/packwerk/parsers/ruby.rb#40
1679
+ sig { override.params(io: T.any(::IO, ::StringIO), file_path: ::String).returns(T.nilable(::Parser::AST::Node)) }
1657
1680
  def call(io:, file_path: T.unsafe(nil)); end
1658
1681
  end
1659
1682
 
1660
- # source://packwerk//lib/packwerk/parsers/ruby.rb#12
1683
+ # source://packwerk//lib/packwerk/parsers/ruby.rb#14
1661
1684
  class Packwerk::Parsers::Ruby::RaiseExceptionsParser < ::Parser::Ruby27
1662
- # @return [RaiseExceptionsParser] a new instance of RaiseExceptionsParser
1663
- #
1664
- # source://packwerk//lib/packwerk/parsers/ruby.rb#13
1685
+ # source://packwerk//lib/packwerk/parsers/ruby.rb#18
1686
+ sig { params(builder: T.untyped).void }
1665
1687
  def initialize(builder); end
1666
1688
  end
1667
1689
 
1668
- # source://packwerk//lib/packwerk/parsers/ruby.rb#19
1690
+ # source://packwerk//lib/packwerk/parsers/ruby.rb#24
1669
1691
  class Packwerk::Parsers::Ruby::TolerateInvalidUtf8Builder < ::Parser::Builders::Default
1670
- # source://packwerk//lib/packwerk/parsers/ruby.rb#20
1692
+ # source://packwerk//lib/packwerk/parsers/ruby.rb#28
1693
+ sig { params(token: T.untyped).returns(T.untyped) }
1671
1694
  def string_value(token); end
1672
1695
  end
1673
1696
 
@@ -1738,12 +1761,12 @@ class Packwerk::Reference < ::Struct
1738
1761
  end
1739
1762
  end
1740
1763
 
1741
- # source://packwerk//lib/packwerk.rb#79
1764
+ # source://packwerk//lib/packwerk.rb#96
1742
1765
  module Packwerk::ReferenceChecking
1743
1766
  extend ::ActiveSupport::Autoload
1744
1767
  end
1745
1768
 
1746
- # source://packwerk//lib/packwerk.rb#84
1769
+ # source://packwerk//lib/packwerk.rb#101
1747
1770
  module Packwerk::ReferenceChecking::Checkers
1748
1771
  extend ::ActiveSupport::Autoload
1749
1772
  end
@@ -1805,7 +1828,7 @@ class Packwerk::ReferenceExtractor
1805
1828
  end
1806
1829
  def initialize(constant_name_inspectors:, root_node:, root_path:); end
1807
1830
 
1808
- # source://packwerk//lib/packwerk/reference_extractor.rb#76
1831
+ # source://packwerk//lib/packwerk/reference_extractor.rb#79
1809
1832
  sig do
1810
1833
  params(
1811
1834
  node: ::Parser::AST::Node,
@@ -1817,12 +1840,17 @@ class Packwerk::ReferenceExtractor
1817
1840
 
1818
1841
  private
1819
1842
 
1820
- # @return [Boolean]
1821
- #
1822
- # source://packwerk//lib/packwerk/reference_extractor.rb#120
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
1823
1851
  def local_reference?(constant_name, name_location, namespace_path); end
1824
1852
 
1825
- # source://packwerk//lib/packwerk/reference_extractor.rb#105
1853
+ # source://packwerk//lib/packwerk/reference_extractor.rb#108
1826
1854
  sig do
1827
1855
  params(
1828
1856
  constant_name: ::String,
@@ -1869,17 +1897,6 @@ class Packwerk::ReferenceOffense < ::Packwerk::Offense
1869
1897
  def violation_type; end
1870
1898
  end
1871
1899
 
1872
- # source://packwerk//lib/packwerk/result.rb#5
1873
- class Packwerk::Result < ::T::Struct
1874
- const :message, ::String
1875
- const :status, T::Boolean
1876
-
1877
- class << self
1878
- # source://sorbet-runtime/0.5.10588/lib/types/struct.rb#13
1879
- def inherited(s); end
1880
- end
1881
- end
1882
-
1883
1900
  # Holds the context of a Packwerk run across multiple files.
1884
1901
  #
1885
1902
  # source://packwerk//lib/packwerk/run_context.rb#8
@@ -2011,6 +2028,8 @@ Packwerk::VERSION = T.let(T.unsafe(nil), String)
2011
2028
  #
2012
2029
  # source://packwerk//lib/packwerk/validator.rb#9
2013
2030
  module Packwerk::Validator
2031
+ extend ::ActiveSupport::Autoload
2032
+
2014
2033
  abstract!
2015
2034
 
2016
2035
  # @abstract
@@ -2021,18 +2040,18 @@ module Packwerk::Validator
2021
2040
  .params(
2022
2041
  package_set: Packwerk::PackageSet,
2023
2042
  configuration: ::Packwerk::Configuration
2024
- ).returns(::Packwerk::ApplicationValidator::Result)
2043
+ ).returns(::Packwerk::Validator::Result)
2025
2044
  end
2026
2045
  def call(package_set, configuration); end
2027
2046
 
2028
2047
  # source://packwerk//lib/packwerk/validator.rb#67
2029
2048
  sig do
2030
2049
  params(
2031
- results: T::Array[::Packwerk::ApplicationValidator::Result],
2050
+ results: T::Array[::Packwerk::Validator::Result],
2032
2051
  separator: ::String,
2033
2052
  before_errors: ::String,
2034
2053
  after_errors: ::String
2035
- ).returns(::Packwerk::ApplicationValidator::Result)
2054
+ ).returns(::Packwerk::Validator::Result)
2036
2055
  end
2037
2056
  def merge_results(results, separator: T.unsafe(nil), before_errors: T.unsafe(nil), after_errors: T.unsafe(nil)); end
2038
2057
 
@@ -2074,6 +2093,21 @@ module Packwerk::Validator
2074
2093
  end
2075
2094
  end
2076
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
+
2077
2111
  # source://packwerk//lib/packwerk/validators/dependency_validator.rb#5
2078
2112
  module Packwerk::Validators; end
2079
2113
 
@@ -2087,7 +2121,7 @@ class Packwerk::Validators::DependencyValidator
2087
2121
  .params(
2088
2122
  package_set: Packwerk::PackageSet,
2089
2123
  configuration: ::Packwerk::Configuration
2090
- ).returns(::Packwerk::ApplicationValidator::Result)
2124
+ ).returns(::Packwerk::Validator::Result)
2091
2125
  end
2092
2126
  def call(package_set, configuration); end
2093
2127
 
@@ -2110,15 +2144,15 @@ class Packwerk::Validators::DependencyValidator
2110
2144
  def build_cycle_strings(cycles); end
2111
2145
 
2112
2146
  # source://packwerk//lib/packwerk/validators/dependency_validator.rb#66
2113
- sig { params(package_set: Packwerk::PackageSet).returns(::Packwerk::ApplicationValidator::Result) }
2147
+ sig { params(package_set: Packwerk::PackageSet).returns(::Packwerk::Validator::Result) }
2114
2148
  def check_acyclic_graph(package_set); end
2115
2149
 
2116
2150
  # source://packwerk//lib/packwerk/validators/dependency_validator.rb#34
2117
- sig { params(configuration: ::Packwerk::Configuration).returns(::Packwerk::ApplicationValidator::Result) }
2151
+ sig { params(configuration: ::Packwerk::Configuration).returns(::Packwerk::Validator::Result) }
2118
2152
  def check_package_manifest_syntax(configuration); end
2119
2153
 
2120
2154
  # source://packwerk//lib/packwerk/validators/dependency_validator.rb#92
2121
- sig { params(configuration: ::Packwerk::Configuration).returns(::Packwerk::ApplicationValidator::Result) }
2155
+ sig { params(configuration: ::Packwerk::Configuration).returns(::Packwerk::Validator::Result) }
2122
2156
  def check_valid_package_dependencies(configuration); end
2123
2157
 
2124
2158
  # source://packwerk//lib/packwerk/validators/dependency_validator.rb#128
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger-packwerk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gusto Engineers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-14 00:00:00.000000000 Z
11
+ date: 2022-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: code_ownership
@@ -260,7 +260,7 @@ files:
260
260
  - sorbet/rbi/gems/nokogiri@1.13.8.rbi
261
261
  - sorbet/rbi/gems/octokit@5.6.1.rbi
262
262
  - sorbet/rbi/gems/open4@1.3.4.rbi
263
- - sorbet/rbi/gems/packwerk@2.2.1-7e8e7a50705833b41fe40c201eadb85ff9a1a422.rbi
263
+ - sorbet/rbi/gems/packwerk@2.2.1-8476bb3cd5452765ad452d36aa45ae724f1d44f5.rbi
264
264
  - sorbet/rbi/gems/parallel@1.22.1.rbi
265
265
  - sorbet/rbi/gems/parse_packwerk@0.16.0.rbi
266
266
  - sorbet/rbi/gems/parser@3.1.2.1.rbi