lint

package
v2.30.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: MIT Imports: 33 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).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comment added in v2.19.0

type Comment struct {
	Text   string
	Line   int
	Offset int
	Scope  string
}

Comment represents an in-code comment (line or block).

type ExtendedHTMLWriter added in v2.25.0

type ExtendedHTMLWriter struct {
	*org.HTMLWriter
}

func (*ExtendedHTMLWriter) WriteComment added in v2.25.0

func (w *ExtendedHTMLWriter) WriteComment(n org.Comment)

type Linter

type Linter struct {
	Manager *check.Manager

	HasDir bool
	// contains filtered or unexported fields
}

A Linter lints a File.

func NewLinter

func NewLinter(cfg *core.Config) (*Linter, error)

NewLinter initializes a Linter.

func (*Linter) Lint

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

Lint src according to its format.

func (*Linter) LintString

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

LintString src according to its format.

type Solution added in v2.23.1

type Solution struct {
	Suggestions []string `json:"suggestions"`
	Error       string   `json:"error"`
}

Solution is a potential solution to an alert.

func ParseAlert added in v2.23.1

func ParseAlert(s string, cfg *core.Config) (Solution, error)

ParseAlert returns a slice of suggestions for the given Vale alert.

Jump to

Keyboard shortcuts

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