Documentation
¶
Index ¶
- Constants
- func Detail(msg string)
- func Error(msg string)
- func GenerateMarkdownReport(input MarkdownReportInput) string
- func Header(msg string)
- func Info(msg string)
- func RenderDiff(f FindingOutput) []string
- func Success(msg string)
- func Warning(msg string)
- type FindingOutput
- type MarkdownReportInput
- type RepoResult
- type Report
- type ToolMeta
Constants ¶
View Source
const ( Reset = "\033[0m" Bold = "\033[1m" Red = "\033[31m" Green = "\033[32m" Yellow = "\033[33m" Cyan = "\033[36m" )
Variables ¶
This section is empty.
Functions ¶
func GenerateMarkdownReport ¶ added in v0.2.0
func GenerateMarkdownReport(input MarkdownReportInput) string
GenerateMarkdownReport produces a markdown report string from the input.
func RenderDiff ¶
func RenderDiff(f FindingOutput) []string
RenderDiff returns a colorized git-style line diff for a finding.
Types ¶
type FindingOutput ¶
type FindingOutput struct {
FilePath string `json:"file_path"`
Operation string `json:"operation"`
Message string `json:"message"`
Expected string `json:"-"`
Actual string `json:"-"`
}
FindingOutput is the JSON representation of a finding.
type MarkdownReportInput ¶ added in v0.2.0
type MarkdownReportInput struct {
// RepoFindings maps repo name to its list of findings.
RepoFindings map[string][]FindingOutput
// CollapseDiffs controls whether diffs are wrapped in <details> blocks.
CollapseDiffs bool
}
MarkdownReportInput holds the data needed to generate a markdown report.
type RepoResult ¶
type RepoResult struct {
Name string `json:"repo"`
Status string `json:"status"`
StatusDetail string `json:"status_detail,omitempty"`
ValidationErrors []string `json:"validation_errors,omitempty"`
Findings []FindingOutput `json:"findings,omitempty"`
}
RepoResult represents the result for a single repository.
type Report ¶
type Report struct {
Tool ToolMeta `json:"tool"`
RootConfig string `json:"root_config_path"`
ConfigRepo string `json:"central_config_path"`
IgnoreMissing bool `json:"-"`
Repos []RepoResult `json:"repos"`
}
Report is the structured JSON output for all commands.
func (*Report) HasFailures ¶
HasFailures returns true if any repo has a non-clean status that indicates failure.
func (*Report) PrintHuman ¶
PrintHuman outputs the report in human-readable format.
Click to show internal directories.
Click to hide internal directories.