revive: github.com/mgechev/revive/formatter Index | Files

package formatter

import "github.com/mgechev/revive/formatter"

Index

Package Files

checkstyle.go default.go friendly.go json.go ndjson.go plain.go severity.go stylish.go unix.go

type Checkstyle Uses

type Checkstyle struct {
    Metadata lint.FormatterMetadata
}

Checkstyle is an implementation of the Formatter interface which formats the errors to Checkstyle-like format.

func (*Checkstyle) Format Uses

func (f *Checkstyle) Format(failures <-chan lint.Failure, config lint.Config) (string, error)

Format formats the failures gotten from the lint.

func (*Checkstyle) Name Uses

func (f *Checkstyle) Name() string

Name returns the name of the formatter

type Default Uses

type Default struct {
    Metadata lint.FormatterMetadata
}

Default is an implementation of the Formatter interface which formats the errors to text.

func (*Default) Format Uses

func (f *Default) Format(failures <-chan lint.Failure, _ lint.Config) (string, error)

Format formats the failures gotten from the lint.

func (*Default) Name Uses

func (f *Default) Name() string

Name returns the name of the formatter

type Friendly Uses

type Friendly struct {
    Metadata lint.FormatterMetadata
}

Friendly is an implementation of the Formatter interface which formats the errors to JSON.

func (*Friendly) Format Uses

func (f *Friendly) Format(failures <-chan lint.Failure, config lint.Config) (string, error)

Format formats the failures gotten from the lint.

func (*Friendly) Name Uses

func (f *Friendly) Name() string

Name returns the name of the formatter

type JSON Uses

type JSON struct {
    Metadata lint.FormatterMetadata
}

JSON is an implementation of the Formatter interface which formats the errors to JSON.

func (*JSON) Format Uses

func (f *JSON) Format(failures <-chan lint.Failure, config lint.Config) (string, error)

Format formats the failures gotten from the lint.

func (*JSON) Name Uses

func (f *JSON) Name() string

Name returns the name of the formatter

type NDJSON Uses

type NDJSON struct {
    Metadata lint.FormatterMetadata
}

NDJSON is an implementation of the Formatter interface which formats the errors to NDJSON stream.

func (*NDJSON) Format Uses

func (f *NDJSON) Format(failures <-chan lint.Failure, config lint.Config) (string, error)

Format formats the failures gotten from the lint.

func (*NDJSON) Name Uses

func (f *NDJSON) Name() string

Name returns the name of the formatter

type Plain Uses

type Plain struct {
    Metadata lint.FormatterMetadata
}

Plain is an implementation of the Formatter interface which formats the errors to JSON.

func (*Plain) Format Uses

func (f *Plain) Format(failures <-chan lint.Failure, _ lint.Config) (string, error)

Format formats the failures gotten from the lint.

func (*Plain) Name Uses

func (f *Plain) Name() string

Name returns the name of the formatter

type Stylish Uses

type Stylish struct {
    Metadata lint.FormatterMetadata
}

Stylish is an implementation of the Formatter interface which formats the errors to JSON.

func (*Stylish) Format Uses

func (f *Stylish) Format(failures <-chan lint.Failure, config lint.Config) (string, error)

Format formats the failures gotten from the lint.

func (*Stylish) Name Uses

func (f *Stylish) Name() string

Name returns the name of the formatter

type Unix Uses

type Unix struct {
    Metadata lint.FormatterMetadata
}

Unix is an implementation of the Formatter interface which formats the errors to a simple line based error format

main.go:24:9: [errorf] should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...)

func (*Unix) Format Uses

func (f *Unix) Format(failures <-chan lint.Failure, _ lint.Config) (string, error)

Format formats the failures gotten from the lint.

func (*Unix) Name Uses

func (f *Unix) Name() string

Name returns the name of the formatter

Package formatter imports 10 packages (graph) and is imported by 5 packages. Updated 2020-07-21. Refresh now. Tools for package owners.