fix: resolve circular import and improve --check-overrides output UX#758
Merged
Conversation
… 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.tsandformatters.tshad a circular dependency throughformatSeverityLabel. Both now import it fromsrc/utils/severity.tsinstead.Terminal output:
ruleIdHTML report:
severity-groupand the severity class so border-color CSS appliesfile › jsonPathwhen a JSON path is presentTests: 33 new tests across the terminal renderer, HTML renderer, and core printer functions.
Closes #757