lint

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RuleImport       = "import"
	RuleAssign       = "assignment"
	RuleCommentGroup = "comment_group"
)

Variables

This section is empty.

Functions

func Walk

func Walk(r *Rule, filepath string) []error

Types

type Linter

type Linter struct {
	IgnorePaths []string `yaml:"ignore_paths"`

	Revisions struct {
		From string
		To   string
	}

	Rules map[string]*Rule
}

type Requirement

type Requirement interface {
	Verify(ast.Node) error
}

type Rule

type Rule struct {
	Name, Type string

	Require Requirement
}

func (*Rule) UnmarshalYAML

func (r *Rule) UnmarshalYAML(n *yaml.Node) error

type Violation

type Violation struct {
	Pos      token.Pos
	Position token.Position
	File     string
	Rule     *Rule

	Message string
}

func (*Violation) Error

func (e *Violation) Error() string

func (*Violation) FilePath

func (e *Violation) FilePath() string

func (*Violation) Line

func (e *Violation) Line() int

type Violations

type Violations struct {
	Violations []*Violation
}

func FilterByRevision

func FilterByRevision(patch io.Reader, newFiles []string, vs *Violations) (*Violations, error)

similar to golangci-lint, use revgrep to determine what commit a change came from.

func (*Violations) Error

func (e *Violations) Error() string

Jump to

Keyboard shortcuts

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