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.
Click to show internal directories.
Click to hide internal directories.