output

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Formatter

type Formatter interface {
	Format(w io.Writer, diagnostics []lint.Diagnostic) error
}

Formatter defines the interface for outputting diagnostics.

type JSONFormatter

type JSONFormatter struct{}

JSONFormatter outputs diagnostics as a JSON array.

func (*JSONFormatter) Format

func (f *JSONFormatter) Format(w io.Writer, diagnostics []lint.Diagnostic) error

Format writes diagnostics as a pretty-printed JSON array. An empty slice of diagnostics produces [].

type TextFormatter

type TextFormatter struct {
	Color bool
}

TextFormatter outputs diagnostics in human-readable text format. When Color is true, the file location is printed in cyan and the rule ID in yellow.

func (*TextFormatter) Format

func (f *TextFormatter) Format(w io.Writer, diagnostics []lint.Diagnostic) error

Format writes each diagnostic as a header line followed by an optional source snippet with line-number gutter and caret marker.

Jump to

Keyboard shortcuts

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