Skip to content

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

Open
harshit078 wants to merge 10 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 10 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 behavior by aggregating problems across multiple API entrypoints into a single report and adjusts markdown per-file totals, which could affect downstream tooling that parses these formats.

Overview
Fixes invalid structured output when linting multiple APIs by accumulating all problems/totals across the per-API loop and calling formatProblems once with a combined result set (including emitting partial results even if a later API errors).

Updates markdown formatting to show per-file error/warning counts instead of global totals, and adds/updates tests plus docs/changeset to reflect the new multi-API structured output behavior.

Reviewed by Cursor Bugbot for commit a893ee5. 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: a893ee5

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