output

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatJSON

func FormatJSON(w io.Writer, output ReviewOutput) error

FormatJSON serializes ReviewOutput as JSON and writes to w.

func FormatPatch

func FormatPatch(w io.Writer, diff string) error

FormatPatch writes the raw unified diff to w.

func FormatSummary

func FormatSummary(w io.Writer, output ReviewOutput) error

FormatSummary writes a human-readable summary to w.

func ShortAuthor added in v0.3.0

func ShortAuthor(arn string) string

ShortAuthor extracts the username from an ARN (last segment after /).

Types

type Comment

type Comment struct {
	CommentId string `json:"commentId"`
	InReplyTo string `json:"inReplyTo,omitempty"`
	Author    string `json:"author"`
	AuthorARN string `json:"authorArn"`
	Content   string `json:"content"`
	Timestamp string `json:"timestamp"`
	FilePath  string `json:"filePath,omitempty"`
}

Comment is the JSON-serializable representation of a PR comment.

type PRMetadata

type PRMetadata struct {
	PRId              string `json:"prId"`
	Title             string `json:"title"`
	Description       string `json:"description"`
	Author            string `json:"author"`
	AuthorARN         string `json:"authorArn"`
	SourceBranch      string `json:"sourceBranch"`
	DestinationBranch string `json:"destinationBranch"`
	Status            string `json:"status"`
	CreationDate      string `json:"creationDate"`
}

PRMetadata is the JSON-serializable representation of PR metadata.

type ReviewOutput

type ReviewOutput struct {
	Metadata PRMetadata `json:"metadata"`
	Comments []Comment  `json:"comments"`
	Diff     string     `json:"diff"`
}

ReviewOutput is the top-level structure for JSON output combining PR metadata, comments, and diff.

Jump to

Keyboard shortcuts

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