issues

package
v0.21.5 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2024 License: Apache-2.0 Imports: 16 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 rules.Level) string

LevelToStr returns a severity level as a string.

func SortKeys added in v0.20.0

func SortKeys(k1, k2 string) int

Types

type Codes added in v0.4.0

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

Codes represents a collection of linter codes.

func LoadCodes added in v0.4.0

func LoadCodes() (*Codes, error)

LoadCodes retrieves linters codes from yaml file.

func (*Codes) Refine added in v0.4.0

func (c *Codes) Refine(oo rules.Overrides)

Refine overrides code severity based on user input.

type Collector

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

Collector tracks linter issues and codes.

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 rules.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 rules.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) CloseOutcome added in v0.20.0

func (c *Collector) CloseOutcome(ctx context.Context, fqn string, cos []string)

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) rules.Level

MaxSeverity return the highest severity level for 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   rules.Level `yaml:"level" json:"level"`
	Message string      `yaml:"message" json:"message"`
}

Issue tracks a linter issue.

func New

func New(gvr types.GVR, group string, level rules.Level, description string) Issue

New returns a new lint issue.

func Newf

func Newf(gvr types.GVR, group string, level rules.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) Code added in v0.20.0

func (i Issue) Code() (string, bool)

func (Issue) Dump added in v0.20.0

func (i Issue) Dump()

Dump for debugging.

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) CodeTally added in v0.20.0

func (i Issues) CodeTally() tally.Code

func (Issues) Group

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

Group collect issues as groups.

func (Issues) HasIssues added in v0.20.0

func (i Issues) HasIssues() bool

func (Issues) MaxSeverity

func (i Issues) MaxSeverity() rules.Level

MaxSeverity gather the max severity in a collection of issues.

func (Issues) Sort added in v0.7.0

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

Sort sorts issues.

type Outcome

type Outcome map[string]Issues

Outcome represents outcomes resulting from sanitization pass.

func (Outcome) Dump added in v0.20.0

func (o Outcome) Dump()

func (Outcome) Filter added in v0.6.2

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

Filter filters outcomes based on lint level.

func (Outcome) For

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

For returns issues for a given section/group.

func (Outcome) HasIssues added in v0.20.0

func (o Outcome) HasIssues() bool

func (Outcome) MarshalJSON added in v0.20.0

func (o Outcome) MarshalJSON() ([]byte, error)

func (Outcome) MarshalYAML added in v0.20.0

func (o Outcome) MarshalYAML() (interface{}, error)

func (Outcome) MaxGroupSeverity

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

MaxGroupSeverity scans the issues and reports the highest severity.

func (Outcome) MaxSeverity

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

MaxSeverity scans the issues and reports the highest severity.

func (Outcome) NSTally added in v0.20.0

func (o Outcome) NSTally() tally.Namespace

NSTally collects Namespace code tally for a given linter.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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