Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Henry Mercer <[email protected]>
  • Loading branch information
aeisenberg and henrymercer authored Feb 9, 2023
1 parent e2f72f1 commit e75245f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/codeql.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ test(
{}
);

test("does not use injected config", async (t: ExecutionContext<unknown>) => {
test("does not pass a code scanning config or qlconfig file to the CLI when CLI config passing is disabled", async (t: ExecutionContext<unknown>) => {
const runnerConstructorStub = stubToolRunnerConstructor();
const codeqlObject = await codeql.getCodeQLForTesting();
sinon
Expand All @@ -1027,10 +1027,10 @@ test("does not use injected config", async (t: ExecutionContext<unknown>) => {

// should not have passed a qlconfig file
const qlconfigArg = args.find((arg: string) => arg.startsWith("--qlconfig="));
t.falsy(qlconfigArg, "Should NOT have injected a codescanning config");
t.falsy(qlconfigArg, "Should NOT have passed a qlconfig file");
});

test("uses injected config AND qlconfig", async (t: ExecutionContext<unknown>) => {
test("passes a code scanning config AND qlconfig to the CLI when CLI config passing is enabled", async (t: ExecutionContext<unknown>) => {
const runnerConstructorStub = stubToolRunnerConstructor();
const codeqlObject = await codeql.getCodeQLForTesting();
sinon
Expand Down
2 changes: 1 addition & 1 deletion src/config-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1975,7 +1975,7 @@ export async function generateRegistries(
!(await codeQlVersionAbove(codeQL, CODEQL_VERSION_GHES_PACK_DOWNLOAD))
) {
throw new Error(
`'registries' input is not supported on CodeQL versions less than ${CODEQL_VERSION_GHES_PACK_DOWNLOAD}.`
`The 'registries' input is not supported on CodeQL CLI versions earlier than ${CODEQL_VERSION_GHES_PACK_DOWNLOAD}. Please upgrade to CodeQL CLI version ${CODEQL_VERSION_GHES_PACK_DOWNLOAD} or later.`
);
}

Expand Down
4 changes: 2 additions & 2 deletions src/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ export async function runInit(
try {
if (await codeQlVersionAbove(codeql, CODEQL_VERSION_NEW_TRACING)) {
// Only create the qlconfig file if we haven't already created it.
// If we are not parsing the config file in the cli, then the qlconfig
// file has already been created.
// If we are parsing the config file in the Action, then we already created the qlconfig
// file in `configUtils.generateRegistries`.
let registriesAuthTokens: string | undefined;
let qlconfigFile: string | undefined;
if (await util.useCodeScanningConfigInCli(codeql, featureEnablement)) {
Expand Down

0 comments on commit e75245f

Please sign in to comment.