revivelib

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2022 License: MIT Imports: 8 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArrayFlags

type ArrayFlags []string

ArrayFlags type for string list.

func (*ArrayFlags) Set

func (i *ArrayFlags) Set(value string) error

Set value for array flags.

func (*ArrayFlags) String

func (i *ArrayFlags) String() string

type ExtraRule

type ExtraRule struct {
	Rule          lint.Rule
	DefaultConfig lint.RuleConfig
}

ExtraRule configures a new rule to be used with revive.

func NewExtraRule

func NewExtraRule(rule lint.Rule, defaultConfig lint.RuleConfig) ExtraRule

NewExtraRule returns a configured extra rule.

type LintPattern

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

LintPattern indicates a pattern to be included/excluded when linting

func Exclude

func Exclude(pattern string) *LintPattern

Exclude this pattern when linting

func Include

func Include(pattern string) *LintPattern

Include this pattern when linting

func (*LintPattern) GetPattern

func (p *LintPattern) GetPattern() string

GetPattern - returns the actual pattern

func (*LintPattern) IsExclude

func (p *LintPattern) IsExclude() bool

IsExclude - should this pattern be included or excluded when linting

type Revive

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

Revive is responsible for running linters and formatters and returning a set of results.

func New

func New(
	conf *lint.Config,
	setExitStatus bool,
	maxOpenFiles int,
	extraRules ...ExtraRule,
) (*Revive, error)

New creates a new instance of Revive lint runner.

func (*Revive) Format

func (r *Revive) Format(
	formatterName string,
	failuresChan <-chan lint.Failure,
) (string, int, error)

Format gets the output for a given failures channel from Lint.

func (*Revive) Lint

func (r *Revive) Lint(patterns ...*LintPattern) (<-chan lint.Failure, error)

Lint the included patterns, skipping excluded ones

Jump to

Keyboard shortcuts

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