Documentation ¶
Index ¶
- Constants
- Variables
- func LevelToStr(l rules.Level) string
- func SortKeys(k1, k2 string) int
- type Codes
- type Collector
- func (c *Collector) AddCode(ctx context.Context, code rules.ID, args ...interface{})
- func (c *Collector) AddErr(ctx context.Context, errs ...error)
- func (c *Collector) AddSubCode(ctx context.Context, code rules.ID, args ...interface{})
- func (c *Collector) ClearOutcome(fqn string)
- func (c *Collector) CloseOutcome(ctx context.Context, fqn string, cos []string)
- func (c *Collector) InitOutcome(fqn string)
- func (c *Collector) MaxSeverity(fqn string) rules.Level
- func (c *Collector) NoConcerns(fqn string) bool
- func (c *Collector) Outcome() Outcome
- type Issue
- type Issues
- type Outcome
- func (o Outcome) Dump()
- func (o Outcome) Filter(level rules.Level) Outcome
- func (o Outcome) For(section, group string) Issues
- func (o Outcome) HasIssues() bool
- func (o Outcome) MarshalJSON() ([]byte, error)
- func (o Outcome) MarshalYAML() (interface{}, error)
- func (o Outcome) MaxGroupSeverity(section, group string) rules.Level
- func (o Outcome) MaxSeverity(section string) rules.Level
- func (o Outcome) NSTally() tally.Namespace
Constants ¶
const Root = "__root__"
Root denotes a root issue group.
Variables ¶
var Blank = Issue{}
Blank issue
Functions ¶
func LevelToStr ¶ added in v0.4.0
LevelToStr returns a severity level as a string.
Types ¶
type Codes ¶ added in v0.4.0
Codes represents a collection of linter codes.
type Collector ¶
Collector tracks linter issues and codes.
func NewCollector ¶
NewCollector returns a new issue collector.
func (*Collector) AddSubCode ¶ added in v0.4.0
AddSubCode add a sub error code.
func (*Collector) ClearOutcome ¶ added in v0.6.0
ClearOutcome delete all fqn related issues.
func (*Collector) CloseOutcome ¶ added in v0.20.0
func (*Collector) InitOutcome ¶
InitOutcome creates a places holder for potential issues.
func (*Collector) MaxSeverity ¶
MaxSeverity return the highest severity level for the given section.
func (*Collector) NoConcerns ¶
NoConcerns returns true if scan is successful.
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 (Issue) IsSubIssue ¶
IsSubIssue checks if error is a sub error.
type Issues ¶
type Issues []Issue
Issues represents a collection of issues.
func (Issues) MaxSeverity ¶
MaxSeverity gather the max severity in a collection of issues.
type Outcome ¶
Outcome represents outcomes resulting from sanitization pass.
func (Outcome) MarshalJSON ¶ added in v0.20.0
func (Outcome) MarshalYAML ¶ added in v0.20.0
func (Outcome) MaxGroupSeverity ¶
MaxGroupSeverity scans the issues and reports the highest severity.
func (Outcome) MaxSeverity ¶
MaxSeverity scans the issues and reports the highest severity.