Skip to content

Commit

Permalink
@W-17159591@ Enabled SARIF output format
Browse files Browse the repository at this point in the history
  • Loading branch information
jfeingold35 committed Dec 5, 2024
1 parent be7eb26 commit e8cc66a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lib/writers/ResultsWriter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class ResultsFileWriter implements ResultsWriter {
} else if (['.html', '.htm'].includes(ext)) {
this.format = OutputFormat.HTML;
} else if (ext === '.sarif' || file.toLowerCase().endsWith('.sarif.json')) {
throw new Error('TODO: Support SARIF-type output');
this.format = OutputFormat.SARIF;''
// Check for `.json` AFTER checking for `.sarif.json`!
} else if (ext === '.json') {
this.format = OutputFormat.JSON;
Expand Down
4 changes: 2 additions & 2 deletions test/lib/writers/ResultsWriter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ describe('ResultsWriter implementations', () => {
{ext: '.html', expectedOutput: `Results formatted as ${OutputFormat.HTML}`},
{ext: '.htm', expectedOutput: `Results formatted as ${OutputFormat.HTML}`},
{ext: '.json', expectedOutput: `Results formatted as ${OutputFormat.JSON}`},
//{ext: '.sarif', expectedOutput: `Results formatted as ${OutputFormat.SARIF}`},
//{ext: '.sarif.json', expectedOutput: `Results formatted as ${OutputFormat.SARIF}`},
{ext: '.sarif', expectedOutput: `Results formatted as ${OutputFormat.SARIF}`},
{ext: '.sarif.json', expectedOutput: `Results formatted as ${OutputFormat.SARIF}`},
{ext: '.xml', expectedOutput: `Results formatted as ${OutputFormat.XML}`}
])('Accepts and outputs valid file format: *$ext', ({ext, expectedOutput}) => {
const validFile = `beep${ext}`;
Expand Down

0 comments on commit e8cc66a

Please sign in to comment.