golangcilint

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package golangcilint provides a task for the "github.com/golangci/golangci-lint/cmd/golangci-lint" Go module command. "golangci-lint" a fast, parallel runner for dozens of Go linters that uses caching, supports YAML configurations and has integrations with all major IDEs.

See https://pkg.go.dev/github.com/golangci/golangci-lint for more details about "golangci-lint". The source code of "golangci-lint" is available at https://github.com/golangci/golangci-lint/tree/master/cmd/golangci-lint.

Index

Constants

View Source
const (
	// DefaultGoModulePath is the default module import path.
	DefaultGoModulePath = "github.com/golangci/golangci-lint/cmd/golangci-lint"

	// DefaultGoModuleVersion is the default module version.
	DefaultGoModuleVersion = "v1.43.0"
)

Variables

View Source
var DefaultArgs = []string{"run"}

DefaultArgs are default arguments passed to the command.

Functions

This section is empty.

Types

type Option

type Option func(*Options)

Option is a task option.

func WithArgs

func WithArgs(args ...string) Option

WithArgs sets additional arguments to pass to the command. Defaults to DefaultArgs.

func WithEnv

func WithEnv(env map[string]string) Option

WithEnv sets the task specific environment.

func WithModulePath

func WithModulePath(path string) Option

WithModulePath sets the module import path. Defaults to DefaultGoModulePath.

func WithModuleVersion

func WithModuleVersion(version *semver.Version) Option

WithModuleVersion sets the module version. Defaults to DefaultGoModuleVersion.

func WithVerboseOutput

func WithVerboseOutput(verbose bool) Option

WithVerboseOutput indicates whether the output should be verbose.

type Options

type Options struct {
	// contains filtered or unexported fields
}

Options are task options.

func NewOptions

func NewOptions(opts ...Option) (*Options, error)

NewOptions creates new task options.

type Task

type Task struct {
	// contains filtered or unexported fields
}

Task is a task for the "github.com/golangci/golangci-lint/cmd/golangci-lint" Go module command.

func New

func New(opts ...Option) (*Task, error)

New creates a new task for the "github.com/golangci/golangci-lint/cmd/golangci-lint" Go module command. If no extra arguments are configured, DefaultArgs are passed to the command.

func (*Task) BuildParams

func (t *Task) BuildParams() []string

BuildParams builds the parameters.

func (*Task) Env

func (t *Task) Env() map[string]string

Env returns the task specific environment.

func (*Task) ID

func (t *Task) ID() *project.GoModuleID

ID returns the identifier of the Go module.

func (*Task) Kind

func (t *Task) Kind() task.Kind

Kind returns the task kind.

func (*Task) Name added in v0.6.0

func (t *Task) Name() string

Name returns the task name.

func (*Task) Options

func (t *Task) Options() task.Options

Options returns the task options.

Jump to

Keyboard shortcuts

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