mirror of
https://github.com/github/codeql-action.git
synced 2026-11-10 23:05:27 +00:00
Add pack download to its own log group
Also, make the baseline count message less awkward sounding.
This commit is contained in:
6
lib/analyze.js
generated
6
lib/analyze.js
generated
@@ -85,7 +85,6 @@ async function runQueries(sarifFolder, memoryFlag, addSnippetsFlag, threadsFlag,
|
||||
// that here.
|
||||
config.paths, config.pathsIgnore, config.languages, logger);
|
||||
for (const language of config.languages) {
|
||||
logger.startGroup(`Running queries for ${language}`);
|
||||
const queries = config.queries[language];
|
||||
const packsWithVersion = config.packs[language] || [];
|
||||
const hasBuiltinQueries = ((_a = queries) === null || _a === void 0 ? void 0 : _a.builtin.length) > 0;
|
||||
@@ -96,12 +95,15 @@ async function runQueries(sarifFolder, memoryFlag, addSnippetsFlag, threadsFlag,
|
||||
}
|
||||
try {
|
||||
if (hasPackWithCustomQueries) {
|
||||
logger.startGroup(`Downloading custom packs for ${language}`);
|
||||
const codeql = codeql_1.getCodeQL(config.codeQLCmd);
|
||||
const results = await codeql.packDownload(packsWithVersion);
|
||||
logger.info(`Downloaded packs: ${results.packs
|
||||
.map((r) => `${r.name}@${r.version || "latest"}`)
|
||||
.join(", ")}`);
|
||||
logger.endGroup();
|
||||
}
|
||||
logger.startGroup(`Running queries for ${language}`);
|
||||
const querySuitePaths = [];
|
||||
if (queries["builtin"].length > 0) {
|
||||
const startTimeBuiltIn = new Date().getTime();
|
||||
@@ -222,7 +224,7 @@ async function injectLinesOfCode(sarifFile, language, locPromise) {
|
||||
}
|
||||
function printLinesOfCodeSummary(logger, language, lineCounts) {
|
||||
if (language in lineCounts) {
|
||||
logger.info(`Counted ${lineCounts[language]} lines of code for ${language} as a baseline.`);
|
||||
logger.info(`Counted a baseline of ${lineCounts[language]} lines of code for ${language}.`);
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=analyze.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -176,14 +176,13 @@ export async function runQueries(
|
||||
);
|
||||
|
||||
for (const language of config.languages) {
|
||||
logger.startGroup(`Running queries for ${language}`);
|
||||
|
||||
const queries = config.queries[language];
|
||||
const packsWithVersion = config.packs[language] || [];
|
||||
|
||||
const hasBuiltinQueries = queries?.builtin.length > 0;
|
||||
const hasCustomQueries = queries?.custom.length > 0;
|
||||
const hasPackWithCustomQueries = packsWithVersion.length > 0;
|
||||
|
||||
if (!hasBuiltinQueries && !hasCustomQueries && !hasPackWithCustomQueries) {
|
||||
throw new Error(
|
||||
`Unable to analyse ${language} as no queries were selected for this language`
|
||||
@@ -192,6 +191,8 @@ export async function runQueries(
|
||||
|
||||
try {
|
||||
if (hasPackWithCustomQueries) {
|
||||
logger.startGroup(`Downloading custom packs for ${language}`);
|
||||
|
||||
const codeql = getCodeQL(config.codeQLCmd);
|
||||
const results = await codeql.packDownload(packsWithVersion);
|
||||
logger.info(
|
||||
@@ -199,8 +200,11 @@ export async function runQueries(
|
||||
.map((r) => `${r.name}@${r.version || "latest"}`)
|
||||
.join(", ")}`
|
||||
);
|
||||
|
||||
logger.endGroup();
|
||||
}
|
||||
|
||||
logger.startGroup(`Running queries for ${language}`);
|
||||
const querySuitePaths: string[] = [];
|
||||
if (queries["builtin"].length > 0) {
|
||||
const startTimeBuiltIn = new Date().getTime();
|
||||
@@ -419,7 +423,7 @@ function printLinesOfCodeSummary(
|
||||
) {
|
||||
if (language in lineCounts) {
|
||||
logger.info(
|
||||
`Counted ${lineCounts[language]} lines of code for ${language} as a baseline.`
|
||||
`Counted a baseline of ${lineCounts[language]} lines of code for ${language}.`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user