printer

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2020 License: MIT Imports: 8 Imported by: 3

Documentation

Index

Constants

View Source
const (
	OutFormatText          = "text"
	OutFormatSimple        = "simple"
	OutFormatGitHubActions = "github-actions"
)
View Source
const MaxLineLengthForShowingViolationSource = 200

MaxLineLengthForShowingViolationSource is the max line length that this printer will show the source of the violation and the location within the line of the violation. Helps avoid consuming the console when minified files contine violations.

Variables

View Source
var OutFormatsString = strings.Join(OutFormats, ",")

Functions

This section is empty.

Types

type GitHubActions

type GitHubActions struct{}

GitHubActions is a GitHubActions printer meant for use by a GitHub Action annotation

func NewGitHubActions

func NewGitHubActions() *GitHubActions

NewGitHubActions returns a new GitHubActions printer

type Printer

type Printer interface {
	Print(*result.FileResults) error
}

Printer is an interface for printing FileResults

func NewPrinter added in v0.1.1

func NewPrinter(f string) (Printer, error)

type Simple

type Simple struct{}

Simple is a simple printer meant for a machine to read

func NewSimple

func NewSimple() *Simple

NewSimple returns a new simple printer

func (*Simple) Print

func (p *Simple) Print(fs *result.FileResults) error

Print prints in the format 'filename:line:column: message' based on golint's output: https://github.com/golang/lint/blob/738671d3881b9731cc63024d5d88cf28db875626/golint/golint.go#L121

type Text

type Text struct {
	// contains filtered or unexported fields
}

Text is a text printer meant for humans to read

func NewText

func NewText(disableColor bool) *Text

NewText returns a text Printer with color optionally disabled

func (*Text) Print

func (t *Text) Print(fs *result.FileResults) error

Print prints the file results

Jump to

Keyboard shortcuts

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