nolintlint

package
v2.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

nolintlint provides a linter for ensure that all //nolint directives are followed by explanations

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplyOptionFunc

type ApplyOptionFunc func(c *config) error

func OptionDirectives

func OptionDirectives(o []string) ApplyOptionFunc

OptionDirectives describes lint directives to check

func OptionExcludes

func OptionExcludes(o []string) ApplyOptionFunc

OptionExcludes lists individual linters that don't require explanations

func OptionNeeds

func OptionNeeds(o Needs) ApplyOptionFunc

OptionNeeds indicates which linter checks to perform

type BaseIssue

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

func (BaseIssue) Position

func (b BaseIssue) Position() token.Position

type DirectivePatterns

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

type ExtraLeadingSpace added in v2.2.0

type ExtraLeadingSpace struct {
	BaseIssue
}

func (ExtraLeadingSpace) Details added in v2.2.0

func (i ExtraLeadingSpace) Details() string

func (ExtraLeadingSpace) String added in v2.2.0

func (i ExtraLeadingSpace) String() string

type Issue

type Issue interface {
	Details() string
	Position() token.Position
	String() string
}

type Linter

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

func NewLinter

func NewLinter(options ...Option) (*Linter, error)

NewLinter creates a linter that enforces that the provided directives fulfill the provided requirements

func (Linter) Run

func (l Linter) Run(fset *token.FileSet, nodes ...ast.Node) ([]Issue, error)

type Needs

type Needs uint
const (
	NeedsMachine Needs = 1 << iota
	NeedsSpecific
	NeedsExplanation
	NeedsAll = NeedsMachine | NeedsSpecific | NeedsExplanation
)

type NoExplanation

type NoExplanation struct {
	BaseIssue
	// contains filtered or unexported fields
}

func (NoExplanation) Details

func (i NoExplanation) Details() string

func (NoExplanation) String

func (i NoExplanation) String() string

type NotMachine

type NotMachine struct {
	BaseIssue
}

func (NotMachine) Details

func (i NotMachine) Details() string

func (NotMachine) String

func (i NotMachine) String() string

type NotSpecific

type NotSpecific struct {
	BaseIssue
}

func (NotSpecific) Details

func (i NotSpecific) Details() string

func (NotSpecific) String

func (i NotSpecific) String() string

type Option

type Option interface {
	// contains filtered or unexported methods
}

type ParseError added in v2.2.0

type ParseError struct {
	BaseIssue
}

func (ParseError) Details added in v2.2.0

func (i ParseError) Details() string

func (ParseError) String added in v2.2.0

func (i ParseError) String() string

Jump to

Keyboard shortcuts

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