reporter

package
v0.1.42 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONReporter added in v0.0.3

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

JSONReporter is a reporter that writes JSON to an io.Writer.

func NewJSONReporter added in v0.0.3

func NewJSONReporter(writer io.Writer) *JSONReporter

NewJSONReporter creates a new JSONReporter.

func (*JSONReporter) Report added in v0.0.3

func (r *JSONReporter) Report(violations []katas.Violation) error

Report prints the violations to the writer as a JSON array.

type Reporter

type Reporter interface {
	Report(violations []katas.Violation) error
}

Reporter defines the interface for reporting violations.

type SarifArtifactLocation added in v0.0.123

type SarifArtifactLocation struct {
	URI string `json:"uri"`
}

type SarifDriver added in v0.0.123

type SarifDriver struct {
	Name            string      `json:"name"`
	InformationURI  string      `json:"informationUri"`
	SemanticVersion string      `json:"semanticVersion"`
	Rules           []SarifRule `json:"rules"`
}

type SarifLocation added in v0.0.123

type SarifLocation struct {
	PhysicalLocation SarifPhysicalLocation `json:"physicalLocation"`
}

type SarifMessage added in v0.0.123

type SarifMessage struct {
	Text string `json:"text"`
}

type SarifPhysicalLocation added in v0.0.123

type SarifPhysicalLocation struct {
	ArtifactLocation SarifArtifactLocation `json:"artifactLocation"`
	Region           SarifRegion           `json:"region"`
}

type SarifRegion added in v0.0.123

type SarifRegion struct {
	StartLine   int `json:"startLine"`
	StartColumn int `json:"startColumn"`
}

type SarifReport added in v0.0.123

type SarifReport struct {
	Version string     `json:"version"`
	Schema  string     `json:"$schema"`
	Runs    []SarifRun `json:"runs"`
}

type SarifReporter added in v0.0.123

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

SarifReporter reports violations in SARIF format.

func NewSarifReporter added in v0.0.123

func NewSarifReporter(writer io.Writer, filename string) *SarifReporter

NewSarifReporter creates a new SarifReporter.

func (*SarifReporter) Report added in v0.0.123

func (r *SarifReporter) Report(violations []katas.Violation) error

Report prints the violations to the writer in SARIF format.

type SarifResult added in v0.0.123

type SarifResult struct {
	RuleID    string          `json:"ruleId"`
	Level     string          `json:"level"` // error, warning, note
	Message   SarifMessage    `json:"message"`
	Locations []SarifLocation `json:"locations"`
}

type SarifRule added in v0.0.123

type SarifRule struct {
	ID               string       `json:"id"`
	Name             string       `json:"name"`
	ShortDescription SarifMessage `json:"shortDescription"`
	FullDescription  SarifMessage `json:"fullDescription"`
	HelpURI          string       `json:"helpUri"`
}

type SarifRun added in v0.0.123

type SarifRun struct {
	Tool    SarifTool     `json:"tool"`
	Results []SarifResult `json:"results"`
}

type SarifTool added in v0.0.123

type SarifTool struct {
	Driver SarifDriver `json:"driver"`
}

type TextReporter

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

TextReporter is a simple reporter that writes plain text to an io.Writer.

func NewTextReporter

func NewTextReporter(writer io.Writer, filename, source string, config config.Config) *TextReporter

NewTextReporter creates a new TextReporter.

func (*TextReporter) Report

func (r *TextReporter) Report(violations []katas.Violation) error

Report prints the violations to the writer.

Jump to

Keyboard shortcuts

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