render

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package render handles formatting and output of PR status, issue warnings, and related PR lists in table and JSON formats with optional ANSI colors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatError

func FormatError(msg string, useColor bool) string

FormatError formats an error message with red color if color is enabled.

Types

type IssueWarning

type IssueWarning struct {
	Number int
	Title  string
	// State is "open", "closed", or "draft"
	State      string
	URL        string
	RelatedPRs []github.RelatedPR
}

IssueWarning contains information for formatting an issue-not-PR warning.

type Renderer

type Renderer struct {
	// contains filtered or unexported fields
}

Renderer outputs PR status in various formats.

func NewRenderer

func NewRenderer(writer io.Writer, useColor bool, useHyperlinks bool) *Renderer

NewRenderer creates a new Renderer with the given output settings. Nerd Font icons are enabled by default; set NO_NERD_FONTS=1 to disable.

func (*Renderer) RenderIssueWarning

func (r *Renderer) RenderIssueWarning(info IssueWarning) error

RenderIssueWarning outputs a warning that the input was an issue, not a PR. It renders the issue with appropriate icons/colors and lists related PRs in a table.

func (*Renderer) RenderJSON

func (r *Renderer) RenderJSON(status *core.PRStatus) error

RenderJSON outputs the PR status as pretty-printed JSON.

func (*Renderer) RenderTable

func (r *Renderer) RenderTable(status *core.PRStatus) error

RenderTable outputs the PR status as a formatted ASCII table.

Jump to

Keyboard shortcuts

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