cli

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package cli allows a CLI tool to be linted from the host or in a container

Index

Constants

This section is empty.

Variables

View Source
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

func (e *LintCli) Batched() bool

Batched reports if the tool is configured to lint many files per run, see executor.Instance Batch

func (*LintCli) Cleanup

func (e *LintCli) Cleanup(ctx context.Context) error

Cleanup removes any additional resources created in the process

func (*LintCli) Name

func (e *LintCli) Name() string

Name returns the command name

func (*LintCli) Run

func (e *LintCli) Run(ctx context.Context, filePath string) linter.Report

Run does the work required to lint the given filepath

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.

func (*LintCli) Setup

func (e *LintCli) Setup(ctx context.Context) error

Setup does preflight checks for the 'Run'

Directories

Path Synopsis
Package executor allows for a CLI tool to be executed in different contexts
Package executor allows for a CLI tool to be executed in different contexts

Jump to

Keyboard shortcuts

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