formatter

package
v1.3.7 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 12 Imported by: 4

Documentation

Overview

Package formatter implements the linter output formatters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checkstyle

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

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

Format formats the failures gotten from the lint.

func (*Checkstyle) Name

func (*Checkstyle) Name() string

Name returns the name of the formatter

type Default

type Default struct {
	Metadata lint.FormatterMetadata
}

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

func (*Default) Format

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

Format formats the failures gotten from the lint.

func (*Default) Name

func (*Default) Name() string

Name returns the name of the formatter

type Friendly

type Friendly struct {
	Metadata lint.FormatterMetadata
}

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

func (*Friendly) Format

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

Format formats the failures gotten from the lint.

func (*Friendly) Name

func (*Friendly) Name() string

Name returns the name of the formatter

type JSON

type JSON struct {
	Metadata lint.FormatterMetadata
}

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

func (*JSON) Format

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

Format formats the failures gotten from the lint.

func (*JSON) Name

func (*JSON) Name() string

Name returns the name of the formatter

type NDJSON

type NDJSON struct {
	Metadata lint.FormatterMetadata
}

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

func (*NDJSON) Format

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

Format formats the failures gotten from the lint.

func (*NDJSON) Name

func (*NDJSON) Name() string

Name returns the name of the formatter

type Plain

type Plain struct {
	Metadata lint.FormatterMetadata
}

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

func (*Plain) Format

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

Format formats the failures gotten from the lint.

func (*Plain) Name

func (*Plain) Name() string

Name returns the name of the formatter

type Sarif added in v1.0.6

type Sarif struct {
	Metadata lint.FormatterMetadata
}

Sarif is an implementation of the Formatter interface which formats revive failures into SARIF format.

func (*Sarif) Format added in v1.0.6

func (*Sarif) Format(failures <-chan lint.Failure, cfg lint.Config) (string, error)

Format formats the failures gotten from the lint.

func (*Sarif) Name added in v1.0.6

func (*Sarif) Name() string

Name returns the name of the formatter

type Stylish

type Stylish struct {
	Metadata lint.FormatterMetadata
}

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

func (*Stylish) Format

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

Format formats the failures gotten from the lint.

func (*Stylish) Name

func (*Stylish) Name() string

Name returns the name of the formatter

type Unix

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

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

Format formats the failures gotten from the lint.

func (*Unix) Name

func (*Unix) Name() string

Name returns the name of the formatter

Jump to

Keyboard shortcuts

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