check

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2018 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetExtenionPoints added in v0.7.1

func GetExtenionPoints() []string

GetExtenionPoints returns a slice of extension points.

func GetTemplate added in v0.3.4

func GetTemplate(name string) string

GetTemplate makes a template for the given extension point.

Types

type Capitalization added in v0.6.0

type Capitalization struct {
	Definition `mapstructure:",squash"`
	Match      string
	Check      func(string) bool
	Style      string
}

Capitalization checks the case of a string.

type Check

type Check struct {
	Extends string
	Code    bool
	Level   int
	Rule    ruleFn
	Scope   core.Selector
}

A Check implements a single rule.

type Conditional

type Conditional struct {
	Definition `mapstructure:",squash"`
	Ignorecase bool
	First      string
	Second     string
	Exceptions []string
}

Conditional ensures that the present of First ensures the present of Second.

type Consistency

type Consistency struct {
	Definition `mapstructure:",squash"`
	Nonword    bool
	Ignorecase bool
	Either     map[string]string
}

Consistency ensures that the keys and values of Either don't both exist.

type Definition

type Definition struct {
	Code        bool
	Description string
	Extends     string
	Level       string
	Link        string
	Message     string
	Name        string
	Scope       string
}

Definition holds the common attributes of rule definitions.

type Existence

type Existence struct {
	Definition `mapstructure:",squash"`
	Append     bool
	Ignorecase bool
	Nonword    bool
	Raw        []string
	Tokens     []string
}

Existence checks for the present of Tokens.

type Manager added in v0.7.1

type Manager struct {
	AllChecks map[string]Check
	Config    *core.Config
}

Manager controls the loading and validating of the check extension points.

func NewManager added in v0.7.1

func NewManager(config *core.Config) *Manager

NewManager creates a new Manager and loads the rule definitions (that is, extended checks) specified by config.

type Occurrence

type Occurrence struct {
	Definition `mapstructure:",squash"`
	Max        int
	Token      string
}

Occurrence counts the number of times Token appears.

type Readability added in v0.11.0

type Readability struct {
	Definition `mapstructure:",squash"`
	Metrics    []string
	Grade      float64
}

Readability checks the reading grade level of text.

type Repetition

type Repetition struct {
	Definition `mapstructure:",squash"`
	Max        int
	Ignorecase bool
	Alpha      bool
	Tokens     []string
}

Repetition looks for repeated uses of Tokens.

type Spelling added in v0.4.1

type Spelling struct {
	Definition `mapstructure:",squash"`
	Aff        string
	Custom     bool
	Dic        string
	Filters    []*regexp.Regexp
	Ignore     string
	Threshold  int
}

Spelling checks text against a Hunspell dictionary.

type Substitution

type Substitution struct {
	Definition `mapstructure:",squash"`
	Ignorecase bool
	Nonword    bool
	Swap       map[string]string
	POS        string
}

Substitution switches the values of Swap for its keys.

Jump to

Keyboard shortcuts

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