reporter

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package reporter provides a reporter for linting issues.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Issue

type Issue struct {
	Rule     string    `json:"rule"`
	Message  string    `json:"message"`
	Range    ast.Range `json:"range"`
	Severity Severity  `json:"severity"`
}

Issue represents a linting issue found in the code.

type Reporter

type Reporter struct {
	// contains filtered or unexported fields
}

Reporter represents a reporter for linting issues.

func NewReporter

func NewReporter(outFile io.Writer) *Reporter

NewReporter creates a new reporter.

func (*Reporter) AddIssue

func (r *Reporter) AddIssue(issue *Issue)

AddIssue adds an issue to the reporter.

func (*Reporter) GetIssues

func (r *Reporter) GetIssues() []*Issue

GetIssues returns all issues.

func (*Reporter) HasIssues

func (r *Reporter) HasIssues() bool

HasIssues returns true if there are any issues.

func (*Reporter) PrintIssues

func (r *Reporter) PrintIssues(filename string)

PrintIssues prints all issues to the output file.

type Severity

type Severity int

Severity represents the severity level of a linting issue.

const (
	// SeverityError represents an error-level issue.
	SeverityError Severity = iota
	// SeverityWarning represents a warning-level issue.
	SeverityWarning
	// SeverityInfo represents an info-level issue.
	SeverityInfo
)

func (Severity) String

func (s Severity) String() string

String returns the string representation of the severity.

Jump to

Keyboard shortcuts

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