reporter

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package reporter provides output formatting for lint results.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSON

type JSON struct {
	Writer io.Writer
	Pretty bool
}

JSON outputs results in JSON format for CI integration.

func NewJSON

func NewJSON() *JSON

NewJSON creates a JSON reporter writing to stdout.

func (*JSON) Report

func (j *JSON) Report(results []rules.Result) error

Report outputs results as JSON.

type JSONOutput

type JSONOutput struct {
	Results []JSONResult `json:"results"`
	Summary Summary      `json:"summary"`
}

JSONOutput is the top-level JSON structure.

type JSONResult

type JSONResult struct {
	Rule     string `json:"rule"`
	Message  string `json:"message"`
	Filename string `json:"filename"`
	Line     int    `json:"line"`
	Column   int    `json:"column"`
	Severity string `json:"severity"`
}

JSONResult is the JSON representation of a lint result.

type Reporter

type Reporter interface {
	Report(results []rules.Result) error
}

Reporter defines the interface for outputting lint results.

type Summary

type Summary struct {
	Total    int `json:"total"`
	Errors   int `json:"errors"`
	Warnings int `json:"warnings"`
	Info     int `json:"info"`
}

Summary contains aggregate counts.

type Text

type Text struct {
	Writer    io.Writer
	NoColor   bool
	ShowRules bool // Include rule name in output
}

Text outputs human-readable lint results.

func NewText

func NewText() *Text

NewText creates a text reporter writing to stdout.

func (*Text) Report

func (t *Text) Report(results []rules.Result) error

Report outputs results in human-readable format.

Jump to

Keyboard shortcuts

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