@@ -233,6 +233,7 @@ def format_sarif_for_upload(input_file, output_file, source_root, upload_format)
233
233
234
234
# Initialize variables
235
235
formatted_results = []
236
+ tool_name = input_file .stem
236
237
237
238
# Import the SARIF results
238
239
unformatted_results = parse_sarif (input_file , source_root )
@@ -248,15 +249,15 @@ def format_sarif_for_upload(input_file, output_file, source_root, upload_format)
248
249
warning ['description' ] = [warning ['description' ][0 ]]
249
250
formatted_results .append (warning )
250
251
251
- create_sarif_output_file (formatted_results , '2.1.0' , output_file , source_root )
252
+ create_sarif_output_file (formatted_results , '2.1.0' , output_file , source_root , tool_name )
252
253
elif upload_format == 'codesonar' :
253
254
# shutil.copyfile(input_file, output_file)
254
255
for warning in unformatted_results :
255
256
# Add a prefix to the tool name to allow for filtering
256
257
warning ['tool' ] = 'external-' + warning ['tool' ]
257
258
warning ['query' ] = warning ['tool' ].title () + ' ' + warning ['query' ]
258
259
formatted_results .append (warning )
259
- create_sarif_output_file (formatted_results , '2.1.0' , output_file , source_root )
260
+ create_sarif_output_file (formatted_results , '2.1.0' , output_file , source_root , tool_name )
260
261
261
262
262
263
def parse_sarif (sarif_filename , source_root ):
0 commit comments