mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-19 02:17:09 +00:00
style(audit): add vertical spacing between CLI output sections
Header, findings, and summary box were visually cramped with no blank lines separating them. Add breathing room between: - header box and first finding (single-skill / path mode) - last arrow line and summary box - logical groups inside summary box (policy / counts / severity / aggregate / note)
This commit is contained in:
@@ -759,7 +759,9 @@ func auditSkillByName(sourcePath, name, mode, projectRoot, threshold, format, po
|
||||
summaryLines := buildAuditSummaryLines(summary)
|
||||
minWidth := auditHeaderMinWidth(subtitle)
|
||||
ui.HeaderBoxWithMinWidth(auditHeaderTitle(mode), subtitle, minWidth)
|
||||
fmt.Println()
|
||||
printSkillResult(result, elapsed)
|
||||
fmt.Println()
|
||||
printAuditSummary(summary, summaryLines, minWidth)
|
||||
}
|
||||
|
||||
@@ -798,7 +800,9 @@ func auditPath(rawPath, mode, projectRoot, threshold, format, policyLine string,
|
||||
summaryLines := buildAuditSummaryLines(summary)
|
||||
minWidth := auditHeaderMinWidth(subtitle)
|
||||
ui.HeaderBoxWithMinWidth(auditHeaderTitle(mode), subtitle, minWidth)
|
||||
fmt.Println()
|
||||
printSkillResult(result, elapsed)
|
||||
fmt.Println()
|
||||
printAuditSummary(summary, summaryLines, minWidth)
|
||||
}
|
||||
return []*audit.Result{result}, summary, nil
|
||||
|
||||
@@ -161,9 +161,13 @@ func buildAuditSummaryLines(summary auditRunSummary) []string {
|
||||
if maxSeverity == "" {
|
||||
maxSeverity = "NONE"
|
||||
}
|
||||
// -- Policy settings --
|
||||
lines = append(lines, fmt.Sprintf(" Block: severity >= %s", ui.Colorize(ui.SeverityColor(summary.Threshold), summary.Threshold)))
|
||||
lines = append(lines, fmt.Sprintf(" Policy: %s", formatPolicyLine(summary.PolicyProfile, summary.PolicyDedupe, summary.PolicyAnalyzers)))
|
||||
lines = append(lines, fmt.Sprintf(" Max sev: %s", ui.Colorize(ui.SeverityColor(maxSeverity), maxSeverity)))
|
||||
|
||||
// -- Result counts --
|
||||
lines = append(lines, "")
|
||||
lines = append(lines, fmt.Sprintf(" Scanned: %d skill(s)", summary.Scanned))
|
||||
lines = append(lines, fmt.Sprintf(" Passed: %s", ui.Colorize(ui.Green, fmt.Sprintf("%d", summary.Passed))))
|
||||
if summary.Warning > 0 {
|
||||
@@ -176,6 +180,9 @@ func buildAuditSummaryLines(summary auditRunSummary) []string {
|
||||
} else {
|
||||
lines = append(lines, fmt.Sprintf(" Failed: %d", summary.Failed))
|
||||
}
|
||||
|
||||
// -- Severity & threat breakdown --
|
||||
lines = append(lines, "")
|
||||
lines = append(lines, fmt.Sprintf(" Severity: c/h/m/l/i = %s/%s/%s/%s/%s",
|
||||
ui.Colorize(ui.SeverityColor("CRITICAL"), fmt.Sprintf("%d", summary.Critical)),
|
||||
ui.Colorize(ui.SeverityColor("HIGH"), fmt.Sprintf("%d", summary.High)),
|
||||
@@ -191,10 +198,16 @@ func buildAuditSummaryLines(summary auditRunSummary) []string {
|
||||
lines = append(lines, fmt.Sprintf(" Threats: %s", threatsLine))
|
||||
}
|
||||
}
|
||||
|
||||
// -- Aggregate risk --
|
||||
lines = append(lines, "")
|
||||
riskLabel := strings.ToUpper(summary.RiskLabel)
|
||||
riskText := fmt.Sprintf("%s (%d/100)", riskLabel, summary.RiskScore)
|
||||
lines = append(lines, fmt.Sprintf(" Aggregate: %s", ui.Colorize(riskColor(summary.RiskLabel), riskText)))
|
||||
lines = append(lines, fmt.Sprintf(" Auditable: %.0f%% avg", summary.AvgAnalyzability*100))
|
||||
|
||||
// -- Note --
|
||||
lines = append(lines, "")
|
||||
lines = append(lines, " Note: Failed uses severity gate; aggregate is informational")
|
||||
if summary.ScanErrors > 0 {
|
||||
lines = append(lines, fmt.Sprintf(" Scan errs: %d", summary.ScanErrors))
|
||||
|
||||
Reference in New Issue
Block a user