Documentation
¶
Overview ¶
Package cli allows a CLI tool to be linted from the host or in a container
Index ¶
- Variables
- type LintCli
- func (e *LintCli) Batched() bool
- func (e *LintCli) Cleanup(ctx context.Context) error
- func (e *LintCli) Name() string
- func (e *LintCli) Run(ctx context.Context, filePath string) linter.Report
- func (e *LintCli) RunBatch(ctx context.Context, filePaths []string) (reports []linter.Report, rerun map[string][]linter.Finding)
- func (e *LintCli) Setup(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
var Version = "latest"
Version used to match img tags with crie versions
Functions ¶
This section is empty.
Types ¶
type LintCli ¶
type LintCli struct {
Type string `json:"type" yaml:"type" jsonschema:"the most common linter type, a cli tool"`
Exec executor.Instance `json:"exec" yaml:"exec" jsonschema:"settings for the command to run" `
Img string `json:"img,omitzero" yaml:"img" jsonschema:"the container image to pull and use"`
TagCrieVersion bool `` /* 131-byte string literal not displayed */
// contains filtered or unexported fields
}
LintCli defines a predefined command to run against a file
func (*LintCli) Batched ¶ added in v1.0.12
Batched reports if the tool is configured to lint many files per run, see executor.Instance Batch
func (*LintCli) RunBatch ¶ added in v1.0.12
func (e *LintCli) RunBatch(ctx context.Context, filePaths []string) (reports []linter.Report, rerun map[string][]linter.Finding)
RunBatch lints all filePaths in one run of the tool. A tool's severity rules only reach us through its exit code, which a batch shares between all its files (e.g. a file with only warnings would fail alongside one with an error), so when a batch fails each file its output names is returned to rerun on its own for its own result, or every file if it names none. The batch's machine readable findings are kept for each file, as a rerun's output is for people to read.