Documentation
¶
Index ¶
- Constants
- type BitBucketAnnotation
- type BitBucketAnnotations
- type BitBucketCommentAnchor
- type BitBucketCommentAuthor
- type BitBucketCommentSeverityUpdate
- type BitBucketCommentStateUpdate
- type BitBucketDiffHunk
- type BitBucketDiffLine
- type BitBucketDiffSegment
- type BitBucketFileDiff
- type BitBucketFileDiffs
- type BitBucketPath
- type BitBucketPendingComment
- type BitBucketPendingCommentAnchor
- type BitBucketPullRequest
- type BitBucketPullRequestActivities
- type BitBucketPullRequestActivity
- type BitBucketPullRequestChange
- type BitBucketPullRequestChanges
- type BitBucketPullRequestComment
- type BitBucketPullRequests
- type BitBucketRef
- type BitBucketReport
- type BitBucketReportData
- type BitBucketReporter
- type ConsoleReporter
- type DataType
- type GithubReporter
- type Report
- type Reporter
- type Summary
- type TeamCityReporter
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 BitBucketAnnotations ¶
type BitBucketAnnotations struct {
Annotations []BitBucketAnnotation `json:"annotations"`
}
type BitBucketCommentAnchor ¶ added in v0.49.0
type BitBucketCommentAuthor ¶ added in v0.49.0
type BitBucketCommentAuthor struct {
Name string `json:"name"`
}
type BitBucketCommentSeverityUpdate ¶ added in v0.51.0
type BitBucketCommentStateUpdate ¶ added in v0.51.0
type BitBucketDiffHunk ¶ added in v0.49.0
type BitBucketDiffHunk struct {
Segments []BitBucketDiffSegment `json:"segments"`
}
type BitBucketDiffLine ¶ added in v0.49.0
type BitBucketDiffSegment ¶ added in v0.49.0
type BitBucketDiffSegment struct {
Type string `json:"type"`
Lines []BitBucketDiffLine `json:"lines"`
}
type BitBucketFileDiff ¶ added in v0.49.0
type BitBucketFileDiff struct {
Hunks []BitBucketDiffHunk `json:"hunks"`
}
type BitBucketFileDiffs ¶ added in v0.49.0
type BitBucketFileDiffs struct {
Diffs []BitBucketFileDiff `json:"diffs"`
}
type BitBucketPath ¶ added in v0.49.0
type BitBucketPath struct {
ToString string `json:"toString"`
}
type BitBucketPendingComment ¶ added in v0.49.0
type BitBucketPendingComment struct {
Text string `json:"text"`
Severity string `json:"severity"`
Anchor BitBucketPendingCommentAnchor `json:"anchor"`
}
type BitBucketPendingCommentAnchor ¶ added in v0.49.0
type BitBucketPullRequest ¶ added in v0.49.0
type BitBucketPullRequest struct {
ID int `json:"id"`
Open bool `json:"open"`
FromRef BitBucketRef `json:"fromRef"`
ToRef BitBucketRef `json:"toRef"`
}
type BitBucketPullRequestActivities ¶ added in v0.49.0
type BitBucketPullRequestActivities struct {
Start int `json:"start"`
NextPageStart int `json:"nextPageStart"`
IsLastPage bool `json:"isLastPage"`
Values []BitBucketPullRequestActivity `json:"values"`
}
type BitBucketPullRequestActivity ¶ added in v0.49.0
type BitBucketPullRequestActivity struct {
Action string `json:"action"`
CommentAction string `json:"commentAction"`
CommentAnchor BitBucketCommentAnchor `json:"commentAnchor"`
Comment BitBucketPullRequestComment `json:"comment"`
}
type BitBucketPullRequestChange ¶ added in v0.49.0
type BitBucketPullRequestChange struct {
Path BitBucketPath `json:"path"`
}
type BitBucketPullRequestChanges ¶ added in v0.49.0
type BitBucketPullRequestChanges struct {
Start int `json:"start"`
NextPageStart int `json:"nextPageStart"`
IsLastPage bool `json:"isLastPage"`
Values []BitBucketPullRequestChange `json:"values"`
}
type BitBucketPullRequestComment ¶ added in v0.49.0
type BitBucketPullRequestComment struct {
ID int `json:"id"`
Version int `json:"version"`
State string `json:"state"`
Author BitBucketCommentAuthor `json:"author"`
Text string `json:"text"`
Severity string `json:"severity"`
Comments []BitBucketPullRequestComment `json:"comments"`
Resolved bool `json:"threadResolved"`
}
type BitBucketPullRequests ¶ added in v0.49.0
type BitBucketPullRequests struct {
Start int `json:"start"`
NextPageStart int `json:"nextPageStart"`
IsLastPage bool `json:"isLastPage"`
Values []BitBucketPullRequest `json:"values"`
}
type BitBucketRef ¶ added in v0.49.0
type BitBucketReport ¶
type BitBucketReportData ¶ added in v0.27.0
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) (err error)
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 Summary ¶
type Summary struct {
OfflineChecks int64
OnlineChecks int64
Duration time.Duration
TotalEntries int
CheckedEntries int64
// contains filtered or unexported fields
}
func NewSummary ¶ added in v0.27.0
func (Summary) HasFatalProblems ¶
func (*Summary) SortReports ¶ added in v0.49.0
func (s *Summary) SortReports()
type TeamCityReporter ¶ added in v0.49.0
type TeamCityReporter struct {
// contains filtered or unexported fields
}
func NewTeamCityReporter ¶ added in v0.49.0
func NewTeamCityReporter(output io.Writer) TeamCityReporter
func (TeamCityReporter) Submit ¶ added in v0.49.0
func (tc TeamCityReporter) Submit(summary Summary) error
Click to show internal directories.
Click to hide internal directories.