lint

package
v3.1.5 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunLint

func RunLint(ctx context.Context, client apiclient.Client, kinds []string, output string, offline bool, opts LintOptions)

RunLint lints the specified kinds in the specified files and prints the results to os.Stdout. If linting fails it will exit with status code 1.

Types

type Formatter

type Formatter interface {
	Format(*LintResult) string
	Summarize(*LintResults) string
}

func GetFormatter

func GetFormatter(fmtr string) (Formatter, error)

type LintOptions

type LintOptions struct {
	Files            []string
	Strict           bool
	DefaultNamespace string
	Formatter        Formatter
	ServiceClients   ServiceClients

	// Printer if not nil the lint result is written to this writer after each
	// file is linted.
	Printer io.Writer
}

type LintResult

type LintResult struct {
	File   string
	Errs   []error
	Linted bool
}

LintResult represents the result of linting objects from a single source

type LintResults

type LintResults struct {
	Results []*LintResult
	Success bool
	// contains filtered or unexported fields
}

LintResults represents the result of linting objects from multiple sources

func Lint

func Lint(ctx context.Context, opts *LintOptions) (*LintResults, error)

Lint reads all files, returns linting errors of all of the enitities of the specified kinds. Entities of other kinds are ignored.

func (*LintResults) Msg

func (l *LintResults) Msg() string

type ServiceClients

type ServiceClients struct {
	WorkflowsClient               workflowpkg.WorkflowServiceClient
	WorkflowTemplatesClient       workflowtemplatepkg.WorkflowTemplateServiceClient
	CronWorkflowsClient           cronworkflowpkg.CronWorkflowServiceClient
	ClusterWorkflowTemplateClient clusterworkflowtemplatepkg.ClusterWorkflowTemplateServiceClient
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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