review

package
v0.0.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateCommentsFromDiff

func GenerateCommentsFromDiff(ctx context.Context, openAIClient Completer, diff *github.CommitsComparison) ([]*github.PullRequestComment, error)

func PushComments

func PushComments(ctx context.Context, prUpdated PullRequestUpdater, owner, repo string, number int, comments []*github.PullRequestComment) error

Types

type Completer

type Completer interface {
	ChatCompletion(ctx context.Context, messages []openai.ChatCompletionMessage) (string, error)
}

type Issue

type Issue struct {
	Type        string `json:"type"`
	Line        int    `json:"line"`
	Description string `json:"description"`
}

type PullRequestUpdater

type PullRequestUpdater interface {
	CreatePullRequestComment(ctx context.Context, owner, repo string, number int, comment *github.PullRequestComment) (*github.PullRequestComment, error)
}

type Quality

type Quality string
const (
	Good    Quality = "good"
	Bad     Quality = "bad"
	Neutral Quality = "neutral"
)

type Review

type Review struct {
	Quality Quality `json:"quality"`
	Issues  []Issue `json:"issues"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL