mirror of
https://github.com/prompt-security/clawsec.git
synced 2026-06-18 07:51:20 +03:00
auto-claude: subtask-2-2 - Add INFO-SUPPRESSED section to report output
- Added lineForSuppressedFinding() to format suppressed findings - Added INFO-SUPPRESSED section showing suppressed findings with reason and date - Suppressed findings are not counted in summary (already filtered) - Follows existing code patterns for report sections Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -116,6 +116,14 @@ function lineForFinding(f) {
|
||||
return `- ${id} ${title}${fixLine ? `\n ${fixLine}` : ""}`;
|
||||
}
|
||||
|
||||
function lineForSuppressedFinding(f) {
|
||||
const id = f?.checkId ?? "(no-checkId)";
|
||||
const title = f?.title ?? "(no-title)";
|
||||
const reason = f?.suppressionReason ?? "(no reason)";
|
||||
const date = f?.suppressedAt ?? "(no date)";
|
||||
return `- ${id} ${title}\n Suppressed: ${reason} (${date})`;
|
||||
}
|
||||
|
||||
function render({ audit, deep, label, suppressedFindings = [] }) {
|
||||
const now = new Date().toISOString();
|
||||
const a = pickFindings(audit);
|
||||
@@ -163,6 +171,15 @@ function render({ audit, deep, label, suppressedFindings = [] }) {
|
||||
for (const e of errors) lines.push(`- ${e}`);
|
||||
}
|
||||
|
||||
// Show suppressed findings
|
||||
if (suppressedFindings.length) {
|
||||
lines.push("");
|
||||
lines.push("INFO-SUPPRESSED:");
|
||||
for (const f of suppressedFindings) {
|
||||
lines.push(lineForSuppressedFinding(f));
|
||||
}
|
||||
}
|
||||
|
||||
return lines.join("\n");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user