Skip to content

Commit 33f1f62

Browse files
committed
@W-17159591@ Enabled SARIF output format
1 parent be7eb26 commit 33f1f62

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/lib/writers/ResultsWriter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export class ResultsFileWriter implements ResultsWriter {
3535
} else if (['.html', '.htm'].includes(ext)) {
3636
this.format = OutputFormat.HTML;
3737
} else if (ext === '.sarif' || file.toLowerCase().endsWith('.sarif.json')) {
38-
throw new Error('TODO: Support SARIF-type output');
38+
this.format = OutputFormat.SARIF;''
3939
// Check for `.json` AFTER checking for `.sarif.json`!
4040
} else if (ext === '.json') {
4141
this.format = OutputFormat.JSON;

test/lib/writers/ResultsWriter.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ describe('ResultsWriter implementations', () => {
2323
{ext: '.html', expectedOutput: `Results formatted as ${OutputFormat.HTML}`},
2424
{ext: '.htm', expectedOutput: `Results formatted as ${OutputFormat.HTML}`},
2525
{ext: '.json', expectedOutput: `Results formatted as ${OutputFormat.JSON}`},
26-
//{ext: '.sarif', expectedOutput: `Results formatted as ${OutputFormat.SARIF}`},
27-
//{ext: '.sarif.json', expectedOutput: `Results formatted as ${OutputFormat.SARIF}`},
26+
{ext: '.sarif', expectedOutput: `Results formatted as ${OutputFormat.SARIF}`},
27+
{ext: '.sarif.json', expectedOutput: `Results formatted as ${OutputFormat.SARIF}`},
2828
{ext: '.xml', expectedOutput: `Results formatted as ${OutputFormat.XML}`}
2929
])('Accepts and outputs valid file format: *$ext', ({ext, expectedOutput}) => {
3030
const validFile = `beep${ext}`;

0 commit comments

Comments
 (0)