disablerule

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2019 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interpreter

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

Interpreter represents an interpreter for disable rule comments.

func NewInterpreter

func NewInterpreter(
	ruleID string,
) *Interpreter

NewInterpreter creates an Interpreter.

func (*Interpreter) CallEachIfValid

func (i *Interpreter) CallEachIfValid(
	lines []string,
	f func(index int, line string),
)

CallEachIfValid calls a given function each time the line is not disabled.

func (*Interpreter) Interpret

func (i *Interpreter) Interpret(
	comments []*parser.Comment,
	inlines ...*parser.Comment,
) (isDisabled bool)

Interpret interprets comments and returns a bool whether not apply the rule to a next or this element.

Jump to

Keyboard shortcuts

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