parser

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WalkDirs added in v0.1.4

func WalkDirs(paths []string, ignorer *ignore.Ignore) ([]string, error)

WalkDirs returns all known files in the provided paths using filepath.Walk

func WalkDirsWithIgnores added in v0.1.4

func WalkDirsWithIgnores(paths []string, ignorer *ignore.Ignore) []string

WalkDirsWithIgnores returns a list of files that can be parsed after the ignorer has excluded files that should be ignored

Types

type Parser

type Parser struct {
	Rules []*rule.Rule
}

Parser parses files and finds lines that break rules

func NewParser added in v0.1.4

func NewParser(rules []*rule.Rule) *Parser

func (*Parser) Parse

func (p *Parser) Parse(t interface{}, ignorer *ignore.Ignore) (results []*result.FileResults)

Parse can parse different types of inputs and return the results

func (*Parser) ParseFile added in v0.1.4

func (p *Parser) ParseFile(f string) (*result.FileResults, error)

ParseFile parses the files provided and returns the results

func (*Parser) ParseFiles

func (p *Parser) ParseFiles(files []string, ignorer *ignore.Ignore) (results []*result.FileResults)

ParseFiles parses all files provided and returns the results

Jump to

Keyboard shortcuts

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