diff --git a/common/qodana.ts b/common/qodana.ts index 0184ce34..17ac75d1 100644 --- a/common/qodana.ts +++ b/common/qodana.ts @@ -81,7 +81,7 @@ export function isExecutionSuccessful(exitCode: number): boolean { } /** - * Finds the wanted argument value in the given args, if there is one. + * Finds the wanted argument value in the given args if there is one. * @param argShort the short argument name. * @param argLong the long argument name. * @param args command arguments. @@ -256,9 +256,11 @@ export function getQodanaSha256MismatchMessage( * @param branchName the branch name to sanitize. */ export function validateBranchName(branchName: string): string { - const validBranchNameRegex = /^[a-zA-Z0-9/\-_]+$/; + const validBranchNameRegex = /^[a-zA-Z0-9/\-_]+$/ if (!validBranchNameRegex.test(branchName)) { - throw new Error("Invalid branch name: not allowed characters are used:" + branchName); + throw new Error( + `Invalid branch name: not allowed characters are used: ${branchName}` + ) } - return branchName; + return branchName } diff --git a/scan/dist/index.js b/scan/dist/index.js index 78a287e9..fdf309c6 100644 --- a/scan/dist/index.js +++ b/scan/dist/index.js @@ -24436,7 +24436,9 @@ function getQodanaSha256MismatchMessage(expected, actual) { function validateBranchName(branchName) { const validBranchNameRegex = /^[a-zA-Z0-9/\-_]+$/; if (!validBranchNameRegex.test(branchName)) { - throw new Error("Invalid branch name: not allowed characters are used:" + branchName); + throw new Error( + `Invalid branch name: not allowed characters are used: ${branchName}` + ); } return branchName; } diff --git a/vsts/QodanaScan/index.js b/vsts/QodanaScan/index.js index e4db28ad..9a4eba35 100644 --- a/vsts/QodanaScan/index.js +++ b/vsts/QodanaScan/index.js @@ -197,7 +197,9 @@ function getQodanaSha256MismatchMessage(expected, actual) { function validateBranchName(branchName) { const validBranchNameRegex = /^[a-zA-Z0-9/\-_]+$/; if (!validBranchNameRegex.test(branchName)) { - throw new Error("Invalid branch name: not allowed characters are used:" + branchName); + throw new Error( + `Invalid branch name: not allowed characters are used: ${branchName}` + ); } return branchName; }