ui

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package ui renders findings and layouts as terminal output (unified / side-by-side / proposed-only diffs and annotated layout). It is the only package that produces user-facing text.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolveWidth

func ResolveWidth(out *os.File) int

ResolveWidth returns the default per-side column width for side-by-side diff, derived from the terminal attached to out (falling back to $COLUMNS, then 80).

func WantColor

func WantColor(mode string, out *os.File) bool

WantColor resolves the -color mode ("auto"|"always"|"never") against out.

Types

type Printer

type Printer struct {
	Out   io.Writer
	Color bool
	Width int // per-side column width for side-by-side diffs
}

Printer renders to Out using the given color/width settings.

func (*Printer) RenderFindings

func (p *Printer) RenderFindings(findings []common.Finding, style common.DiffStyle) int

RenderFindings renders each finding in the chosen diff style. Returns the count.

func (*Printer) RenderLayouts

func (p *Printer) RenderLayouts(layouts []common.Layout, verbose, keepTags bool) int

RenderLayouts renders each struct layout. Returns the count.

Jump to

Keyboard shortcuts

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