Skip to content

fix(cli): lint with multiple api files results in invalid output#2744

Open
harshit078 wants to merge 9 commits intoRedocly:mainfrom
harshit078:fix-lint-multiple-files
Open

fix(cli): lint with multiple api files results in invalid output#2744
harshit078 wants to merge 9 commits intoRedocly:mainfrom
harshit078:fix-lint-multiple-files

Conversation

@harshit078
Copy link
Copy Markdown
Contributor

@harshit078 harshit078 commented Apr 15, 2026

What/Why/How?

  • Added logic to gather all lint results into allResults during per-file loop, then call formatProblems() once after with the combined totals.

Reference

#2692

Testing

Screenshots (optional)

Check yourself

  • This PR follows the contributing guide
  • All new/updated code is covered by tests
  • Core code changed? - Tested with other Redocly products (internal contributions only)
  • New package installed? - Tested in different environments (browser/node)
  • Documentation update has been considered

Security

  • The security impact of the change has been considered
  • Code follows company security practices and guidelines

Note

Medium Risk
Changes lint output aggregation and finalization behavior, which may affect CI integrations consuming json/checkstyle/markdown output, especially on partial failures. Logic is localized and covered by new unit tests, reducing regression risk.

Overview
Fixes redocly lint when multiple API files are provided by accumulating all problems and totals across files and emitting a single formatProblems() result for non-ignore runs, ensuring structured formats like json/checkstyle produce a valid combined document (and still output partial results if a later file fails).

Updates markdown formatting to report per-file error/warning counts instead of global totals, adds unit tests for multi-API aggregation and failure cases, and refreshes the v1/v2 docs plus a patch changeset to reflect the new multi-API structured output behavior.

Reviewed by Cursor Bugbot for commit 545b1a0. Bugbot is set up for automated code reviews on this repo. Configure here.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 15, 2026

🦋 Changeset detected

Latest commit: 545b1a0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@redocly/cli Patch
@redocly/openapi-core Patch
@redocly/respect-core Patch

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

@harshit078 harshit078 changed the title fix(cli): lint with multiple api files results in invalid checkstyle/json output fix(cli): lint with multiple api files results in invalid output Apr 15, 2026
@harshit078 harshit078 marked this pull request as ready for review April 15, 2026 12:24
@harshit078 harshit078 requested review from a team as code owners April 15, 2026 12:24
Comment thread packages/cli/src/commands/lint.ts
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1799891. Configure here.

Comment thread packages/cli/src/commands/lint.ts
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