Skip to content

feat: surface prod vs dev split in severity summary - #1074

Merged
sonukapoor merged 4 commits into
mainfrom
feature/issue-991-dev-prod-severity-split
Sep 5, 2026
Merged

feat: surface prod vs dev split in severity summary#1074
sonukapoor merged 4 commits into
mainfrom
feature/issue-991-dev-prod-severity-split

Conversation

@sonukapoor

Copy link
Copy Markdown
Collaborator

Surfaces a contextual "N of M findings in prod dependencies" line below the severity summary when some findings belong to dev-only packages. Silent when all findings are prod or when the lockfile parser didn't populate the dev flag.

Terminal (compact and verbose): a line in gray appears below the severity table/summary box only when there is a dev/prod split.

HTML report: a small centered note appears below the sev-card strip under the same condition.

Also fixes the priority signal legend in the HTML report: removes the 32px horizontal indent and adds 16px top spacing so it sits flush with the table width and has breathing room above it.

Closes #991

Add countProdFindings helper to formatters.ts that returns prod/dev counts
when at least one finding has pkg.dev defined and devTotal > 0, or null when
the split adds no signal (all prod or dev flag unavailable). Wire the helper
into printSummary so a contextual gray line appears below the severity table
only when meaningful.
When some findings belong to dev dependencies, a contextual line now
appears below the severity card strip: "N of M findings in prod
dependencies". Silent when all findings are prod or when the dev flag
is unavailable on all findings.

CSS class .sev-dev-note added to REPORT_STYLES. Logic uses the
serialized finding dev field (boolean) that buildReportData populates
via serializeFinding. Three tests added to tests/html-reporter.test.ts.
@sonukapoor
sonukapoor merged commit 16d746c into main Sep 5, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement] Break down severity totals by dev vs production dependencies

1 participant