Skip to content

Commit ccd115d

Browse files
Merge pull request #985 from github/robertbrignull/support-sarif
Simplify queryPackSupportsSarif and fix comment
2 parents 03578e0 + 6274965 commit ccd115d

File tree

2 files changed

+10
-23
lines changed

2 files changed

+10
-23
lines changed

dist/query.js

+3-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/codeql.ts

+7-13
Original file line numberDiff line numberDiff line change
@@ -329,22 +329,16 @@ function querySupportsSarif(
329329
return sarifOutputType !== undefined;
330330
}
331331

332+
/**
333+
* All queries in the pack must support SARIF in order
334+
* for the query pack to support SARIF.
335+
*/
332336
function queryPackSupportsSarif(
333337
queriesResultInfo: QueryPackRunResults,
334338
): boolean {
335-
// Some queries in the pack must support SARIF in order
336-
// for the query pack to support SARIF.
337-
for (const query of queriesResultInfo.queries) {
338-
const supportsSarif = querySupportsSarif(
339-
query.queryMetadata,
340-
query.bqrsInfo,
341-
);
342-
if (!supportsSarif) {
343-
return false;
344-
}
345-
}
346-
347-
return true;
339+
return queriesResultInfo.queries.every((q) =>
340+
querySupportsSarif(q.queryMetadata, q.bqrsInfo),
341+
);
348342
}
349343

350344
/**

0 commit comments

Comments
 (0)