@@ -1094,6 +1094,47 @@ def __update_review_status_config(args):
10941094 os .symlink (args .review_status_config , rs_config_to_send )
10951095
10961096
1097+ def __update_analysis_config_files (args ):
1098+ """
1099+ Copy analysis related configuration files
1100+ (e.g. skipfile, review_status_config) to report_dir/conf/.
1101+ """
1102+ conf_dir = os .path .join (args .output_path , "conf" )
1103+
1104+ # Remove any config files used during previous analysis
1105+ if os .path .isdir (conf_dir ):
1106+ shutil .rmtree (conf_dir )
1107+
1108+ # Create a new conf directory
1109+ os .makedirs (conf_dir )
1110+
1111+ def add_file_to_conf_dir (file_path : str ):
1112+ if not os .path .isfile (file_path ):
1113+ return
1114+
1115+ file_path = os .path .abspath (file_path )
1116+ filename = os .path .basename (file_path )
1117+ shutil .copyfile (file_path , os .path .join (conf_dir , filename ))
1118+
1119+ # Add analysis config files e.g., skipfile, review_status_config, etc.
1120+ if getattr (args , "skipfile" , None ):
1121+ add_file_to_conf_dir (args .skipfile )
1122+
1123+ if getattr (args , "review_status_config" , None ):
1124+ add_file_to_conf_dir (args .review_status_config )
1125+
1126+ if getattr (args , "config_file" , None ):
1127+ add_file_to_conf_dir (args .config_file )
1128+
1129+ # Add cc-verbatim-args-file
1130+ #
1131+ # Example: --saargs <filepath>, --tidyargs <filepath>,
1132+ # --analyzer-config clangsa:cc-verbatim-args-file=<filepath>, etc.
1133+ for a_conf in args .analyzer_config :
1134+ if a_conf .option == "cc-verbatim-args-file" :
1135+ add_file_to_conf_dir (a_conf .value )
1136+
1137+
10971138def __cleanup_metadata (metadata_prev , metadata ):
10981139 """ Cleanup metadata.
10991140
@@ -1455,6 +1496,7 @@ def main(args):
14551496
14561497 __update_skip_file (args )
14571498 __update_review_status_config (args )
1499+ __update_analysis_config_files (args )
14581500
14591501 LOG .debug ("Cleanup metadata file started." )
14601502 __cleanup_metadata (metadata_prev , metadata )
0 commit comments