Documentation
¶
Overview ¶
Package toolrun executes tool runs, the manifest rows that drive an external binary: it checks the tool is installed, selects targets (selectors/), fans out one invocation per target or runs once over all of them, skips steps whose inputs a previous pass already covered (the step cache), and turns output into a verdict (parsers/).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFromConfig ¶
func NewFromConfig(cfg Config, deps Deps) (interfaces.ToolRunner, error)
NewFromConfig returns the ToolRunner decorated from deps as a service. A missing Runner or Tools is CodeInvalidInput. It does no I/O.
Types ¶
type Config ¶
type Config struct {
// Name labels the runner in decoration overrides, metrics, spans and logs; empty
// uses "toolrun".
Name string `yaml:"name" mapstructure:"name"`
}
Config names the runner.
type Deps ¶
type Deps struct {
// Decorations decorates the runner as a service.
decorate.Decorations
// Runner runs the tools and checks they are installed.
Runner interfaces.CommandRunner
// Tools resolves a run's tool name to its spec; false means the toolchain does not
// know the tool.
Tools func(name string) (interfaces.ToolSpec, bool)
// Versions returns a tool's version for the cache key; nil keys every tool at "".
Versions func(name string) string
// Cache skips steps that passed on the same inputs; nil never skips.
Cache interfaces.StepCache
// Git lists staged files for the staged_files selector.
Git interfaces.GitOps
// Root is the working-tree root the tools run under.
Root string
// Pool bounds a fan-out's concurrency; zero or less means one per CPU.
Pool int
}
Deps carries the runner's collaborators.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package parsers holds the Parser kinds that turn a tool's output into a verdict: exit_code, gcc, json_lines, sarif and empty_output.
|
Package parsers holds the Parser kinds that turn a tool's output into a verdict: exit_code, gcc, json_lines, sarif and empty_output. |
|
Package selectors holds the TargetSelector kinds a tool run picks its targets with: files, go_modules, python_projects, ts_workspace and staged_files.
|
Package selectors holds the TargetSelector kinds a tool run picks its targets with: files, go_modules, python_projects, ts_workspace and staged_files. |
Click to show internal directories.
Click to hide internal directories.