Skip to content

Commit

Permalink
♻️ Apply Qodana suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
tiulpin committed Apr 23, 2024
1 parent efcec05 commit 03d9f05
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
10 changes: 6 additions & 4 deletions common/qodana.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
}
4 changes: 3 additions & 1 deletion scan/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 3 additions & 1 deletion vsts/QodanaScan/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 03d9f05

Please sign in to comment.