report

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FontBold style
	FontBold = 1
)

Variables

View Source
	"K          .-'-.     ",
	" 8     __|      `\\  ",
	"  s   `-,-`--._   `\\",
	" []  .->'  a     `|-'",
	"  `=/ (__/_       /  ",
	"    \\_,    `    _)  ",
	"       `----;  |     ",
}

Logo popeye

View Source
var Popeye = []string{
	` ___     ___ _____   _____ `,
	`| _ \___| _ \ __\ \ / / __|`,
	`|  _/ _ \  _/ _| \ V /| _| `,
	`|_| \___/_| |___| |_| |___|`,
}

Popeye title

Functions

func Badge

func Badge(score int) []string

Badge returns a popeye grade.

func Close

func Close(w io.Writer)

Close a report section.

func Colorize

func Colorize(s string, c Color) string

Colorize a string based on given color.

func Comment

func Comment(w io.Writer, msg string)

Comment writes a comment line.

func Dump

func Dump(w io.Writer, l linter.Level, issues ...linter.Issue)

Dump all errors to output.

func EmojiForLevel

func EmojiForLevel(l linter.Level) string

EmojiForLevel maps lint levels to emojis.

func Error

func Error(w io.Writer, msg string, err error)

Error prints out error out.

func Grade

func Grade(score int) string

Grade returns a run report grade based on score.

func Open

func Open(w io.Writer, s string, t *Tally)

Open begins a new report section.

func TitleForRes

func TitleForRes(r string) string

TitleForRes returns a human readable resource name.

func Write

func Write(w io.Writer, l linter.Level, indent int, msg string)

Write a colorized message to stdout.

Types

type Color

type Color int

Color tracks the output color.

const (
	ColorOrangish  Color = 220
	ColorOrange    Color = 208
	ColorGray      Color = 250
	ColorWhite     Color = 15
	ColorBlue      Color = 105
	ColorRed       Color = 196
	ColorCoolBlue  Color = 99
	ColorAqua      Color = 122
	ColorDarkOlive Color = 155
	ColorLighSlate Color = 75 // 105
	ColorYellow    Color = 226
	ColorYellow2   Color = 190
	ColorGreenPale Color = 114
	ColorGreen     Color = 82
)

Color ANSI palette (256!)

type Tally

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

Tally tracks lint section scores.

func NewTally

func NewTally() *Tally

NewTally returns a new tally.

func (*Tally) Dump

func (t *Tally) Dump(w io.Writer)

Dump prints out a tally.

func (*Tally) IsValid

func (t *Tally) IsValid() bool

IsValid checks if tally is valid.

func (*Tally) Rollup

func (t *Tally) Rollup(run linter.Issues) *Tally

Rollup tallies up the report scores.

func (*Tally) Score

func (t *Tally) Score() int

Score returns the tally computed score.

func (*Tally) Width

func (t *Tally) Width() int

Width computes the tally width.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳