Documentation ¶
Index ¶
Constants ¶
const ( // OutFormatText is a text-based output format, best for CLIs OutFormatText = "text" // OutFormatSimple is a simplified output format, which can be used with something like https://github.com/reviewdog/reviewdog OutFormatSimple = "simple" // OutFormatGitHubActions is an output format supported by GitHub Actions annotations // https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-a-warning-message OutFormatGitHubActions = "github-actions" // OutFormatJSON outputs in json OutFormatJSON = "json" // OutFormatSonarQube is an output format supported by SonarQube // https://docs.sonarqube.org/latest/analysis/generic-issue/ OutFormatSonarQube = "sonarqube" // OutFormatCheckstyle outputs in checkstyle format. // https://github.com/checkstyle/checkstyle OutFormatCheckstyle = "checkstyle" )
Variables ¶
var OutFormats = []string{ OutFormatText, OutFormatSimple, OutFormatGitHubActions, OutFormatJSON, OutFormatSonarQube, OutFormatCheckstyle, }
OutFormats are all the available output formats. The first one should be the default
var OutFormatsString = strings.Join(OutFormats, ",")
OutFormatsString is all OutFormats, as a comma-separated string
Functions ¶
This section is empty.
Types ¶
type Checkstyle ¶ added in v0.19.0
type Checkstyle struct {
// contains filtered or unexported fields
}
Checkstyle is a Checkstyle printer meant for use by a Checkstyle annotation
func NewCheckstyle ¶ added in v0.19.0
func NewCheckstyle(w io.Writer) *Checkstyle
NewCheckstyle returns a new Checkstyle printer
func (*Checkstyle) End ¶ added in v0.19.0
func (p *Checkstyle) End()
func (*Checkstyle) Print ¶ added in v0.19.0
func (p *Checkstyle) Print(fs *result.FileResults) error
Print prints in the format for Checkstyle. https://github.com/checkstyle/checkstyle
func (*Checkstyle) PrintSuccessExitMessage ¶ added in v0.19.0
func (p *Checkstyle) PrintSuccessExitMessage() bool
func (*Checkstyle) Start ¶ added in v0.19.0
func (p *Checkstyle) Start()
type GitHubActions ¶
type GitHubActions struct {
// contains filtered or unexported fields
}
GitHubActions is a GitHubActions printer meant for use by a GitHub Action annotation
func NewGitHubActions ¶
func NewGitHubActions(w io.Writer) *GitHubActions
NewGitHubActions returns a new GitHubActions printer
func (*GitHubActions) End ¶ added in v0.13.0
func (p *GitHubActions) End()
func (*GitHubActions) Print ¶
func (p *GitHubActions) Print(fs *result.FileResults) error
Print prints in the format for GitHub actions https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-error-message
func (*GitHubActions) PrintSuccessExitMessage ¶ added in v0.13.0
func (p *GitHubActions) PrintSuccessExitMessage() bool
func (*GitHubActions) Start ¶ added in v0.13.0
func (p *GitHubActions) Start()
type JSON ¶ added in v0.2.0
type JSON struct {
// contains filtered or unexported fields
}
JSON is a JSON printer meant for a machine to read
func (*JSON) Print ¶ added in v0.2.0
func (p *JSON) Print(fs *result.FileResults) error
Print prints in FileResults as json NOTE: The JSON printer will bring each line result as a JSON string. It will not be presented as an array of FileResults. You will neeed to Split by new line to parse the full output
func (*JSON) PrintSuccessExitMessage ¶ added in v0.13.0
type Printer ¶
type Printer interface { Print(*result.FileResults) error Start() End() PrintSuccessExitMessage() bool }
Printer is an interface for printing FileResults
type Simple ¶
type Simple struct {
// contains filtered or unexported fields
}
Simple is a simple printer meant for a machine to read
func (*Simple) Print ¶
func (p *Simple) Print(fs *result.FileResults) error
Print prints in the format 'filename:line:column: message' based on golint's output: https://github.com/golang/lint/blob/738671d3881b9731cc63024d5d88cf28db875626/golint/golint.go#L121
func (*Simple) PrintSuccessExitMessage ¶ added in v0.13.0
type SonarQube ¶ added in v0.13.0
type SonarQube struct {
// contains filtered or unexported fields
}
SonarQube is a JSON printer meant for import into SonarQube
func NewSonarQube ¶ added in v0.13.0
NewSonarQube returns a new SonarQube JSON printer
func (*SonarQube) Print ¶ added in v0.13.0
func (p *SonarQube) Print(fs *result.FileResults) error
Print outputs lines in FileResults as sonarqube json format. NOTE: Start() must be called before printing results and End() after printing is complete in order to form a valid JSON structure for sonarqube to import.
func (*SonarQube) PrintSuccessExitMessage ¶ added in v0.13.0
type Text ¶
type Text struct {
// contains filtered or unexported fields
}
Text is a text printer meant for humans to read
func (*Text) Print ¶
func (t *Text) Print(fs *result.FileResults) error
Print prints the file results