runner

package
v1.5.4 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package runner provides a custom analyzer runner with statistics and exit codes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExitCode

type ExitCode int

ExitCode represents the exit code for the analyzer.

const (
	// ExitSuccess indicates no issues found
	ExitSuccess ExitCode = 0
	// ExitWarnings indicates warnings were found
	ExitWarnings ExitCode = 1
	// ExitErrors indicates errors were found
	ExitErrors ExitCode = 2
	// ExitFailure indicates analysis failed
	ExitFailure ExitCode = 3
)

func Run

func Run(analyzer *analysis.Analyzer, output *cli.Output, showStats bool) ExitCode

Run executes the analyzer with statistics collection and proper exit codes.

type Statistics

type Statistics struct {
	FilesAnalyzed   int
	PackagesLoaded  int
	TotalIssues     int
	Errors          int
	Warnings        int
	ByType          map[string]int
	Duration        time.Duration
	FilesWithIssues map[string]int
	StartTime       time.Time
}

Statistics holds analysis statistics.

func NewStatistics

func NewStatistics() *Statistics

NewStatistics creates a new Statistics instance.

func (*Statistics) AddDiagnostic

func (s *Statistics) AddDiagnostic(d analysis.Diagnostic, fset *token.FileSet, severity string)

AddDiagnostic adds a diagnostic to statistics.

func (*Statistics) Finalize

func (s *Statistics) Finalize()

Finalize completes the statistics.

Jump to

Keyboard shortcuts

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