Help us shape the future of Go! Take the 2026 Go Developer Survey

cli

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidOptions = errors.New("invalid lint options")

Functions

func Doctor

func Doctor(ctx context.Context, output io.Writer, provider, tokenEnv string) error

Doctor checks local Git and credential presence. It never makes HTTP calls or prints token values, source, endpoint URLs, or repository content.

func ExitCode

func ExitCode(err error) int

ExitCode classifies errors without exposing their potentially untrusted text.

func ExitMessage

func ExitMessage(code int) string

func NewRoot

func NewRoot(lint LintFunc, version string) *cobra.Command

NewRoot constructs the executable command tree without opening files or constructing a provider. Later commands can be added at this boundary.

Types

type LintFunc

type LintFunc func(context.Context, Options, io.Writer, io.Writer) error

LintFunc receives parsed process options and the command's output streams.

type LookupEnv

type LookupEnv func(string) (string, bool)

type Options

type Options struct {
	Base, Head, Provider, Model, Rules, Out string
	BaseURL, AuthTokenEnv                   string
	Format                                  report.Format
	FailOn                                  report.Threshold
	Limits                                  app.Limits
	Metrics                                 bool
}

func Resolve

func Resolve(raw RawOptions, lookup LookupEnv) (Options, error)

Resolve uses flag > LINTPAL_* environment > default precedence. Rule YAML never enters this function, so it cannot choose an endpoint or token source.

type RawOptions

type RawOptions struct {
	Base, Head, Provider, Model, Rules, Format, Out, FailOn string
	Timeout, MaxConcurrency, BaseURL, AuthTokenEnv          string
	Metrics                                                 bool
	Changed                                                 map[string]bool
}

RawOptions contains only process-owned flag values. Changed distinguishes an explicit empty flag from an absent flag when environment values are present.

Jump to

Keyboard shortcuts

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