Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func RuleForMessage ¶
RuleForMessage derives a stable rule bucket from a go/analysis diagnostic.
Types ¶
type Result ¶
type Result struct {
Linter string `json:"linter"`
WorkDir string `json:"work_dir,omitempty"`
PackageCount int `json:"package_count"`
Success bool `json:"success"`
Duration time.Duration `json:"duration"`
Violations []Violation `json:"violations,omitempty"`
Errors []string `json:"errors,omitempty"`
}
Result is the normalized lint result rendered by the CLI and JSON output.
func Run ¶
func Run(opts RunOptions) (*Result, error)
Run loads the requested Go packages, runs clickylint, and returns normalized diagnostics without printing through the go/analysis default text driver.
func (*Result) ErrorCount ¶ added in v1.21.29
ErrorCount counts error-severity violations.
func (*Result) HasErrors ¶ added in v1.21.29
HasErrors reports whether the run found error-severity violations or execution errors. This — not HasIssues — drives the non-zero exit status; warnings are advisory.
func (*Result) HasIssues ¶
HasIssues reports whether the lint run found any diagnostics (error or warning) or execution errors. Used to decide whether output is worth showing.
func (*Result) WarningCount ¶ added in v1.21.29
WarningCount counts warning-severity violations.
type RunOptions ¶
type RunOptions struct {
Packages []string `json:"packages,omitempty"`
WorkDir string `json:"work_dir,omitempty"`
IncludeTests bool `json:"include_tests"`
}
RunOptions controls the standalone clickylint runner used by the clicky CLI.
type Severity ¶ added in v1.21.29
type Severity string
Severity classifies a clickylint diagnostic. Errors fail the lint run (non-zero exit); warnings are advisory and do not affect the exit status.
const ( // SeverityError marks structural violations that bypass clicky's generated // surfaces — manual cobra commands and direct HTTP handlers instead of // registered entities, or writes that corrupt the task renderer. SeverityError Severity = "error" // SeverityWarning marks advisory style preferences — how Pretty()/render // builders are written, and entities missing a TableProvider. SeverityWarning Severity = "warning" )
type SummaryView ¶
SummaryView renders clickylint results as a compact tree, matching the Gavel lint display shape: root -> linter -> rule -> affected files.
func NewSummaryView ¶
func NewSummaryView(result *Result, limit int) *SummaryView
NewSummaryView returns a tree view for a lint result.
func (*SummaryView) GetChildren ¶
func (s *SummaryView) GetChildren() []api.TreeNode
func (*SummaryView) Pretty ¶
func (s *SummaryView) Pretty() api.Text
type Violation ¶
type Violation struct {
Package string `json:"package,omitempty"`
File string `json:"file,omitempty"`
Line int `json:"line,omitempty"`
Column int `json:"column,omitempty"`
Severity Severity `json:"severity,omitempty"`
Rule string `json:"rule,omitempty"`
Message string `json:"message,omitempty"`
}
Violation is a display-oriented analysis diagnostic.