lint

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: 17 Imported by: 0

Documentation

Overview

Package lint implements Vale's syntax-aware linting functionality.

The package is split into core linting logic (this file), source code (code.go), and markup (markup.go). The general flow is as follows:

Lint (files and directories)     LintString (stdin)
            \                   /
             lintFiles         /
                     \        /
                      +      +
+-------------------+ lintFile ------+|lintMarkdown|lintADoc|lintRST
|                    /    |    \       |            |       /
|                   /     |     \      |           /       /
|                  /      |      \     |          +--------
|                 /       |       \    |         /
|                +        +        +   +        +
|               lintCode  lintLines  lintHTML
|               |         |              |
|               |         |              +
|                \        |         lintProse
|                 \       |        /
|                  +      +       +
|                      lintText
|   <= add Alerts{}       |
+-------------------------+

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	Context string        // parent content - e.g., sentence -> paragraph
	Text    string        // text content
	Raw     string        // text content without any processing
	Scope   core.Selector // section selector
}

A Block represents a section of text.

func NewBlock

func NewBlock(ctx, txt, raw, sel string) Block

NewBlock makes a new Block with prepared text and a Selector.

type Linter

type Linter struct {
	Config       *core.Config   // command-line and config file settings
	CheckManager *check.Manager // loaded checks
}

A Linter lints a File.

func (Linter) Lint

func (l Linter) Lint(input []string, pat string) ([]*core.File, error)

Lint src according to its format.

func (Linter) LintString added in v0.4.0

func (l Linter) LintString(src string) ([]*core.File, error)

LintString src according to its format.

Jump to

Keyboard shortcuts

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