fix(cli): lint with multiple api files results in invalid output#2744
fix(cli): lint with multiple api files results in invalid output#2744harshit078 wants to merge 21 commits into
Conversation
🦋 Changeset detectedLatest commit: 889daad The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Daryna-del
left a comment
There was a problem hiding this comment.
Thanks for the contribution! The overall approach looks good, but there are
a couple of things worth addressing before merging. Could you also take a
look at why the build and test job is failing? Left a few comments.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0c7cf32. Configure here.
Daryna-del
left a comment
There was a problem hiding this comment.
Hey @harshit078
Left some comments, could you, please, take a look?
| "@redocly/cli": patch | ||
| --- | ||
|
|
||
| When multiple APIs are linted in a single command, all structured formats (such as `checkstyle` and `json`) produce a single combined document that groups problems per file. |
There was a problem hiding this comment.
We would like to have combined output only for checkstyle format. Could you please adjust it?
| Some formats, such as `checkstyle` or `json`, don't work well when multiple APIs are linted in a single command. | ||
| Try linting each API separately when you pass the command output to another tool. | ||
| {% /admonition %} | ||
| When multiple APIs are linted in a single command, all structured formats (such as `checkstyle` and `json`) produce a single combined document that groups problems per file. |
There was a problem hiding this comment.
Same here, only for checkstyle format. Could you please adjust docs?
| version, | ||
| command: 'lint', | ||
| }); | ||
| allLintRes.push(...results); |
There was a problem hiding this comment.
We would like to have combined output only for checkstyle format. Could you please adjust a solution?
| } | ||
| } | ||
|
|
||
| if (!argv['generate-ignore-file']) { |
There was a problem hiding this comment.
Same here, only for checkstyle format
|
Hey @Daryna-del , I have addressed the comments you left and updated the docs along with it. Can you please review it again ? Thanks ! |
|
Hi @harshit078 ! |
|
Hey @Daryna-del , pushed a fix for the linting issue. Thanks ! |

What/Why/How?
Reference
#2692
Testing
Screenshots (optional)
Check yourself
Security
Note
Medium Risk
Changes
lintoutput behavior for--format=checkstyleby aggregating results across APIs, which may affect downstream CI parsers but is scoped to one output format.Overview
Fixes
redocly lint --format=checkstylewhen multiple APIs are provided by aggregating all lint problems across files and callingformatProblemsonce at the end, producing a single valid Checkstyle XML document instead of concatenated per-file XML.Updates tests to assert single-call aggregation behavior and refreshes docs/changeset to reflect the new combined Checkstyle output semantics.
Reviewed by Cursor Bugbot for commit 889daad. Bugbot is set up for automated code reviews on this repo. Configure here.