reporter

package
v0.40.1 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BitBucketDescription = "pint is a Prometheus rule linter/validator.\n" +
		"It will inspect all Prometheus recording and alerting rules for problems that could prevent these from working correctly.\n" +
		"Checks can be either offline (static checks using only rule definition) or online (validate rule against live Prometheus server)."
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BitBucketAnnotation

type BitBucketAnnotation struct {
	Path     string `json:"path"`
	Line     int    `json:"line"`
	Message  string `json:"message"`
	Severity string `json:"severity"`
	Type     string `json:"type"`
	Link     string `json:"link"`
}

type BitBucketAnnotations

type BitBucketAnnotations struct {
	Annotations []BitBucketAnnotation `json:"annotations"`
}

type BitBucketReport

type BitBucketReport struct {
	Reporter string                `json:"reporter"`
	Title    string                `json:"title"`
	Result   string                `json:"result"`
	Details  string                `json:"details"`
	Link     string                `json:"link"`
	Data     []BitBucketReportData `json:"data"`
}

type BitBucketReportData added in v0.27.0

type BitBucketReportData struct {
	Title string   `json:"title"`
	Type  DataType `json:"type"`
	Value any      `json:"value"`
}

type BitBucketReporter

type BitBucketReporter struct {
	// contains filtered or unexported fields
}

BitBucketReporter send linter results to BitBucket using https://docs.atlassian.com/bitbucket-server/rest/7.8.0/bitbucket-code-insights-rest.html

func NewBitBucketReporter

func NewBitBucketReporter(version, uri string, timeout time.Duration, token, project, repo string, gitCmd git.CommandRunner) BitBucketReporter

func (BitBucketReporter) Submit

func (r BitBucketReporter) Submit(summary Summary) (err error)

type ConsoleReporter

type ConsoleReporter struct {
	// contains filtered or unexported fields
}

func NewConsoleReporter

func NewConsoleReporter(output io.Writer, minSeverity checks.Severity) ConsoleReporter

func (ConsoleReporter) Submit

func (cr ConsoleReporter) Submit(summary Summary) error

type DataType added in v0.27.0

type DataType string
const (
	BooleanType    DataType = "BOOLEAN"
	DateType       DataType = "DATA"
	DurationType   DataType = "DURATION"
	LinkType       DataType = "LINK"
	NumberType     DataType = "NUMBER"
	PercentageType DataType = "PERCENTAGE"
	TextType       DataType = "TEXT"
)

type GithubReporter

type GithubReporter struct {
	// contains filtered or unexported fields
}

func NewGithubReporter

func NewGithubReporter(version, baseURL, uploadURL string, timeout time.Duration, token, owner, repo string, prNum int, gitCmd git.CommandRunner) (_ GithubReporter, err error)

NewGithubReporter creates a new GitHub reporter that reports problems via comments on a given pull request number (integer).

func (GithubReporter) Submit

func (gr GithubReporter) Submit(summary Summary) error

Submit submits the summary to GitHub.

type Report

type Report struct {
	ReportedPath  string
	SourcePath    string
	ModifiedLines []int
	Rule          parser.Rule
	Problem       checks.Problem
	Owner         string
}

type Reporter

type Reporter interface {
	Submit(Summary) error
}

type Summary

type Summary struct {
	OfflineChecks int64
	OnlineChecks  int64
	Duration      time.Duration
	Entries       int
	// contains filtered or unexported fields
}

func NewSummary added in v0.27.0

func NewSummary(reports []Report) Summary

func (Summary) CountBySeverity

func (s Summary) CountBySeverity() map[checks.Severity]int

func (Summary) HasFatalProblems

func (s Summary) HasFatalProblems() bool

func (*Summary) Report added in v0.27.0

func (s *Summary) Report(reps ...Report)

func (Summary) Reports

func (s Summary) Reports() (reports []Report)

Jump to

Keyboard shortcuts

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