Rename resolveQuerySuiteAlias parameter

This commit is contained in:
Michael B. Gale 2025-06-26 11:32:48 +01:00
parent 79049d92c6
commit 768fc170da
No known key found for this signature in database
GPG key ID: FF5E2765BD00628F
3 changed files with 15 additions and 15 deletions

14
lib/analyze.js generated
View file

@ -395,18 +395,18 @@ exports.defaultSuites = new Set([
"code-scanning", "code-scanning",
]); ]);
/** /**
* If `query` is the name of a default query suite, it is resolved into the corresponding * If `maybeSuite` is the name of a default query suite, it is resolved into the corresponding
* query suite name for the given `language`. Otherwise, `query` is returned as is. * query suite name for the given `language`. Otherwise, `maybeSuite` is returned as is.
* *
* @param language The language for which to resolve the default query suite name. * @param language The language for which to resolve the default query suite name.
* @param query The string that potentially contains the name of a default query suite. * @param maybeSuite The string that potentially contains the name of a default query suite.
* @returns Returns the resolved query suite name, or the unmodified input. * @returns Returns the resolved query suite name, or the unmodified input.
*/ */
function resolveQuerySuiteAlias(language, query) { function resolveQuerySuiteAlias(language, maybeSuite) {
if (exports.defaultSuites.has(query)) { if (exports.defaultSuites.has(maybeSuite)) {
return `${language}-${query}.qls`; return `${language}-${maybeSuite}.qls`;
} }
return query; return maybeSuite;
} }
// Runs queries and creates sarif files in the given folder // Runs queries and creates sarif files in the given folder
async function runQueries(sarifFolder, memoryFlag, addSnippetsFlag, threadsFlag, cleanupLevel, diffRangePackDir, automationDetailsId, config, logger, features) { async function runQueries(sarifFolder, memoryFlag, addSnippetsFlag, threadsFlag, cleanupLevel, diffRangePackDir, automationDetailsId, config, logger, features) {

File diff suppressed because one or more lines are too long

View file

@ -571,22 +571,22 @@ export const defaultSuites: Set<string> = new Set([
]); ]);
/** /**
* If `query` is the name of a default query suite, it is resolved into the corresponding * If `maybeSuite` is the name of a default query suite, it is resolved into the corresponding
* query suite name for the given `language`. Otherwise, `query` is returned as is. * query suite name for the given `language`. Otherwise, `maybeSuite` is returned as is.
* *
* @param language The language for which to resolve the default query suite name. * @param language The language for which to resolve the default query suite name.
* @param query The string that potentially contains the name of a default query suite. * @param maybeSuite The string that potentially contains the name of a default query suite.
* @returns Returns the resolved query suite name, or the unmodified input. * @returns Returns the resolved query suite name, or the unmodified input.
*/ */
export function resolveQuerySuiteAlias( export function resolveQuerySuiteAlias(
language: Language, language: Language,
query: string, maybeSuite: string,
): string { ): string {
if (defaultSuites.has(query)) { if (defaultSuites.has(maybeSuite)) {
return `${language}-${query}.qls`; return `${language}-${maybeSuite}.qls`;
} }
return query; return maybeSuite;
} }
// Runs queries and creates sarif files in the given folder // Runs queries and creates sarif files in the given folder