Skip to content

Commit

Permalink
Fix codeql warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoH2O1999 committed Dec 16, 2023
1 parent a806b58 commit 9745cff
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/generate_tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ core.info(`Updating ${jsonPath}`);

updateJson().then((jsonString) => {
fs.writeFileSync(jsonPath, jsonString)
})
});
6 changes: 3 additions & 3 deletions src/builder/__tests__/builder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ describe('class Builder', () => {
try {
await builder['prepareSources']();
} catch (error) {
null;
/* nop */
}

expect(mockedTc.downloadTool).toBeCalledWith('zipballUrl');
Expand All @@ -317,7 +317,7 @@ describe('class Builder', () => {
try {
await builder['prepareSources']();
} catch (error) {
null;
/* nop */
}

expect(mockedTc.extractZip).toBeCalledWith('downloadPath');
Expand All @@ -332,7 +332,7 @@ describe('class Builder', () => {
try {
await builder['prepareSources']();
} catch (error) {
null;
/* nop */
}

expect(mockedIo.rmRF).toBeCalledWith('downloadPath');
Expand Down
8 changes: 3 additions & 5 deletions src/builder/__tests__/builders.fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,8 @@ export async function mockToolkit(
mockedIo.rmRF.mockImplementation(async inputPath => {
interactionVector.push(`Recursively remove path ${inputPath}`);
});
mockedIo.cp.mockImplementation(async (source, dest, options) => {
if (!options) {
options = {};
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
mockedIo.cp.mockImplementation(async (source, dest, _options) => {
interactionVector.push(`Copy folder ${source} to ${dest}`);
});
mockedIo.mkdirP.mockImplementation(async fsPath => {
Expand Down Expand Up @@ -185,7 +183,7 @@ export async function mockToolkit(
if (!options) {
options = {};
}
if (options && options.listeners && options.listeners.stdout) {
if (options.listeners && options.listeners.stdout) {
options.listeners.stdout(Buffer.from(`${command} ${args.join(' ')}`));
}
interactionVector.push(`Execute command "${command} ${args.join(' ')}"`);
Expand Down
2 changes: 1 addition & 1 deletion src/builder/__tests__/darwin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe.each(getTags())(
try {
await builder.build();
} catch (error) {
null;
/* nop */
}

expect(mockedTc.downloadTool).toBeCalledWith(zipBall);
Expand Down
2 changes: 1 addition & 1 deletion src/builder/__tests__/linux.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe.each(getTags())(
try {
await builder.build();
} catch (error) {
null;
/* nop */
}

expect(mockedTc.downloadTool).toBeCalledWith(zipBall);
Expand Down
2 changes: 1 addition & 1 deletion src/builder/__tests__/windows.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe.each(getTags())(
try {
await builder.build();
} catch (error) {
null;
/* nop */
}

expect(mockedTc.downloadTool).toBeCalledWith(zipBall);
Expand Down

0 comments on commit 9745cff

Please sign in to comment.