Skip to content

Commit 03d9f05

Browse files
committed
♻️ Apply Qodana suggestions
1 parent efcec05 commit 03d9f05

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

common/qodana.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export function isExecutionSuccessful(exitCode: number): boolean {
8181
}
8282

8383
/**
84-
* Finds the wanted argument value in the given args, if there is one.
84+
* Finds the wanted argument value in the given args if there is one.
8585
* @param argShort the short argument name.
8686
* @param argLong the long argument name.
8787
* @param args command arguments.
@@ -256,9 +256,11 @@ export function getQodanaSha256MismatchMessage(
256256
* @param branchName the branch name to sanitize.
257257
*/
258258
export function validateBranchName(branchName: string): string {
259-
const validBranchNameRegex = /^[a-zA-Z0-9/\-_]+$/;
259+
const validBranchNameRegex = /^[a-zA-Z0-9/\-_]+$/
260260
if (!validBranchNameRegex.test(branchName)) {
261-
throw new Error("Invalid branch name: not allowed characters are used:" + branchName);
261+
throw new Error(
262+
`Invalid branch name: not allowed characters are used: ${branchName}`
263+
)
262264
}
263-
return branchName;
265+
return branchName
264266
}

scan/dist/index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -24436,7 +24436,9 @@ function getQodanaSha256MismatchMessage(expected, actual) {
2443624436
function validateBranchName(branchName) {
2443724437
const validBranchNameRegex = /^[a-zA-Z0-9/\-_]+$/;
2443824438
if (!validBranchNameRegex.test(branchName)) {
24439-
throw new Error("Invalid branch name: not allowed characters are used:" + branchName);
24439+
throw new Error(
24440+
`Invalid branch name: not allowed characters are used: ${branchName}`
24441+
);
2444024442
}
2444124443
return branchName;
2444224444
}

vsts/QodanaScan/index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,9 @@ function getQodanaSha256MismatchMessage(expected, actual) {
197197
function validateBranchName(branchName) {
198198
const validBranchNameRegex = /^[a-zA-Z0-9/\-_]+$/;
199199
if (!validBranchNameRegex.test(branchName)) {
200-
throw new Error("Invalid branch name: not allowed characters are used:" + branchName);
200+
throw new Error(
201+
`Invalid branch name: not allowed characters are used: ${branchName}`
202+
);
201203
}
202204
return branchName;
203205
}

0 commit comments

Comments
 (0)