Documentation ¶
Index ¶
- Constants
- func Submit(ctx context.Context, s Summary, c Commenter) error
- 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 CheckStyleReporter
- type CommentReporter
- type Commenter
- type ConsoleReporter
- type DataType
- type ExistingComment
- type GitLabReporter
- func (gl GitLabReporter) CanCreate(done int) bool
- func (gl GitLabReporter) CanDelete(ExistingComment) bool
- func (gl GitLabReporter) Create(ctx context.Context, dst any, comment PendingComment) error
- func (gl GitLabReporter) Delete(ctx context.Context, dst any, comment ExistingComment) error
- func (gl GitLabReporter) Describe() string
- func (gl GitLabReporter) Destinations(ctx context.Context) ([]any, error)
- func (gl GitLabReporter) IsEqual(_ any, existing ExistingComment, pending PendingComment) bool
- func (gl GitLabReporter) List(ctx context.Context, dst any) ([]ExistingComment, error)
- func (gl GitLabReporter) Summary(ctx context.Context, dst any, s Summary, errs []error) (err error)
- type GithubReporter
- func (gr GithubReporter) CanCreate(done int) bool
- func (gr GithubReporter) CanDelete(ExistingComment) bool
- func (gr GithubReporter) Create(ctx context.Context, dst any, p PendingComment) error
- func (gr GithubReporter) Delete(_ context.Context, _ any, _ ExistingComment) error
- func (gr GithubReporter) Describe() string
- func (gr GithubReporter) Destinations(ctx context.Context) (_ []any, err error)
- func (gr GithubReporter) IsEqual(dst any, existing ExistingComment, pending PendingComment) bool
- func (gr GithubReporter) List(ctx context.Context, _ any) ([]ExistingComment, error)
- func (gr GithubReporter) Summary(ctx context.Context, _ any, s Summary, errs []error) error
- type JSONReport
- type JSONReporter
- type PendingComment
- 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 ¶
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 { FromRef BitBucketRef `json:"fromRef"` ToRef BitBucketRef `json:"toRef"` ID int `json:"id"` Open bool `json:"open"` }
type BitBucketPullRequestActivities ¶ added in v0.49.0
type BitBucketPullRequestActivities struct { Values []BitBucketPullRequestActivity `json:"values"` Start int `json:"start"` NextPageStart int `json:"nextPageStart"` IsLastPage bool `json:"isLastPage"` }
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 { Values []BitBucketPullRequestChange `json:"values"` Start int `json:"start"` NextPageStart int `json:"nextPageStart"` IsLastPage bool `json:"isLastPage"` }
type BitBucketPullRequestComment ¶ added in v0.49.0
type BitBucketPullRequestComment struct { State string `json:"state"` Author BitBucketCommentAuthor `json:"author"` Text string `json:"text"` Severity string `json:"severity"` Comments []BitBucketPullRequestComment `json:"comments"` ID int `json:"id"` Version int `json:"version"` Resolved bool `json:"threadResolved"` }
type BitBucketPullRequests ¶ added in v0.49.0
type BitBucketPullRequests struct { Values []BitBucketPullRequest `json:"values"` Start int `json:"start"` NextPageStart int `json:"nextPageStart"` IsLastPage bool `json:"isLastPage"` }
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, maxComments int, gitCmd git.CommandRunner) BitBucketReporter
func (BitBucketReporter) Submit ¶
func (bb BitBucketReporter) Submit(summary Summary) (err error)
type CheckStyleReporter ¶ added in v0.67.0
type CheckStyleReporter struct {
// contains filtered or unexported fields
}
func NewCheckStyleReporter ¶ added in v0.67.0
func NewCheckStyleReporter(output io.Writer) CheckStyleReporter
func (CheckStyleReporter) Submit ¶ added in v0.67.0
func (cs CheckStyleReporter) Submit(summary Summary) error
type CommentReporter ¶ added in v0.63.0
type CommentReporter struct {
// contains filtered or unexported fields
}
func NewCommentReporter ¶ added in v0.63.0
func NewCommentReporter(c Commenter) CommentReporter
func (CommentReporter) Submit ¶ added in v0.63.0
func (cr CommentReporter) Submit(summary Summary) (err error)
type Commenter ¶ added in v0.59.0
type Commenter interface { Describe() string Destinations(context.Context) ([]any, error) Summary(context.Context, any, Summary, []error) error List(context.Context, any) ([]ExistingComment, error) Create(context.Context, any, PendingComment) error Delete(context.Context, any, ExistingComment) error CanCreate(int) bool CanDelete(ExistingComment) bool IsEqual(any, ExistingComment, PendingComment) bool }
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 ExistingComment ¶ added in v0.63.0
type ExistingComment struct {
// contains filtered or unexported fields
}
type GitLabReporter ¶ added in v0.59.0
type GitLabReporter struct {
// contains filtered or unexported fields
}
func NewGitLabReporter ¶ added in v0.59.0
func (GitLabReporter) CanCreate ¶ added in v0.59.0
func (gl GitLabReporter) CanCreate(done int) bool
func (GitLabReporter) CanDelete ¶ added in v0.63.0
func (gl GitLabReporter) CanDelete(ExistingComment) bool
func (GitLabReporter) Create ¶ added in v0.59.0
func (gl GitLabReporter) Create(ctx context.Context, dst any, comment PendingComment) error
func (GitLabReporter) Delete ¶ added in v0.59.0
func (gl GitLabReporter) Delete(ctx context.Context, dst any, comment ExistingComment) error
func (GitLabReporter) Describe ¶ added in v0.59.0
func (gl GitLabReporter) Describe() string
func (GitLabReporter) Destinations ¶ added in v0.59.0
func (gl GitLabReporter) Destinations(ctx context.Context) ([]any, error)
func (GitLabReporter) IsEqual ¶ added in v0.59.0
func (gl GitLabReporter) IsEqual(_ any, existing ExistingComment, pending PendingComment) bool
func (GitLabReporter) List ¶ added in v0.59.0
func (gl GitLabReporter) List(ctx context.Context, dst any) ([]ExistingComment, 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, maxComments int, headCommit string) (_ GithubReporter, err error)
NewGithubReporter creates a new GitHub reporter that reports problems via comments on a given pull request number (integer).
func (GithubReporter) CanCreate ¶ added in v0.63.0
func (gr GithubReporter) CanCreate(done int) bool
func (GithubReporter) CanDelete ¶ added in v0.63.0
func (gr GithubReporter) CanDelete(ExistingComment) bool
func (GithubReporter) Create ¶ added in v0.63.0
func (gr GithubReporter) Create(ctx context.Context, dst any, p PendingComment) error
func (GithubReporter) Delete ¶ added in v0.63.0
func (gr GithubReporter) Delete(_ context.Context, _ any, _ ExistingComment) error
func (GithubReporter) Describe ¶ added in v0.63.0
func (gr GithubReporter) Describe() string
func (GithubReporter) Destinations ¶ added in v0.63.0
func (gr GithubReporter) Destinations(ctx context.Context) (_ []any, err error)
func (GithubReporter) IsEqual ¶ added in v0.63.0
func (gr GithubReporter) IsEqual(dst any, existing ExistingComment, pending PendingComment) bool
func (GithubReporter) List ¶ added in v0.63.0
func (gr GithubReporter) List(ctx context.Context, _ any) ([]ExistingComment, error)
type JSONReport ¶ added in v0.67.0
type JSONReporter ¶ added in v0.67.0
type JSONReporter struct {
// contains filtered or unexported fields
}
func NewJSONReporter ¶ added in v0.67.0
func NewJSONReporter(output io.Writer) JSONReporter
func (JSONReporter) Submit ¶ added in v0.67.0
func (jr JSONReporter) Submit(summary Summary) (err error)
type PendingComment ¶ added in v0.63.0
type PendingComment struct {
// contains filtered or unexported fields
}
type Report ¶
type Report struct { Path discovery.Path Owner string ModifiedLines []int Rule parser.Rule Problem checks.Problem }
func (Report) MarshalXML ¶ added in v0.67.0
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.