popeye: github.com/derailed/popeye/internal/issues Index | Files

package issues

import "github.com/derailed/popeye/internal/issues"

Index

Package Files

codes.go collector.go issue.go issues.go

Constants

const Root = "__root__"

Root denotes a root issue group.

Variables

var Blank = Issue{}

Blank issue

func LevelToStr Uses

func LevelToStr(l config.Level) string

LevelToStr returns a severity level as a string.

type Codes Uses

type Codes struct {
    Glossary config.Glossary `yaml:"codes"`
}

Codes represents a collection of sanitizer codes.

func LoadCodes Uses

func LoadCodes() (*Codes, error)

LoadCodes retrieves sanitifizers codes from yaml file.

func (*Codes) Refine Uses

func (c *Codes) Refine(gloss config.Glossary)

Refine overrides code severity based on user input.

type Collector Uses

type Collector struct {
    *config.Config
    // contains filtered or unexported fields
}

Collector represents a sanitizer issue container.

func NewCollector Uses

func NewCollector(codes *Codes, cfg *config.Config) *Collector

NewCollector returns a new issue collector.

func (*Collector) AddCode Uses

func (c *Collector) AddCode(ctx context.Context, code config.ID, args ...interface{})

AddCode add an error code.

func (*Collector) AddErr Uses

func (c *Collector) AddErr(ctx context.Context, errs ...error)

AddErr adds a collection of errors.

func (*Collector) AddSubCode Uses

func (c *Collector) AddSubCode(ctx context.Context, code config.ID, args ...interface{})

AddSubCode add a sub error code.

func (*Collector) ClearOutcome Uses

func (c *Collector) ClearOutcome(fqn string)

ClearOutcome delete all fqn related issues.

func (*Collector) InitOutcome Uses

func (c *Collector) InitOutcome(fqn string)

InitOutcome creates a places holder for potential issues.

func (*Collector) MaxSeverity Uses

func (c *Collector) MaxSeverity(fqn string) config.Level

MaxSeverity return the highest severity level foe the given section.

func (*Collector) NoConcerns Uses

func (c *Collector) NoConcerns(fqn string) bool

NoConcerns returns true is scan is successful.

func (*Collector) Outcome Uses

func (c *Collector) Outcome() Outcome

Outcome returns scan outcome.

type Issue Uses

type Issue struct {
    Group   string       `yaml:"group" json:"group"`
    Level   config.Level `yaml:"level" json:"level"`
    Message string       `yaml:"message" json:"message"`
}

Issue tracks a sanitizer issui.

func New Uses

func New(group string, level config.Level, description string) Issue

New returns a new lint issue.

func Newf Uses

func Newf(group string, level config.Level, format string, args ...interface{}) Issue

Newf returns a new lint issue using a formatter.

func (Issue) Blank Uses

func (i Issue) Blank() bool

Blank checks if an issue is blank.

func (Issue) IsSubIssue Uses

func (i Issue) IsSubIssue() bool

IsSubIssue checks if error is a sub error.

type Issues Uses

type Issues []Issue

Issues represents a collection of issues.

func (Issues) Group Uses

func (i Issues) Group() map[string]Issues

Group collect issues as groups.

func (Issues) MaxSeverity Uses

func (i Issues) MaxSeverity() config.Level

MaxSeverity gather the max severity in a collection of issues.

type Outcome Uses

type Outcome map[string]Issues

Outcome represents outcomes resulting from sanitization pass.

func (Outcome) Filter Uses

func (o Outcome) Filter(level config.Level) Outcome

Filter filters outcomes based on sanitizer level.

func (Outcome) For Uses

func (o Outcome) For(section, group string) Issues

For returns issues for a given section/group.

func (Outcome) MaxGroupSeverity Uses

func (o Outcome) MaxGroupSeverity(section, group string) config.Level

MaxGroupSeverity scans the issues and reports the highest severity.

func (Outcome) MaxSeverity Uses

func (o Outcome) MaxSeverity(section string) config.Level

MaxSeverity scans the issues and reports the highest severity.

Package issues imports 6 packages (graph) and is imported by 5 packages. Updated 2020-01-27. Refresh now. Tools for package owners.