Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Aggregate ¶ added in v0.10.0
An Aggregate is data collected by some rule while processing a file AST, to be used later by other rules needing a global context (i.e. broader than per-file) Rule authors are expected to collect the minimum needed data, to avoid performance problems while working with large Rego code repositories.
type Location ¶
type Location struct { Column int `json:"col"` Row int `json:"row"` Offset int `json:"offset,omitempty"` File string `json:"file"` Text *string `json:"text,omitempty"` }
Location provides information on the location of a violation.
type Notice ¶ added in v0.12.0
type Notice struct { Title string `json:"title"` Description string `json:"description"` Category string `json:"category"` Level string `json:"level"` Severity string `json:"severity"` }
Notice describes any notice found by Regal.
type ProfileEntry ¶ added in v0.10.0
type ProfileEntry struct { Location string `json:"location"` TotalTimeNs int64 `json:"total_time_ns"` NumEval int `json:"num_eval"` NumRedo int `json:"num_redo"` NumGenExpr int `json:"num_gen_expr"` }
ProfileEntry is a single entry of profiling information, keyed by location. This data may have been aggregated across multiple runs.
type RelatedResource ¶
type RelatedResource struct { Description string `json:"description"` Reference string `json:"ref"` }
RelatedResource provides documentation on a violation.
type Report ¶
type Report struct { Violations []Violation `json:"violations"` // We don't have aggregates when publishing the final report (see JSONReporter), so omitempty is needed here // to avoid surfacing a null/empty field. Aggregates map[string][]Aggregate `json:"aggregates,omitempty"` Notices []Notice `json:"notices,omitempty"` Summary Summary `json:"summary"` Metrics map[string]any `json:"metrics,omitempty"` AggregateProfile map[string]ProfileEntry `json:"-"` Profile []ProfileEntry `json:"profile,omitempty"` }
Report aggregate of Violation as returned by a linter run.
func (*Report) AddProfileEntries ¶ added in v0.10.0
func (r *Report) AddProfileEntries(prof map[string]ProfileEntry)
func (*Report) AggregateProfileToSortedProfile ¶ added in v0.10.0
func (Report) ViolationsFileCount ¶
ViolationsFileCount returns the number of files containing violations.
type Violation ¶
type Violation struct { Title string `json:"title"` Description string `json:"description"` Category string `json:"category"` Level string `json:"level"` RelatedResources []RelatedResource `json:"related_resources,omitempty"` Location Location `json:"location,omitempty"` IsAggregate bool `json:"-"` }
Violation describes any violation found by Regal.