Display the description of defects in the list
+ -sarif
+
+ By default the output of scan-build is a set of HTML files. This option
+ outputs the results in SARIF format.
+
-plist
By default the output of scan-build is a set of HTML files. This option
next;
}
+ if ($arg eq "-sarif") {
+ shift @$Args;
+ $Options{OutputFormat} = "sarif";
+ next;
+ }
+
if ($arg eq "-plist") {
shift @$Args;
$Options{OutputFormat} = "plist";
$Cmd, $CmdCXX, \%EnvVars);
if (defined $Options{OutputFormat}) {
- if ($Options{OutputFormat} =~ /plist/) {
+ if ($Options{OutputFormat} =~ /plist/ ||
+ $Options{OutputFormat} =~ /sarif/) {
Diag "Analysis run complete.\n";
- Diag "Analysis results (plist files) deposited in '$Options{OutputDir}'\n";
+ Diag "Analysis results (" .
+ ($Options{OutputFormat} =~ /plist/ ? "plist" : "sarif") .
+ " files) deposited in '$Options{OutputDir}'\n";
}
if ($Options{OutputFormat} =~ /html/) {
# Postprocess the HTML directory.
if (defined $OutputFormat) {
push @AnalyzeArgs, "-analyzer-output=" . $OutputFormat;
- if ($OutputFormat =~ /plist/) {
+ if ($OutputFormat =~ /plist/ || $OutputFormat =~ /sarif/) {
# Change "Output" to be a file.
- my ($h, $f) = tempfile("report-XXXXXX", SUFFIX => ".plist",
+ my $Suffix = $OutputFormat =~ /plist/ ? ".plist" : ".sarif";
+ my ($h, $f) = tempfile("report-XXXXXX", SUFFIX => $Suffix,
DIR => $HtmlDir);
$ResultFile = $f;
# If the HtmlDir is not set, we should clean up the plist files.