render

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package render produces the colored terminal output: summary section, format tables, legend, and the extensionless-file list.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectThemeName

func DetectThemeName() string

DetectThemeName picks "dark" or "light" from the COLORFGBG environment variable ("fg;bg"). Backgrounds 7, 15, and 9-14 indicate a light terminal; anything else (or no clear signal) defaults to dark.

func FormatError

func FormatError(colored bool, theme config.Theme, format string, args ...interface{}) string

FormatError renders one stderr error line: "error: <message>\n". When colored is true (stderr is a TTY and --colors is true), the "error:" prefix carries the theme's error color (R30); otherwise the result is plain text, byte-identical to non-TTY output.

func Render

func Render(w io.Writer, res *scan.Result, opts Options)

Render writes the full table-mode output for a scan result.

Types

type Options

type Options struct {
	Show       string // "summary", "table", or "both"
	Combined   bool
	Collapse   bool // --singletons collapse
	SortBy     []string
	SortDesc   bool
	Top        int
	ListNoExt  bool
	Legend     bool
	Colors     bool // effective: flag AND stdout is a TTY
	Human      bool
	Style      string // "unicode" or "ascii"
	TypeFilter string
	Stats      []string // selected stat names in canonical column order
	Width      int      // terminal width (80 when colors are inactive)
	Theme      config.Theme
	Config     string // absolute path of the scan config file; "" = none (R46)
}

Options controls table rendering. All fields are presentation-only and never affect JSON output.

Jump to

Keyboard shortcuts

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