Improve variable name

This commit is contained in:
Henry Mercer 2022-09-13 16:50:41 +01:00
parent bde5694fb7
commit 4cc95769d4
3 changed files with 13 additions and 13 deletions

12
lib/autobuild.js generated
View file

@ -61,16 +61,16 @@ async function determineAutobuildLanguages(config, featureFlags, logger) {
* This special case behavior should be removed as part of the next major
* version of the CodeQL Action.
*/
const autobuildLanguagesNoGo = autobuildLanguages.filter((l) => l !== languages_1.Language.go);
const autobuildLanguagesWithoutGo = autobuildLanguages.filter((l) => l !== languages_1.Language.go);
const languages = [];
// First run the autobuilder for the first non-Go traced language, if one
// exists.
if (autobuildLanguagesNoGo[0] !== undefined) {
languages.push(autobuildLanguagesNoGo[0]);
if (autobuildLanguagesWithoutGo[0] !== undefined) {
languages.push(autobuildLanguagesWithoutGo[0]);
}
// If Go is requested, run the Go autobuilder last to ensure it doesn't
// interfere with the other autobuilder.
if (autobuildLanguages.length !== autobuildLanguagesNoGo.length) {
if (autobuildLanguages.length !== autobuildLanguagesWithoutGo.length) {
languages.push(languages_1.Language.go);
}
logger.debug(`Will autobuild ${languages.join(" and ")}.`);
@ -81,8 +81,8 @@ async function determineAutobuildLanguages(config, featureFlags, logger) {
// categories, potentially leading to a "stale tips" situation where alerts
// that should be fixed remain on a repo since they are linked to SARIF
// categories that are no longer updated.
if (autobuildLanguagesNoGo.length > 1) {
logger.warning(`We will only automatically build ${languages.join(" and ")} code. If you wish to scan ${autobuildLanguagesNoGo
if (autobuildLanguagesWithoutGo.length > 1) {
logger.warning(`We will only automatically build ${languages.join(" and ")} code. If you wish to scan ${autobuildLanguagesWithoutGo
.slice(1)
.join(" and ")}, you must replace this call with custom build steps.`);
}