Skip to content

feat: support single-component report format in group-violations#27

Open
AbdulRehaman08 wants to merge 1 commit intopush-based:mainfrom
AbdulRehaman08:feature/group-violations-single-component-support
Open

feat: support single-component report format in group-violations#27
AbdulRehaman08 wants to merge 1 commit intopush-based:mainfrom
AbdulRehaman08:feature/group-violations-single-component-support

Conversation

@AbdulRehaman08
Copy link

feat: Support single-component report format in group-violations

group-violations previously only accepted the output formats from report-all-violations ({ files: [...] } or { components: [...] }). Feeding the output from report-violations ({ component: "...", violations: [...] }) would throw an "Invalid violations report format" error.

Changes:

  • detectReportFormat now recognizes the single-component shape ({ component, violations })
  • Added convertSingleComponentToComponentFormat converter that wraps the single-component report into the multi-component format, reusing the existing convertComponentToFileFormat pipeline
  • The component name is used as the replacement field to stay consistent with report-all-violations output
  • Updated error message to list all three accepted formats

Files changed:

  • format-converter.utils.ts — New format detection + converter function
  • utils/index.ts — Export new converter
  • group-violations.tool.ts — Handle single-component format in the conversion chain

Backward compatible — existing formats continue to work as before.

@AbdulRehaman08 AbdulRehaman08 marked this pull request as ready for review March 25, 2026 08:51
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.

1 participant