Documentation
¶
Overview ¶
Package render presents CodeSignal reports and project-readiness results as the CLI's text and JSON output.
Index ¶
- func ReadinessJSON(result *projectreadiness.Result) ([]byte, error)
- func ReadinessText(result *projectreadiness.Result) string
- func ReportJSON(report *codesignal.Report) ([]byte, error)
- func ReportText(report *codesignal.Report) string
- func ReportTextWithOptions(report *codesignal.Report, opts TextOptions) string
- type TextOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadinessJSON ¶
func ReadinessJSON(result *projectreadiness.Result) ([]byte, error)
ReadinessJSON renders result as its canonical JSON representation followed by exactly one trailing newline.
func ReadinessText ¶
func ReadinessText(result *projectreadiness.Result) string
ReadinessText renders result as deterministic, ANSI-free plain text. It encodes exactly the same status, gaps, and next actions as ReadinessJSON -- no drift between the two renderers.
func ReportJSON ¶
func ReportJSON(report *codesignal.Report) ([]byte, error)
ReportJSON renders report as its canonical JSON representation followed by exactly one trailing newline, with no CLI-only wrapper fields added.
func ReportText ¶
func ReportText(report *codesignal.Report) string
ReportText renders report as deterministic, ANSI-free plain text.
func ReportTextWithOptions ¶
func ReportTextWithOptions(report *codesignal.Report, opts TextOptions) string
ReportTextWithOptions renders like ReportText. SeeAllCommand is printed verbatim into the report, so the caller shall have already made it safe for a terminal.
Types ¶
type TextOptions ¶
type TextOptions struct {
// SeeAllCommand is the invocation that shows every signal a narrowed
// report withheld. It is text-only presentation and never enters the JSON
// report. Empty means that, when something was withheld, the line says to
// re-run without the narrowing flags in effect instead of naming a command.
SeeAllCommand string
}
TextOptions carries what only the caller knows about how a report was produced.