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

application

package
v2.0.0-...-5b9a95f Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 47 Imported by: 0

Documentation

Overview

Package application coordinates input selection, analysis and runtime ownership. It has no terminal, command parser, output destination or exit-code policy.

Index

Constants

View Source
const (
	// LogLevelNone does not output any log output.
	LogLevelNone LogLevel = 0
	// LogLevelVerbose shows verbose log output. This is equivalent to specifying -verbose option
	// to actionlint command.
	LogLevelVerbose = 1
	// LogLevelDebug shows all log output including debug information.
	LogLevelDebug = 2
)

Variables

This section is empty.

Functions

func LegacyAnalysisError

func LegacyAnalysisError(err error) error

LegacyAnalysisError preserves the root-command single-file and batch error messages.

func LoadActionCatalog

func LoadActionCatalog(data []byte) error

LoadActionCatalog installs the validated browser catalogue before analysis begins. Callers must complete bootstrap before starting concurrent sessions.

Types

type Input

type Input struct {
	Kind                 InputKind
	Paths                []string
	Directory            string
	Reader               io.Reader
	Name                 string
	NormalizePath        bool
	AllowEmptyRepository bool
	// contains filtered or unexported fields
}

Input describes where sources come from. AllowEmptyRepository implements the pre-commit convention; it still validates and records selected configuration.

type InputKind

type InputKind uint8

InputKind distinguishes explicit empty file sets from repository discovery.

const (
	Files InputKind = iota
	Repository
	Stdin
)

type LogLevel

type LogLevel int

LogLevel selects analysis logging verbosity.

type Options

type Options struct {
	Runners                      runner.Options
	Tools                        []tools.Registration
	Resolver                     resolver.Resolver
	WorkingDir, ConfigFile       string
	ConfigOverlays               []repoconfig.Overlay
	SkipProjectConfig            bool
	Analyzers                    []analyzer.Registration
	ReadFile                     func(string) ([]byte, error)
	OnConfigLoaded               func(repoconfig.Report)
	OnFilesSelected              func([]string)
	LoadScriptEngine             func(context.Context, string) (analyzer.ScriptBackend, error)
	Presets                      repoconfig.Presets
	IgnorePatterns               []string
	LogWriter                    io.Writer
	Verbose, Debug, LogSelection bool
	LegacyErrors                 bool
	// AllowConfigProcesses authorizes repository-selected executable invocations.
	AllowConfigProcesses bool
}

Options selects configuration and analysis backends for one application session.

func ConfigureToolIntegrations

func ConfigureToolIntegrations(options Options, occupiedTools ...string) (Options, error)

ConfigureToolIntegrations replaces registered tools using declared contracts. occupiedTools identifies already-selected script-engine providers. Integrated analyzers are removed from standalone execution, making repeated calls safe.

type Result

type Result = report.Analysis

Result is independent of the engine's traversal and mutable session state. Rendering and application-specific exit policies consume the same findings.

func Analyze

func Analyze(ctx context.Context, options Options, sources []workspace.Source) (*Result, error)

Analyze checks supplied snapshots through the same runtime ownership path as Check. It does not discover configuration or read the supplied source paths.

func Check

func Check(ctx context.Context, options Options, input Input) (result *Result, err error)

Check owns the complete runtime lifetime, including failed input selection and cancellation. A non-nil result with an error retains partial analysis findings.

type ToolRequirements

type ToolRequirements = workspace.ExternalToolRequirements

func RequiredTools

func RequiredTools(ctx context.Context, options Options, paths []string) (ToolRequirements, error)

RequiredTools resolves configuration without parsing sources or loading runtimes.

Jump to

Keyboard shortcuts

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