Documentation
¶
Overview ¶
Package stickler is the gomatic lint runner: it executes a set of analyzer tools (the yze suite, golangci-lint, and others) to completion, normalizes their findings into one diagnostic schema, and reports pass/fail via the process exit code. Any finding or any tool error is a stickler failure.
Index ¶
Constants ¶
const ( // ErrYzeFailed reports that the yze aggregator could not be run or parsed. ErrYzeFailed errs.Const = "yze runner failed" // ErrGolangciFailed reports that golangci-lint could not be run or parsed. ErrGolangciFailed errs.Const = "golangci-lint runner failed" )
Runner failures.
const ErrRunner errs.Const = "lint runner failed"
ErrRunner wraps a failure from one tool runner, tagged with the runner name.
const ErrUnknownOutput errs.Const = "unknown output format"
ErrUnknownOutput reports an output format stickler does not support.
Variables ¶
This section is empty.
Functions ¶
func ExecCommand ¶
ExecCommand is the default Command, executing a real subprocess.
Types ¶
type Command ¶
Command runs an external tool and returns its stdout. A non-nil error includes a non-zero exit; callers that can still parse the stdout (linters exit non-zero when they report findings) treat the output as authoritative.
type OutputFormat ¶
type OutputFormat string
OutputFormat names how a Result is rendered.
const ( OutputHuman OutputFormat = "human" OutputJSON OutputFormat = "json" OutputGitHub OutputFormat = "github" )
The output formats stickler supports.
type Result ¶
type Result struct {
Diagnostics []goyze.Diagnostic
Errors []error
}
Result aggregates every runner's findings and failures from one stickler pass.
func Orchestrate ¶
Orchestrate runs every runner to completion over root, collecting all diagnostics and wrapping any runner error with its name. One runner's failure never prevents the others from running.
type Runner ¶
type Runner interface {
Name() string
Run(ctx context.Context, root string) ([]goyze.Diagnostic, error)
}
Runner executes one analyzer tool over a root directory and returns its findings as normalized diagnostics.
func NewGolangciRunner ¶
NewGolangciRunner builds a Runner that invokes golangci-lint.
func NewYzeRunner ¶
NewYzeRunner builds a Runner that invokes the yze aggregator.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
stickler
command
Command stickler is the gomatic lint runner: it executes the yze suite and golangci-lint to completion, normalizes their findings, writes them to stderr in the chosen format, and exits non-zero if any finding or tool error occurred.
|
Command stickler is the gomatic lint runner: it executes the yze suite and golangci-lint to completion, normalizes their findings, writes them to stderr in the chosen format, and exits non-zero if any finding or tool error occurred. |