Documentation
¶
Overview ¶
Package output formats review results for terminal and machine consumption.
Index ¶
- func FormatGitHubReview(findings []Finding) string
- func FormatJSON(findings []Finding) (string, error)
- func FormatSARIF(findings []Finding) (string, error)
- func FormatTerminal(findings []Finding, stats Stats) string
- type Finding
- type SARIFArtifactChange
- type SARIFArtifactLocation
- type SARIFDriver
- type SARIFFix
- type SARIFInsertedContent
- type SARIFLocation
- type SARIFLog
- type SARIFMultiformat
- type SARIFPhysicalLocation
- type SARIFRegion
- type SARIFReplacement
- type SARIFResult
- type SARIFRule
- type SARIFRuleConfig
- type SARIFRun
- type SARIFTaxaReference
- type SARIFTool
- type Stats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatGitHubReview ¶
FormatGitHubReview formats all findings as a single GitHub PR review body.
func FormatJSON ¶
FormatJSON renders findings as machine-readable JSON.
func FormatSARIF ¶
FormatSARIF produces SARIF 2.1.0 JSON from review findings.
func FormatTerminal ¶
FormatTerminal renders a human-readable review report with ANSI colors.
Types ¶
type Finding ¶
type Finding struct {
Concern string
Severity int
File string
Line int
EndLine int
Message string
Fix string
Reasoning string
CWE string
}
Finding for rendering.
type SARIFArtifactChange ¶
type SARIFArtifactChange struct {
ArtifactLocation SARIFArtifactLocation `json:"artifactLocation"`
Replacements []SARIFReplacement `json:"replacements"`
}
type SARIFArtifactLocation ¶
type SARIFArtifactLocation struct {
URI string `json:"uri"`
}
type SARIFDriver ¶
type SARIFFix ¶
type SARIFFix struct {
Description SARIFMultiformat `json:"description"`
Changes []SARIFArtifactChange `json:"artifactChanges"`
}
type SARIFInsertedContent ¶
type SARIFInsertedContent struct {
Text string `json:"text"`
}
type SARIFLocation ¶
type SARIFLocation struct {
PhysicalLocation SARIFPhysicalLocation `json:"physicalLocation"`
}
type SARIFMultiformat ¶
type SARIFMultiformat struct {
Text string `json:"text"`
}
type SARIFPhysicalLocation ¶
type SARIFPhysicalLocation struct {
ArtifactLocation SARIFArtifactLocation `json:"artifactLocation"`
Region *SARIFRegion `json:"region,omitempty"`
}
type SARIFRegion ¶
type SARIFReplacement ¶
type SARIFReplacement struct {
DeletedRegion SARIFRegion `json:"deletedRegion"`
InsertedContent *SARIFInsertedContent `json:"insertedContent,omitempty"`
}
type SARIFResult ¶
type SARIFResult struct {
RuleID string `json:"ruleId"`
Level string `json:"level"`
Message SARIFMultiformat `json:"message"`
Locations []SARIFLocation `json:"locations,omitempty"`
Fixes []SARIFFix `json:"fixes,omitempty"`
Taxa []SARIFTaxaReference `json:"taxa,omitempty"`
}
type SARIFRule ¶
type SARIFRule struct {
ID string `json:"id"`
Name string `json:"name"`
ShortDescription SARIFMultiformat `json:"shortDescription"`
DefaultConfig *SARIFRuleConfig `json:"defaultConfiguration,omitempty"`
}
type SARIFRuleConfig ¶
type SARIFRuleConfig struct {
Level string `json:"level"`
}
type SARIFRun ¶
type SARIFRun struct {
Tool SARIFTool `json:"tool"`
Results []SARIFResult `json:"results"`
}
type SARIFTaxaReference ¶
type SARIFTaxaReference struct {
ID string `json:"id"`
ToolComponent SARIFMultiformat `json:"toolComponent"`
}
SARIFTaxaReference references an external taxonomy entry (e.g., CWE).
type SARIFTool ¶
type SARIFTool struct {
Driver SARIFDriver `json:"driver"`
}
Click to show internal directories.
Click to hide internal directories.