Skip to content

Commit

Permalink
refactor: небольшой рефакторинг имен и структуры
Browse files Browse the repository at this point in the history
  • Loading branch information
alkoleft committed Jun 4, 2024
1 parent 9faf31d commit 94b017c
Show file tree
Hide file tree
Showing 13 changed files with 281 additions and 247 deletions.
8 changes: 4 additions & 4 deletions __tests__/github.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { debug } from 'console'
import { config } from 'dotenv'

import { GithubMerge } from '../src/github'
import { GithubReview } from '../src/github'

describe('github', () => {
config()
Expand All @@ -21,15 +21,15 @@ describe('github', () => {
// })

it('getQualityDiscussion', async () => {

Check warning on line 23 in __tests__/github.test.ts

View workflow job for this annotation

GitHub Actions / TypeScript Tests

Test has no assertions
const githubMR = new GithubMerge({
const githubMR = new GithubReview({
pull_number: 9,
token: token,

Check failure on line 26 in __tests__/github.test.ts

View workflow job for this annotation

GitHub Actions / TypeScript Tests

Expected property shorthand
repo: repo

Check failure on line 27 in __tests__/github.test.ts

View workflow job for this annotation

GitHub Actions / TypeScript Tests

Expected property shorthand
})
debug(await githubMR.getQualityDiscussion())
})
it('getReviews', async () => {

Check warning on line 31 in __tests__/github.test.ts

View workflow job for this annotation

GitHub Actions / TypeScript Tests

Test has no assertions
const githubMR = new GithubMerge({
const githubMR = new GithubReview({
pull_number: 9,
token: token,

Check failure on line 34 in __tests__/github.test.ts

View workflow job for this annotation

GitHub Actions / TypeScript Tests

Expected property shorthand
repo: repo

Check failure on line 35 in __tests__/github.test.ts

View workflow job for this annotation

GitHub Actions / TypeScript Tests

Expected property shorthand
Expand All @@ -38,7 +38,7 @@ describe('github', () => {
})

it('getReviewComments', async () => {

Check warning on line 40 in __tests__/github.test.ts

View workflow job for this annotation

GitHub Actions / TypeScript Tests

Test has no assertions
const githubMR = new GithubMerge({
const githubMR = new GithubReview({
pull_number: 9,
token: token,

Check failure on line 43 in __tests__/github.test.ts

View workflow job for this annotation

GitHub Actions / TypeScript Tests

Expected property shorthand
repo: repo

Check failure on line 44 in __tests__/github.test.ts

View workflow job for this annotation

GitHub Actions / TypeScript Tests

Expected property shorthand
Expand Down
12 changes: 6 additions & 6 deletions __tests__/publisher.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { config } from 'dotenv'

import { Publisher } from '../src/publisher'
import { ReviewPublisher } from '../src/publisher/review'
import { Sonar } from '../src/sonar'
import { GithubMerge } from '../src/github'
import { GithubReview } from '../src/github'

describe('main.ts', () => {
config()
Expand All @@ -19,12 +19,12 @@ describe('main.ts', () => {
branchPluginEnabled: true,
pull_number: 370
})
const github = new GithubMerge({
const github = new GithubReview({
repo: repo,

Check failure on line 23 in __tests__/publisher.test.ts

View workflow job for this annotation

GitHub Actions / TypeScript Tests

Expected property shorthand
pull_number: 9,
token: token

Check failure on line 25 in __tests__/publisher.test.ts

View workflow job for this annotation

GitHub Actions / TypeScript Tests

Expected property shorthand
})
const publisher = new Publisher(sonar, github)
const publisher = new ReviewPublisher(sonar, github)
await publisher.generateReport()
})
it('publishIssues', async () => {

Check warning on line 30 in __tests__/publisher.test.ts

View workflow job for this annotation

GitHub Actions / TypeScript Tests

Test has no assertions
Expand All @@ -34,12 +34,12 @@ describe('main.ts', () => {
branchPluginEnabled: true,
pull_number: 370
})
const github = new GithubMerge({
const github = new GithubReview({
repo: repo,

Check failure on line 38 in __tests__/publisher.test.ts

View workflow job for this annotation

GitHub Actions / TypeScript Tests

Expected property shorthand
pull_number: 370,
token: token

Check failure on line 40 in __tests__/publisher.test.ts

View workflow job for this annotation

GitHub Actions / TypeScript Tests

Expected property shorthand
})
const publisher = new Publisher(sonar, github)
const publisher = new ReviewPublisher(sonar, github)
const status = {
projectStatus: {
status: 'UNKNOWN',
Expand Down
5 changes: 0 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ inputs:
github_token:
required: false

# Define your outputs here.
outputs:
time:
description: 'Your output description here'

runs:
using: node20
main: dist/index.js
127 changes: 76 additions & 51 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/github/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export type ReviewComments =
Endpoints['GET /repos/{owner}/{repo}/pulls/{pull_number}/comments']['response']['data']
export type ReviewComment = ReviewComments[0]

export class GithubMerge {
export class GithubReview {
pull_number: number
octokit: InstanceType<typeof GitHub>
repo: Repo
Expand Down
Loading

0 comments on commit 94b017c

Please sign in to comment.