@@ -624,23 +624,23 @@ def scan_repository(
624624 return results
625625
626626
627- def parse_targets_file (file_path : str ) -> List [Tuple [str , str ]]:
627+ def parse_matrix_file (file_path : str ) -> List [Tuple [str , str ]]:
628628 """
629- Parses a YAML targets file into a list of (dependency, version) tuples.
629+ Parses a YAML matrix file into a list of (dependency, version) tuples.
630630 """
631- content = _safe_read_file (file_path , required = True , description = "targets file" )
631+ content = _safe_read_file (file_path , required = True , description = "matrix file" )
632632 try :
633- raw_targets = yaml .safe_load (content )
633+ raw_matrix = yaml .safe_load (content )
634634 except Exception as e :
635- print (f"Error parsing targets YAML mapping: { e } " , file = sys .stderr )
635+ print (f"Error parsing matrix YAML mapping: { e } " , file = sys .stderr )
636636 sys .exit (1 )
637637
638- if not isinstance (raw_targets , dict ):
639- print ("Error: Targets file content must resolve to a YAML mapping" , file = sys .stderr )
638+ if not isinstance (raw_matrix , dict ):
639+ print ("Error: Matrix file content must resolve to a YAML mapping" , file = sys .stderr )
640640 sys .exit (1 )
641641
642642 targets = []
643- for dep , versions in raw_targets .items ():
643+ for dep , versions in raw_matrix .items ():
644644 if isinstance (versions , list ):
645645 for v in versions :
646646 if v is None or isinstance (v , (dict , list )):
@@ -675,7 +675,7 @@ def main():
675675 )
676676
677677 parser .add_argument (
678- "--targets -file" ,
678+ "-m" , "--matrix -file" ,
679679 help = "Path to a YAML file containing target dependencies and versions."
680680 )
681681
@@ -744,16 +744,16 @@ def main():
744744
745745 # Validation of required inputs
746746 has_single_target = bool (args .dependency and args .version )
747- has_targets_file = bool (args .targets_file )
747+ has_matrix_file = bool (args .matrix_file )
748748
749- if not (has_single_target or has_targets_file ):
750- parser .error ("Must specify either (-d/--dependency AND -v/--version) OR (--targets -file)" )
751- if has_single_target and has_targets_file :
752- parser .error ("Cannot specify both single target (-d/-v) and targets file (--targets -file)" )
749+ if not (has_single_target or has_matrix_file ):
750+ parser .error ("Must specify either (-d/--dependency AND -v/--version) OR (-m/--matrix -file)" )
751+ if has_single_target and has_matrix_file :
752+ parser .error ("Cannot specify both single target (-d/-v) and matrix file (-m/--matrix -file)" )
753753
754754 targets = []
755- if has_targets_file :
756- targets = parse_targets_file (args .targets_file )
755+ if has_matrix_file :
756+ targets = parse_matrix_file (args .matrix_file )
757757 else :
758758 targets = [(args .dependency , args .version )]
759759
@@ -772,7 +772,7 @@ def main():
772772 elif args .package_file :
773773 target_packages = read_package_file (args .package_file )
774774
775- if has_targets_file :
775+ if has_matrix_file :
776776 print ("Starting scan for multiple targets:" )
777777 for dep , ver in targets :
778778 print (f" - { dep } : { ver } " )
@@ -809,7 +809,7 @@ def main():
809809 rules ,
810810 target_packages ,
811811 ignore_dirs ,
812- version_string = (None if has_targets_file else args .version ),
812+ version_string = (None if has_matrix_file else args .version ),
813813 targets = targets
814814 )
815815
@@ -833,8 +833,8 @@ def main():
833833 script_dir = os .path .dirname (os .path .abspath (__file__ ))
834834 results_dir = os .path .join (script_dir , "results" )
835835 os .makedirs (results_dir , exist_ok = True )
836- if has_targets_file :
837- base_name = os .path .splitext (os .path .basename (args .targets_file ))[0 ]
836+ if has_matrix_file :
837+ base_name = os .path .splitext (os .path .basename (args .matrix_file ))[0 ]
838838 output_path = os .path .join (results_dir , f"{ base_name } -{ timestamp } .csv" )
839839 else :
840840 output_path = os .path .join (results_dir , f"{ args .dependency } -{ args .version } -{ timestamp } .csv" )
0 commit comments