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, OutFormatCheckstyle, OutFormatSonarQube, }
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 ¶
type Checkstyle struct {
// contains filtered or unexported fields
}
Checkstyle is a Checkstyle printer meant for use by a Checkstyle annotation
func NewCheckstyle ¶
func NewCheckstyle(w io.Writer) *Checkstyle
NewGitHubActions returns a new GitHubActions printer
func (*Checkstyle) End ¶
func (p *Checkstyle) End()
func (*Checkstyle) Print ¶
func (p *Checkstyle) Print(fs *result.FileResults) error
Print prints in the format for Checkstyle https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-error-message
func (*Checkstyle) PrintSuccessExitMessage ¶
func (p *Checkstyle) PrintSuccessExitMessage() bool
func (*Checkstyle) Start ¶
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 ¶
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 ¶
func (p *GitHubActions) PrintSuccessExitMessage() bool
func (*GitHubActions) Start ¶
func (p *GitHubActions) Start()
type JSON ¶
type JSON struct {
// contains filtered or unexported fields
}
JSON is a JSON printer meant for a machine to read
func (*JSON) Print ¶
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 ¶
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 ¶
type SonarQube ¶
type SonarQube struct {
// contains filtered or unexported fields
}
SonarQube is a JSON printer meant for import into SonarQube
func NewSonarQube ¶
NewSonarQube returns a new SonarQube JSON printer
func (*SonarQube) Print ¶
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 ¶
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