issues

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: May 12, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const Root = "__root__"

Root denotes a root issue group.

Variables

View Source
var Blank = Issue{}

Blank issue

Functions

func LevelToStr added in v0.4.0

func LevelToStr(l config.Level) string

LevelToStr returns a severity level as a string.

Types

type Codes added in v0.4.0

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

Codes represents a collection of sanitizer codes.

func LoadCodes added in v0.4.0

func LoadCodes() (*Codes, error)

LoadCodes retrieves sanitizers codes from yaml file.

func (*Codes) Refine added in v0.4.0

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

Refine overrides code severity based on user input.

type Collector

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

Collector represents a sanitizer issue container.

func NewCollector

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

NewCollector returns a new issue collector.

func (*Collector) AddCode added in v0.4.0

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

AddCode add an error code.

func (*Collector) AddErr

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

AddErr adds a collection of errors.

func (*Collector) AddSubCode added in v0.4.0

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

AddSubCode add a sub error code.

func (*Collector) ClearOutcome added in v0.6.0

func (c *Collector) ClearOutcome(fqn string)

ClearOutcome delete all fqn related issues.

func (*Collector) InitOutcome

func (c *Collector) InitOutcome(fqn string)

InitOutcome creates a places holder for potential issues.

func (*Collector) MaxSeverity

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

MaxSeverity return the highest severity level foe the given section.

func (*Collector) NoConcerns

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

NoConcerns returns true if scan is successful.

func (*Collector) Outcome

func (c *Collector) Outcome() Outcome

Outcome returns scan outcome.

type Issue

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

Issue tracks a sanitizer issui.

func New

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

New returns a new lint issue.

func Newf

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

Newf returns a new lint issue using a formatter.

func (Issue) Blank

func (i Issue) Blank() bool

Blank checks if an issue is blank.

func (Issue) IsSubIssue

func (i Issue) IsSubIssue() bool

IsSubIssue checks if error is a sub error.

type Issues

type Issues []Issue

Issues represents a collection of issues.

func (Issues) Group

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

Group collect issues as groups.

func (Issues) MaxSeverity

func (i Issues) MaxSeverity() config.Level

MaxSeverity gather the max severity in a collection of issues.

func (Issues) Sort added in v0.7.0

func (i Issues) Sort(l config.Level) Issues

Sort sorts issues.

type Outcome

type Outcome map[string]Issues

Outcome represents outcomes resulting from sanitization pass.

func (Outcome) Filter added in v0.6.2

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

Filter filters outcomes based on sanitizer level.

func (Outcome) For

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

For returns issues for a given section/group.

func (Outcome) MaxGroupSeverity

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

MaxGroupSeverity scans the issues and reports the highest severity.

func (Outcome) MaxSeverity

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

MaxSeverity scans the issues and reports the highest severity.

Jump to

Keyboard shortcuts

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