Skip to content

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

Merged
Karnaukhov-kh merged 1 commit intopush-based:mainfrom
AbdulRehaman08:feature/group-violations-single-component-support
Mar 26, 2026
Merged

feat: support single-component report format in group-violations#27
Karnaukhov-kh merged 1 commit intopush-based:mainfrom
AbdulRehaman08:feature/group-violations-single-component-support

Conversation

@AbdulRehaman08
Copy link
Copy Markdown

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
@Karnaukhov-kh Karnaukhov-kh merged commit 5d61a02 into push-based:main Mar 26, 2026
1 check 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.

2 participants