Permalink
Cannot retrieve contributors at this time
47 lines (47 sloc)
1.59 KB
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
codeql-action/lib/languages.js
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
Object.defineProperty(exports, "__esModule", { value: true }); | |
exports.isScannedLanguage = exports.isTracedLanguage = exports.parseLanguage = exports.Language = void 0; | |
// All the languages supported by CodeQL | |
var Language; | |
(function (Language) { | |
Language["csharp"] = "csharp"; | |
Language["cpp"] = "cpp"; | |
Language["go"] = "go"; | |
Language["java"] = "java"; | |
Language["javascript"] = "javascript"; | |
Language["python"] = "python"; | |
Language["ruby"] = "ruby"; | |
})(Language = exports.Language || (exports.Language = {})); | |
// Additional names for languages | |
const LANGUAGE_ALIASES = { | |
c: Language.cpp, | |
"c++": Language.cpp, | |
"c#": Language.csharp, | |
typescript: Language.javascript, | |
}; | |
// Translate from user input or GitHub's API names for languages to CodeQL's names for languages | |
function parseLanguage(language) { | |
// Normalise to lower case | |
language = language.toLowerCase(); | |
// See if it's an exact match | |
if (language in Language) { | |
return language; | |
} | |
// Check language aliases | |
if (language in LANGUAGE_ALIASES) { | |
return LANGUAGE_ALIASES[language]; | |
} | |
return undefined; | |
} | |
exports.parseLanguage = parseLanguage; | |
function isTracedLanguage(language) { | |
return (["cpp", "java", "csharp"].includes(language) || | |
(process.env["CODEQL_EXTRACTOR_GO_BUILD_TRACING"] === "on" && | |
language === Language.go)); | |
} | |
exports.isTracedLanguage = isTracedLanguage; | |
function isScannedLanguage(language) { | |
return !isTracedLanguage(language); | |
} | |
exports.isScannedLanguage = isScannedLanguage; | |
//# sourceMappingURL=languages.js.map |