Skip to content

Commit

Permalink
Showing 8 changed files with 23 additions and 11 deletions.
6 changes: 5 additions & 1 deletion lib/analyze.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/analyze.js.map

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions lib/config-utils.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/config-utils.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/tracer-config.test.js.map

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion src/analyze.ts
@@ -191,6 +191,12 @@ export async function runQueries(

try {
if (hasPackWithCustomQueries) {
logger.info("*************");
logger.info(
"Performing analysis with custom QL Packs. QL Packs are an experimental feature."
);
logger.info("And should not be used in production yet.");
logger.info("*************");
logger.startGroup(`Downloading custom packs for ${language}`);

const codeql = getCodeQL(config.codeQLCmd);
@@ -338,7 +344,7 @@ function packWithVersionToQuerySuiteEntry(
): string {
let text = `- qlpack: ${pack.packName}`;
if (pack.version) {
text += `${"\n"} version: ${pack.version}`;
text += `\n version: ${pack.version}`;
}
return text;
}
7 changes: 4 additions & 3 deletions src/config-utils.ts
@@ -845,7 +845,7 @@ export async function getDefaultConfig(
queries,
pathsIgnore: [],
paths: [],
packs: {} as Record<Language, PackWithVersion[]>,
packs: {},
originalUserInput: {},
tempDir,
toolCacheDir,
@@ -942,10 +942,11 @@ async function loadConfig(
shouldAddConfigFileQueries(queriesInput) &&
QUERIES_PROPERTY in parsedYAML
) {
if (!Array.isArray(parsedYAML[QUERIES_PROPERTY])) {
const queriesArr = parsedYAML[QUERIES_PROPERTY];
if (!Array.isArray(queriesArr)) {
throw new Error(getQueriesInvalid(configFile));
}
for (const query of parsedYAML[QUERIES_PROPERTY]!) {
for (const query of queriesArr) {
if (
!(QUERIES_USES_PROPERTY in query) ||
typeof query[QUERIES_USES_PROPERTY] !== "string"
2 changes: 1 addition & 1 deletion src/tracer-config.test.ts
@@ -28,7 +28,7 @@ function getTestConfig(tmpDir: string): configUtils.Config {
codeQLCmd: "",
gitHubVersion: { type: util.GitHubVariant.DOTCOM } as util.GitHubVersion,
dbLocation: path.resolve(tmpDir, "codeql_databases"),
packs: {} as configUtils.Packs,
packs: {},
};
}

0 comments on commit 20aafcd

Please sign in to comment.