Fix name of qlconfig file argument

This commit is contained in:
Henry Mercer
2023-03-06 10:46:36 +00:00
committed by Andrew Eisenberg
parent 4366485427
commit c310f094dd
6 changed files with 14 additions and 14 deletions

4
lib/codeql.js generated
View File

@@ -99,7 +99,7 @@ exports.CODEQL_VERSION_BETTER_RESOLVE_LANGUAGES = "2.10.3";
*/
exports.CODEQL_VERSION_SECURITY_EXPERIMENTAL_SUITE = "2.12.1";
/**
* Versions 2.12.4+ of the CodeQL CLI support the `--qlconfig` flag in calls to `database init`.
* Versions 2.12.4+ of the CodeQL CLI support the `--qlconfig-file` flag in calls to `database init`.
*/
exports.CODEQL_VERSION_INIT_WITH_QLCONFIG = "2.12.4";
/**
@@ -337,7 +337,7 @@ async function getCodeQLForCmd(cmd, checkVersion) {
}
if (qlconfigFile !== undefined &&
(await util.codeQlVersionAbove(this, exports.CODEQL_VERSION_INIT_WITH_QLCONFIG))) {
extraArgs.push(`--qlconfig=${qlconfigFile}`);
extraArgs.push(`--qlconfig-file=${qlconfigFile}`);
}
await runTool(cmd, [
"database",

File diff suppressed because one or more lines are too long

8
lib/codeql.test.js generated
View File

@@ -677,7 +677,7 @@ const injectedConfigMacro = ava_1.default.macro({
const hasConfigArg = args.some((arg) => arg.startsWith("--codescanning-config="));
t.false(hasConfigArg, "Should NOT have injected a codescanning config");
// should not have passed a qlconfig file
const hasQlconfigArg = args.some((arg) => arg.startsWith("--qlconfig="));
const hasQlconfigArg = args.some((arg) => arg.startsWith("--qlconfig-file="));
t.false(hasQlconfigArg, "Should NOT have passed a qlconfig file");
});
});
@@ -694,7 +694,7 @@ const injectedConfigMacro = ava_1.default.macro({
const hasCodeScanningConfigArg = args.some((arg) => arg.startsWith("--codescanning-config="));
t.true(hasCodeScanningConfigArg, "Should have injected a qlconfig");
// should have passed a qlconfig file
const hasQlconfigArg = args.some((arg) => arg.startsWith("--qlconfig="));
const hasQlconfigArg = args.some((arg) => arg.startsWith("--qlconfig-file="));
t.truthy(hasQlconfigArg, "Should have injected a codescanning config");
});
});
@@ -709,7 +709,7 @@ const injectedConfigMacro = ava_1.default.macro({
const hasCodeScanningConfigArg = args.some((arg) => arg.startsWith("--codescanning-config="));
t.true(hasCodeScanningConfigArg, "Should have injected a codescanning config");
// should not have passed a qlconfig file
const hasQlconfigArg = args.some((arg) => arg.startsWith("--qlconfig="));
const hasQlconfigArg = args.some((arg) => arg.startsWith("--qlconfig-file="));
t.false(hasQlconfigArg, "should NOT have injected a qlconfig");
});
});
@@ -723,7 +723,7 @@ const injectedConfigMacro = ava_1.default.macro({
await codeqlObject.databaseInitCluster({ ...stubConfig, tempDir }, "", undefined, (0, testing_utils_1.createFeatures)([feature_flags_1.Feature.CliConfigFileEnabled]), undefined, // undefined qlconfigFile
(0, logging_1.getRunnerLogger)(true));
const args = runnerConstructorStub.firstCall.args[1];
const hasQlconfigArg = args.some((arg) => arg.startsWith("--qlconfig="));
const hasQlconfigArg = args.some((arg) => arg.startsWith("--qlconfig-file="));
t.false(hasQlconfigArg, "should NOT have injected a qlconfig");
});
});

File diff suppressed because one or more lines are too long

View File

@@ -1027,7 +1027,7 @@ test("does not pass a code scanning config or qlconfig file to the CLI when CLI
// should not have passed a qlconfig file
const hasQlconfigArg = args.some((arg: string) =>
arg.startsWith("--qlconfig=")
arg.startsWith("--qlconfig-file=")
);
t.false(hasQlconfigArg, "Should NOT have passed a qlconfig file");
});
@@ -1059,7 +1059,7 @@ test("passes a code scanning config AND qlconfig to the CLI when CLI config pass
// should have passed a qlconfig file
const hasQlconfigArg = args.some((arg: string) =>
arg.startsWith("--qlconfig=")
arg.startsWith("--qlconfig-file=")
);
t.truthy(hasQlconfigArg, "Should have injected a codescanning config");
});
@@ -1092,7 +1092,7 @@ test("passes a code scanning config BUT NOT a qlconfig to the CLI when CLI confi
// should not have passed a qlconfig file
const hasQlconfigArg = args.some((arg: string) =>
arg.startsWith("--qlconfig=")
arg.startsWith("--qlconfig-file=")
);
t.false(hasQlconfigArg, "should NOT have injected a qlconfig");
});
@@ -1117,7 +1117,7 @@ test("does not pass a qlconfig to the CLI when it is undefined", async (t: Execu
const args = runnerConstructorStub.firstCall.args[1] as any[];
const hasQlconfigArg = args.some((arg: string) =>
arg.startsWith("--qlconfig=")
arg.startsWith("--qlconfig-file=")
);
t.false(hasQlconfigArg, "should NOT have injected a qlconfig");
});

View File

@@ -291,7 +291,7 @@ export const CODEQL_VERSION_BETTER_RESOLVE_LANGUAGES = "2.10.3";
export const CODEQL_VERSION_SECURITY_EXPERIMENTAL_SUITE = "2.12.1";
/**
* Versions 2.12.4+ of the CodeQL CLI support the `--qlconfig` flag in calls to `database init`.
* Versions 2.12.4+ of the CodeQL CLI support the `--qlconfig-file` flag in calls to `database init`.
*/
export const CODEQL_VERSION_INIT_WITH_QLCONFIG = "2.12.4";
@@ -622,7 +622,7 @@ export async function getCodeQLForCmd(
qlconfigFile !== undefined &&
(await util.codeQlVersionAbove(this, CODEQL_VERSION_INIT_WITH_QLCONFIG))
) {
extraArgs.push(`--qlconfig=${qlconfigFile}`);
extraArgs.push(`--qlconfig-file=${qlconfigFile}`);
}
await runTool(
cmd,