result

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2020 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

View Source
const MaxLineLength = 200

MaxLineLength is the max line length that this printer will show the source of the violation and the location within the line of the violation. Helps avoid consuming the console when minified files contine violations.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileResults

type FileResults struct {
	Filename string
	Results  []Result
}

FileResults contains all the Results for the file

func (FileResults) Len added in v0.1.2

func (fr FileResults) Len() int

Len is part of sort.Interface

func (FileResults) Less added in v0.1.2

func (fr FileResults) Less(i, j int) bool

Less is part of sort.Interface

func (*FileResults) String

func (fr *FileResults) String() string

func (FileResults) Swap added in v0.1.2

func (fr FileResults) Swap(i, j int)

Swap is part of sort.Interface

type Result

type Result struct {
	Rule      *rule.Rule
	Violation string
	// Line is the full string of the line, unless it's over MaxLintLength,
	// where Line will be an emtpy string
	Line          string
	StartPosition *token.Position
	EndPosition   *token.Position
}

Result contains data about the result of a broken rule

func FindResults

func FindResults(r *rule.Rule, filename, text string, line int) (rs []Result)

FindResults returns the results that match the rule for the given text. filename and line are only used for the Position

func (*Result) Reason

func (r *Result) Reason() string

Reason outputs the suggested alternatives for this rule

func (*Result) String

func (r *Result) String() string

Jump to

Keyboard shortcuts

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