From 02758cc051af7aabc21ee3c2a7c7c6d43513931d Mon Sep 17 00:00:00 2001 From: Valera Satsura Date: Mon, 13 Jul 2026 08:43:37 +0300 Subject: [PATCH] Keep the rule's explanation in the report --- src/merge.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/merge.ts b/src/merge.ts index 134ca38..c1efec2 100644 --- a/src/merge.ts +++ b/src/merge.ts @@ -18,10 +18,17 @@ interface SarifRun { [key: string]: unknown; } -/** Rule fields the backend uses (severity, docs) or that stay cheap. Everything - * else — `help`, `fullDescription`, `relationships` — is prose we would ship - * by the megabyte. */ -const KEPT_RULE_FIELDS = ["id", "name", "shortDescription", "helpUri", "properties", "defaultConfiguration"]; +/** + * Rule fields worth their weight: severity (`properties`), the human title + * (`shortDescription`), the explanation (`fullDescription`) and the docs link. + * + * `help` is dropped — scanners repeat the whole advisory there, which is what + * made these reports weigh tens of megabytes. `fullDescription` is a sentence + * or two and is what a reader actually needs. + */ +const KEPT_RULE_FIELDS = [ + "id", "name", "shortDescription", "fullDescription", "helpUri", "properties", "defaultConfiguration", +]; function slimRule(rule: SarifRule): SarifRule { const out: SarifRule = {};