Skip to content

Commit

Permalink
fix: format errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Ma11hewThomas committed Dec 7, 2024
1 parent ba8a163 commit 6f168b4
Show file tree
Hide file tree
Showing 14 changed files with 182 additions and 164 deletions.
1 change: 0 additions & 1 deletion __tests__/ctrf/helpers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,3 @@ describe('stripAnsi', () => {
expect(() => stripAnsi({})).toThrow(TypeError)
})
})

2 changes: 1 addition & 1 deletion ctrf-reports/ctrf-report.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,4 @@
}
]
}
}
}
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@
},
"reporters": [
"default",
["jest-ctrf-json-reporter", {}]
[
"jest-ctrf-json-reporter",
{}
]
],
"coverageReporters": [
"json-summary",
Expand Down
3 changes: 1 addition & 2 deletions src/client/github/artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export async function downloadArtifact(downloadUrl: string): Promise<Buffer> {
responseType: 'arraybuffer'
})

return Buffer.from(artifactResponse.data as ArrayBuffer);
return Buffer.from(artifactResponse.data as ArrayBuffer)
}

/**
Expand Down Expand Up @@ -99,4 +99,3 @@ export function unzipArtifact(artifactBuffer: Buffer): CtrfReport | null {
}
return report
}

8 changes: 4 additions & 4 deletions src/client/github/issues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@ import { createGitHubClient } from '.'

/**
* Adds a comment to a specified pull request on GitHub.
*
*
* @param owner - The owner of the repository (organization or user).
* @param repo - The name of the repository.
* @param issue_number - The pull request number to which the comment will be added.
* @param body - The content of the comment to be added.
*
*
* @returns {Promise<any>} A promise that resolves to the response data from GitHub's API.
*
*
* @throws {Error} If the GitHub client fails to authenticate or the API request fails.
*/
export async function addCommentToPullRequest(
owner: string,
repo: string,
issue_number: number,
body: string
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
): Promise<any> {
const octokit = await createGitHubClient()
const response = await octokit.issues.createComment({
Expand Down
2 changes: 1 addition & 1 deletion src/client/github/workflows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export async function fetchWorkflowRuns(
repo: string,
perPage = 100,
page = 1
):Promise<WorkflowRun[]> {
): Promise<WorkflowRun[]> {
const octokit = await createGitHubClient()
const response = await octokit.actions.listWorkflowRunsForRepo({
owner,
Expand Down
11 changes: 2 additions & 9 deletions src/core/cli.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
#!/usr/bin/env node
import yargs from 'yargs/yargs'
import { hideBin } from 'yargs/helpers'
import {
exitActionOnFail,
getAllGitHubContext,
handleError,
} from '../github'
import { exitActionOnFail, getAllGitHubContext, handleError } from '../github'
import { prepareReport } from '../ctrf'
import {
handleViewsAndComments,
handleAnnotations,
} from '../github/handler'
import { handleViewsAndComments, handleAnnotations } from '../github/handler'
import { getCliInputs } from '../core/inputs'
import { context } from '@actions/github'
import { addCommentToPullRequest } from '../client/github'
Expand Down
8 changes: 7 additions & 1 deletion src/ctrf/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ import {
processArtifactsFromRuns
} from '../client/github'
import { filterWorkflowRuns } from '../github'
import { CtrfReport, TestMetrics, CtrfTest, Inputs, GitHubContext } from '../types'
import {
CtrfReport,
TestMetrics,
CtrfTest,
Inputs,
GitHubContext
} from '../types'
import {
enrichTestWithMetrics,
enrichReportSummary,
Expand Down
Loading

0 comments on commit 6f168b4

Please sign in to comment.