@@ -12,13 +12,13 @@ class ApplicationValidator
1212 include Validator
1313 extend T ::Sig
1414
15- sig { params ( package_set : PackageSet , configuration : Configuration ) . returns ( ApplicationValidator ::Result ) }
15+ sig { params ( package_set : PackageSet , configuration : Configuration ) . returns ( Validator ::Result ) }
1616 def check_all ( package_set , configuration )
1717 results = Validator . all . flat_map { |validator | validator . call ( package_set , configuration ) }
1818 merge_results ( results )
1919 end
2020
21- sig { override . params ( package_set : PackageSet , configuration : Configuration ) . returns ( ApplicationValidator ::Result ) }
21+ sig { override . params ( package_set : PackageSet , configuration : Configuration ) . returns ( Validator ::Result ) }
2222 def call ( package_set , configuration )
2323 results = [
2424 check_package_manifest_syntax ( configuration ) ,
@@ -37,7 +37,7 @@ def permitted_keys
3737 ]
3838 end
3939
40- sig { params ( configuration : Configuration ) . returns ( Result ) }
40+ sig { params ( configuration : Configuration ) . returns ( Validator :: Result ) }
4141 def check_package_manifest_syntax ( configuration )
4242 errors = [ ]
4343
@@ -54,18 +54,18 @@ def check_package_manifest_syntax(configuration)
5454 end
5555
5656 if errors . empty?
57- Result . new ( ok : true )
57+ Validator :: Result . new ( ok : true )
5858 else
5959 merge_results (
60- errors . map { |error | Result . new ( ok : false , error_value : error ) } ,
60+ errors . map { |error | Validator :: Result . new ( ok : false , error_value : error ) } ,
6161 separator : "\n " ,
6262 before_errors : "Malformed syntax in the following manifests:\n \n " ,
6363 after_errors : "\n " ,
6464 )
6565 end
6666 end
6767
68- sig { params ( configuration : Configuration ) . returns ( Result ) }
68+ sig { params ( configuration : Configuration ) . returns ( Validator :: Result ) }
6969 def check_application_structure ( configuration )
7070 resolver = ConstantResolver . new (
7171 root_path : configuration . root_path . to_s ,
@@ -74,23 +74,23 @@ def check_application_structure(configuration)
7474
7575 begin
7676 resolver . file_map
77- Result . new ( ok : true )
77+ Validator :: Result . new ( ok : true )
7878 rescue => e
79- Result . new ( ok : false , error_value : e . message )
79+ Validator :: Result . new ( ok : false , error_value : e . message )
8080 end
8181 end
8282
83- sig { params ( configuration : Configuration ) . returns ( Result ) }
83+ sig { params ( configuration : Configuration ) . returns ( Validator :: Result ) }
8484 def check_package_manifest_paths ( configuration )
8585 all_package_manifests = package_manifests ( configuration , "**/" )
8686 package_paths_package_manifests = package_manifests ( configuration , package_glob ( configuration ) )
8787
8888 difference = all_package_manifests - package_paths_package_manifests
8989
9090 if difference . empty?
91- Result . new ( ok : true )
91+ Validator :: Result . new ( ok : true )
9292 else
93- Result . new (
93+ Validator :: Result . new (
9494 ok : false ,
9595 error_value : <<~EOS
9696 Expected package paths for all package.ymls to be specified, but paths were missing for the following manifests:
@@ -101,15 +101,15 @@ def check_package_manifest_paths(configuration)
101101 end
102102 end
103103
104- sig { params ( configuration : Configuration ) . returns ( Result ) }
104+ sig { params ( configuration : Configuration ) . returns ( Validator :: Result ) }
105105 def check_root_package_exists ( configuration )
106106 root_package_path = File . join ( configuration . root_path , "package.yml" )
107107 all_packages_manifests = package_manifests ( configuration , package_glob ( configuration ) )
108108
109109 if all_packages_manifests . include? ( root_package_path )
110- Result . new ( ok : true )
110+ Validator :: Result . new ( ok : true )
111111 else
112- Result . new (
112+ Validator :: Result . new (
113113 ok : false ,
114114 error_value : <<~EOS
115115 A root package does not exist. Create an empty `package.yml` at the root directory.
@@ -130,4 +130,6 @@ def relative_paths(configuration, paths)
130130 paths . map { |path | relative_path ( configuration , path ) }
131131 end
132132 end
133+
134+ private_constant :ApplicationValidator
133135end
0 commit comments