rule

package
v0.0.0-...-5c975ef Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2017 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SeverityError   = Severity{Name: "ErrorC"}
	SeverityWarning = Severity{Name: "WarningC"}
	SeverityInfo    = Severity{Name: "InfoC"}
	SeverityStyle   = Severity{Name: "StyleC"}
	SeverityUnknown = Severity{Name: "UnknownC"}
)

Functions

func AppendResult

func AppendResult(rule *Rule, node *parser.Node)

func RegisterRule

func RegisterRule(rule *Rule)

Types

type FindPred

type FindPred func(*Rule) bool

func IsNameMatch

func IsNameMatch(name string) FindPred

type Result

type Result struct {
	Rule        *Rule
	StartLine   int
	EndLine     int
	StartColumn int
	EndColumn   int
}

type Results

type Results []*Result

func GetResults

func GetResults() Results

type Rule

type Rule struct {
	Name        string
	Severity    Severity
	Description string
	Validate    Validator
}

Rule

type Rules

type Rules []*Rule

func GetRules

func GetRules() Rules

func (Rules) Find

func (self Rules) Find(pred FindPred) *Rule

type Severity

type Severity struct {
	Name string
}

Severity stand check type

type Validator

type Validator func(root *parser.Node) bool

Validator validate node,true -> good, false -> bad

Jump to

Keyboard shortcuts

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