@@ -124,11 +124,46 @@ def validate_cirro_dir(cirro_dir):
124124
125125
126126def main ():
127+ import argparse
128+
129+ parser = argparse .ArgumentParser (description = "Validate .cirro configurations in WILDS pipelines." )
130+ parser .add_argument ("name" , nargs = "?" , default = None ,
131+ help = "Specific pipeline name to validate (e.g., ww-star-salmon). "
132+ "If omitted, validates all pipelines." )
133+ args = parser .parse_args ()
134+
127135 pipelines_dir = Path ("pipelines" )
128136 if not pipelines_dir .exists ():
129137 print ("No pipelines directory found" )
130138 return 0
131139
140+ # If a specific name is given, only validate that pipeline
141+ if args .name :
142+ pipeline_dir = pipelines_dir / args .name
143+ if not pipeline_dir .is_dir ():
144+ # Could be a module — modules don't have .cirro dirs, so skip silently
145+ print (f"Skipping { args .name } (not a pipeline or no pipeline directory found)" )
146+ return 0
147+
148+ cirro_dir = pipeline_dir / ".cirro"
149+ if not cirro_dir .is_dir ():
150+ print (f"Skipping { args .name } (no .cirro directory)" )
151+ return 0
152+
153+ print (f"Validating { args .name } /.cirro/ ..." )
154+ errors = validate_cirro_dir (cirro_dir )
155+ if errors :
156+ print (f" FAIL ({ len (errors )} issue(s))" )
157+ print (f"\n { '=' * 50 } " )
158+ print (f"Cirro validation failed for { args .name } :\n " )
159+ for error in errors :
160+ print (error )
161+ return 1
162+ else :
163+ print (f" OK" )
164+ print (f"\n All Cirro configurations valid!" )
165+ return 0
166+
132167 found_any = False
133168 all_errors = {}
134169
0 commit comments