SARIF support¶
SARIF is a machine-readable format, originally designed for the output of static analysis tools, but which can be used for diagnostics in general.
-
void diagnostic_manager_add_sarif_sink(diagnostic_manager *diag_mgr, FILE *dst_stream, const diagnostic_file *main_input_file, enum diagnostic_sarif_version version)¶
Add a new output sink to
diag_mgr, which writes SARIF of the given version todst_stream.The output is not written until
diag_mgris released.dst_streamis borrowed, and must outlivediag_mgr.For the result to be a valid SARIF file according to the schema,
diag_mgrmust have haddiagnostic_manager_set_tool_name()called on it.diag_mgr,dst_stream, andmain_input_filemust all be non-NULL.