mirror of
https://github.com/github/codeql-action.git
synced 2025-12-27 17:50:07 +08:00
Remove unneeded version guards
This commit is contained in:
@@ -303,16 +303,6 @@ const EXTRACTION_DEBUG_MODE_VERBOSITY = "progress++";
|
||||
* flag is older than the oldest supported version above, it may be removed.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Versions 2.14.2+ of the CodeQL CLI support language-specific baseline configuration.
|
||||
*/
|
||||
export const CODEQL_VERSION_LANGUAGE_BASELINE_CONFIG = "2.14.2";
|
||||
|
||||
/**
|
||||
* Versions 2.14.4+ of the CodeQL CLI support language aliasing.
|
||||
*/
|
||||
export const CODEQL_VERSION_LANGUAGE_ALIASING = "2.14.4";
|
||||
|
||||
/**
|
||||
* Versions 2.15.0+ of the CodeQL CLI support new analysis summaries.
|
||||
*/
|
||||
@@ -471,6 +461,7 @@ export function setCodeQL(partialCodeql: Partial<CodeQL>): CodeQL {
|
||||
betterResolveLanguages: resolveFunction(
|
||||
partialCodeql,
|
||||
"betterResolveLanguages",
|
||||
async () => ({ aliases: {}, extractors: {} }),
|
||||
),
|
||||
resolveQueries: resolveFunction(partialCodeql, "resolveQueries"),
|
||||
resolveBuildEnvironment: resolveFunction(
|
||||
@@ -602,14 +593,7 @@ export async function getCodeQLForCmd(
|
||||
extraArgs.push(`--qlconfig-file=${qlconfigFile}`);
|
||||
}
|
||||
|
||||
if (
|
||||
await util.codeQlVersionAtLeast(
|
||||
this,
|
||||
CODEQL_VERSION_LANGUAGE_BASELINE_CONFIG,
|
||||
)
|
||||
) {
|
||||
extraArgs.push("--calculate-language-specific-baseline");
|
||||
}
|
||||
extraArgs.push("--calculate-language-specific-baseline");
|
||||
|
||||
if (await isSublanguageFileCoverageEnabled(config, this)) {
|
||||
extraArgs.push("--sublanguage-file-coverage");
|
||||
@@ -638,7 +622,7 @@ export async function getCodeQLForCmd(
|
||||
"--db-cluster",
|
||||
config.dbLocation,
|
||||
`--source-root=${sourceRoot}`,
|
||||
...(await getLanguageAliasingArguments(this)),
|
||||
"--extractor-include-aliases",
|
||||
...extraArgs,
|
||||
...getExtraOptionsFromEnv(["database", "init"], {
|
||||
ignoringOptions: ["--overwrite"],
|
||||
@@ -758,7 +742,7 @@ export async function getCodeQLForCmd(
|
||||
"languages",
|
||||
"--format=betterjson",
|
||||
"--extractor-options-verbosity=4",
|
||||
...(await getLanguageAliasingArguments(this)),
|
||||
"--extractor-include-aliases",
|
||||
...getExtraOptionsFromEnv(["resolve", "languages"]),
|
||||
];
|
||||
const output = await runCli(cmd, codeqlArgs);
|
||||
@@ -801,7 +785,7 @@ export async function getCodeQLForCmd(
|
||||
"resolve",
|
||||
"build-environment",
|
||||
`--language=${language}`,
|
||||
...(await getLanguageAliasingArguments(this)),
|
||||
"--extractor-include-aliases",
|
||||
...getExtraOptionsFromEnv(["resolve", "build-environment"]),
|
||||
];
|
||||
if (workingDir !== undefined) {
|
||||
@@ -1065,7 +1049,7 @@ export async function getCodeQLForCmd(
|
||||
"extractor",
|
||||
"--format=json",
|
||||
`--language=${language}`,
|
||||
...(await getLanguageAliasingArguments(this)),
|
||||
"--extractor-include-aliases",
|
||||
...getExtraOptionsFromEnv(["resolve", "extractor"]),
|
||||
],
|
||||
{
|
||||
@@ -1336,15 +1320,6 @@ export function getGeneratedCodeScanningConfigPath(config: Config): string {
|
||||
return path.resolve(config.tempDir, "user-config.yaml");
|
||||
}
|
||||
|
||||
async function getLanguageAliasingArguments(codeql: CodeQL): Promise<string[]> {
|
||||
if (
|
||||
await util.codeQlVersionAtLeast(codeql, CODEQL_VERSION_LANGUAGE_ALIASING)
|
||||
) {
|
||||
return ["--extractor-include-aliases"];
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
async function isSublanguageFileCoverageEnabled(
|
||||
config: Config,
|
||||
codeql: CodeQL,
|
||||
|
||||
Reference in New Issue
Block a user