reporter

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

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 {
	Title  string `json:"title"`
	Result string `json:"result"`
}

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) ConsoleReporter

func (ConsoleReporter) Submit

func (cr ConsoleReporter) Submit(summary Summary) error

type GithubReporter

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

func NewGithubReporter

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

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 {
	Path          string
	ModifiedLines []int
	Rule          parser.Rule
	Problem       checks.Problem
	Owner         string
}

type Reporter

type Reporter interface {
	Submit(Summary) error
}

type Summary

type Summary struct {
	Reports []Report
}

func (Summary) CountBySeverity

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

func (Summary) HasFatalProblems

func (s Summary) HasFatalProblems() bool

Jump to

Keyboard shortcuts

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