Skip to content

Commit

Permalink
Fixing linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
muiriswoulfe authored Jun 15, 2024
1 parent 641ce49 commit 3ce5f42
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 27 deletions.
6 changes: 3 additions & 3 deletions src/task/src/git/octokitGitDiffParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ export default class OctokitGitDiffParser {
// For an added or changed file, add the file path and the first changed line.
const fileCasted: AddedFile | ChangedFile = file
const chunk: AnyChunk | undefined = fileCasted.chunks[0]
if (chunk?.type === 'BinaryFilesChunk') {
if (chunk?.type === 'BinaryFilesChunk') {
console.log(`Skipping '${file.type}' '${fileCasted.path}' while performing diff parsing.`)
this._logger.logDebug(`Skipping '${file.type}' '${fileCasted.path}' while performing diff parsing.`)
break
this._logger.logDebug(`Skipping '${file.type}' '${fileCasted.path}' while performing diff parsing.`)
break
}

result.set(fileCasted.path, chunk?.toFileRange.start!)
Expand Down
2 changes: 1 addition & 1 deletion src/task/src/repos/tokenManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export default class TokenManager {

const result: string = accessTokenResult.stdout.trim()
this._runnerInvoker.setSecret(result)
return result;
return result
}

private async getFederatedToken (workloadIdentityFederation: string) : Promise<string> {
Expand Down
2 changes: 1 addition & 1 deletion src/task/src/wrappers/azureDevOpsApiWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default class AzureDevOpsApiWrapper {
* @param token The Azure DevOps API token.
* @returns The handler.
*/
public getHandlerFromToken(token: string): IRequestHandler {
public getHandlerFromToken (token: string): IRequestHandler {
return azureDevOpsApi.getHandlerFromToken(token)
}

Expand Down
2 changes: 1 addition & 1 deletion src/task/src/wrappers/azurePipelinesRunnerWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default class AzurePipelinesRunnerWrapper {
* @param options The execution options.
* @returns The result of the execution.
*/
public execSync(tool: string, args: string, options: IExecOptions): IExecSyncResult {
public execSync (tool: string, args: string, options: IExecOptions): IExecSyncResult {
return taskLib.execSync(tool, args, options)
}

Expand Down
40 changes: 20 additions & 20 deletions src/task/tests/git/gitInvoker.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ describe('gitInvoker.ts', (): void => {
})
when(runnerInvoker.exec('git', 'diff --numstat --ignore-all-space origin/develop...pull/12345/merge')).thenCall(
async (_tool: string, _args: string): Promise<ExecOutput> => Promise.resolve({
exitCode: 0,
stdout: '1\t2\tFile.txt',
stderr: ''
}))
exitCode: 0,
stdout: '1\t2\tFile.txt',
stderr: ''
}))
})

afterEach((): void => {
Expand All @@ -60,10 +60,10 @@ describe('gitInvoker.ts', (): void => {
// Arrange
when(runnerInvoker.exec('git', 'rev-parse --is-inside-work-tree')).thenCall(
async (_tool: string, _args: string): Promise<ExecOutput> => Promise.resolve({
exitCode: 0,
stdout: response,
stderr: ''
}))
exitCode: 0,
stdout: response,
stderr: ''
}))
const gitInvoker: GitInvoker = new GitInvoker(instance(logger), instance(runnerInvoker))

// Act
Expand All @@ -81,10 +81,10 @@ describe('gitInvoker.ts', (): void => {
// Arrange
when(runnerInvoker.exec('git', 'rev-parse --is-inside-work-tree')).thenCall(
async (_tool: string, _args: string): Promise<ExecOutput> => Promise.resolve({
exitCode: 1,
stdout: '',
stderr: 'Failure'
}))
exitCode: 1,
stdout: '',
stderr: 'Failure'
}))
const gitInvoker: GitInvoker = new GitInvoker(instance(logger), instance(runnerInvoker))

// Act
Expand Down Expand Up @@ -378,10 +378,10 @@ describe('gitInvoker.ts', (): void => {
// Arrange
when(runnerInvoker.exec('git', 'rev-parse --branch origin/develop...pull/12345/merge')).thenCall(
async (_tool: string, _args: string): Promise<ExecOutput> => Promise.resolve({
exitCode: 1,
stdout: '',
stderr: 'fatal: ambiguous argument \'origin/develop...pull/12345/merge\': unknown revision or path not in the working tree.\n'
}))
exitCode: 1,
stdout: '',
stderr: 'fatal: ambiguous argument \'origin/develop...pull/12345/merge\': unknown revision or path not in the working tree.\n'
}))
const gitInvoker: GitInvoker = new GitInvoker(instance(logger), instance(runnerInvoker))

// Act
Expand Down Expand Up @@ -689,10 +689,10 @@ describe('gitInvoker.ts', (): void => {
// Arrange
when(runnerInvoker.exec('git', 'diff --numstat --ignore-all-space origin/develop...pull/12345/merge')).thenCall(
async (_tool: string, _args: string): Promise<ExecOutput> => Promise.resolve({
exitCode: 1,
stdout: '',
stderr: 'Failure'
}))
exitCode: 1,
stdout: '',
stderr: 'Failure'
}))
const gitInvoker: GitInvoker = new GitInvoker(instance(logger), instance(runnerInvoker))

// Act
Expand Down
2 changes: 1 addition & 1 deletion src/task/tests/repos/tokenManager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ describe('tokenManager.ts', (): void => {
// Arrange
const tokenManager: TokenManager = new TokenManager(instance(azureDevOpsApiWrapper), instance(logger), instance(runnerInvoker))
when(runnerInvoker.getEndpointAuthorizationScheme('Id')).thenReturn('Other')
when(runnerInvoker.loc('repos.tokenManager.incorrectAuthorizationScheme', 'WorkloadIdentityFederation', 'Other')).thenReturn('Authorization scheme of workload identity federation \'Id\' must be \'WorkloadIdentityFederation\' instead of \'Other\'.');
when(runnerInvoker.loc('repos.tokenManager.incorrectAuthorizationScheme', 'WorkloadIdentityFederation', 'Other')).thenReturn('Authorization scheme of workload identity federation \'Id\' must be \'WorkloadIdentityFederation\' instead of \'Other\'.')

// Act
const result: string | null = await tokenManager.getToken()
Expand Down

0 comments on commit 3ce5f42

Please sign in to comment.