lint

package
v1.21.21 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name:     "clickylint",
	Doc:      "detects bad usage patterns of the clicky text API and render builders",
	Run:      run,
	Requires: []*analysis.Analyzer{inspect.Analyzer},
}

Functions

func RuleForMessage

func RuleForMessage(message string) string

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) HasIssues

func (r *Result) HasIssues() bool

HasIssues reports whether the lint run found diagnostics or execution errors.

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 SummaryView

type SummaryView struct {
	Result *Result `json:"result"`
	Limit  int     `json:"-"`
}

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"`
	Rule    string `json:"rule,omitempty"`
	Message string `json:"message,omitempty"`
}

Violation is a display-oriented analysis diagnostic.

Jump to

Keyboard shortcuts

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