Skip to content

fix: resolve circular import and improve --check-overrides output UX#758

Merged
sonukapoor merged 4 commits into
mainfrom
fix/issue-757-override-output-ux
Jun 25, 2026
Merged

fix: resolve circular import and improve --check-overrides output UX#758
sonukapoor merged 4 commits into
mainfrom
fix/issue-757-override-output-ux

Conversation

@sonukapoor

Copy link
Copy Markdown
Collaborator

Fixes a circular ESM import that caused 35 test failures, and improves the terminal and HTML output for --check-overrides.

What changed

Circular import fix: override-findings-terminal.ts and formatters.ts had a circular dependency through formatSeverityLabel. Both now import it from src/utils/severity.ts instead.

Terminal output:

  • Verbose mode shows a cyan header without box-drawing separators
  • Compact mode wraps the section in separator lines
  • Override count appears in the quick-take section, suggested-fix coverage note, and final status line
  • Package manager label is shown when provided
  • Fix commands are deduplicated per ruleId

HTML report:

  • Severity group rows now carry both severity-group and the severity class so border-color CSS applies
  • Location cell shows file › jsonPath when a JSON path is present
  • Fix commands render as an inline block with a copy button

Tests: 33 new tests across the terminal renderer, HTML renderer, and core printer functions.

Closes #757

… break circular import

override-findings-terminal.ts imported formatSeverityLabel from formatters.ts while
formatters.ts re-exported renderOverrideFindings from override-findings-terminal.ts.
Moving the shared utilities to severity.ts removes the cycle and eliminates 35 test failures.
Terminal: verbose mode uses cyan header without box-drawing separators; compact mode
wraps the section in separator lines. Fix commands are deduplicated per ruleId.

HTML: severity group rows carry both severity-group and severity CSS classes so border
styles apply. Location cells show a separator between file and jsonPath. Fix commands
render as an inline block with a copy button when runnableCommand is set.
printActionSummary, printFinalStatus, printSuggestedFixCommands, and printCompactOutput
now accept overrideCount so override hygiene issues appear in the quick-take section,
suggested-fix coverage note, and final status line. printActionSummary and
printCompactOutput also accept packageManager to surface it at the top of output.
- 12 terminal tests: verbose vs compact header rendering, footer count, fix command
  deduplication, empty-findings paths for both modes
- 12 HTML tests: location separator, fix command block, severity group class, critical-
  before-high ordering, copy button, no-fix-command case
- 9 output.test.ts tests: overrideCount param in printActionSummary, printFinalStatus,
  printSuggestedFixCommands; packageManager param in printCompactOutput and printActionSummary
@sonukapoor sonukapoor merged commit 27c384a into main Jun 25, 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.

fix: resolve circular import and improve --check-overrides output UX

1 participant