fix(reporters): always print the issue-type title for a single group#1848
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR makes the symbols (default) and compact reporters consistently print the issue-type heading (with count) even when only a single issue type is being reported, addressing #1793 and keeping output shape stable for --include / --strict runs.
Changes:
- Remove the
reportMultipleGroupsgating so issue-type headings are printed for single-group runs insymbolsandcompactreporters. - Tighten/extend CLI reporter tests to assert the presence of the heading + count for single-group output.
- Update an existing
symbols --directorytest expectation to include the heading + count.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/knip/src/reporters/symbols.ts | Always prints the issue-type heading/count for reported groups (including single-group runs). |
| packages/knip/src/reporters/compact.ts | Always prints the issue-type heading/count for reported groups (including single-group runs). |
| packages/knip/test/cli/cli-reporter-symbols-single-group.test.ts | Adds coverage for symbols reporter single included issue-type output including heading/count. |
| packages/knip/test/cli/cli-reporter-symbols-directory.test.ts | Updates expected output to include heading/count for single-group files report. |
| packages/knip/test/cli/cli-reporter-compact.test.ts | Strengthens expectations to assert heading/count for compact reporter output (including single-group include). |
commit: |
Member
|
Thank you! 👍 |
Member
|
🚀 This pull request is included in v6.24.0. See Release 6.24.0 for release notes. Using Knip in a commercial project? Please consider becoming a sponsor. |
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.
The default and compact reporters gate the issue-type heading behind
reportMultipleGroups, so a single issue type prints without its title or count. This drops that gate in both reporters so the group title and count always show. Other reporters are unchanged.Fixes #1793