Skip to content

fix(cli): improve RuleName ordering and update summary snapshots close #8730#8771

Merged
dyc3 merged 3 commits intobiomejs:mainfrom
lghuahua:fix_cli_summary
Jan 24, 2026
Merged

fix(cli): improve RuleName ordering and update summary snapshots close #8730#8771
dyc3 merged 3 commits intobiomejs:mainfrom
lghuahua:fix_cli_summary

Conversation

@lghuahua
Copy link
Contributor

close #8730

The original implementation only compared lengths; RuleNames of the same length were considered to be the same key.

Summary

Updated the Ord implementation for RuleName to use tuple comparison for length and name, ensuring stable ordering. Adjusted test snapshots to reflect the new rule ordering and diagnostic counts in summary reports.

Test Plan

Docs

@changeset-bot
Copy link

changeset-bot bot commented Jan 15, 2026

🦋 Changeset detected

Latest commit: 4087795

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

This PR includes changesets to release 13 packages
Name Type
@biomejs/biome Patch
@biomejs/cli-win32-x64 Patch
@biomejs/cli-win32-arm64 Patch
@biomejs/cli-darwin-x64 Patch
@biomejs/cli-darwin-arm64 Patch
@biomejs/cli-linux-x64 Patch
@biomejs/cli-linux-arm64 Patch
@biomejs/cli-linux-x64-musl Patch
@biomejs/cli-linux-arm64-musl Patch
@biomejs/wasm-web Patch
@biomejs/wasm-bundler Patch
@biomejs/wasm-nodejs Patch
@biomejs/backend-jsonrpc 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

@github-actions github-actions bot added the A-CLI Area: CLI label Jan 15, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 15, 2026

Walkthrough

The change tightens ordering for RuleName used by the summary reporter: instead of comparing only the inner string length, comparisons now use the tuple (length, string), so when lengths match the full rule name is used as a tie-breaker. This produces deterministic lexicographic ordering for equally long rule names and prevents different rules with identical lengths from being merged in the summary output.

Suggested reviewers

  • ematipico
  • siketyan
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: fixing RuleName ordering to resolve summary reporter issues and updating affected test snapshots.
Description check ✅ Passed The description explains the root cause (length-only comparison) and the solution (tuple comparison), directly addressing the linked issue #8730.
Linked Issues check ✅ Passed The PR fully addresses issue #8730 by fixing the Ord implementation for RuleName to use stable tuple comparison, ensuring distinct rules aren't merged based on string length.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the RuleName ordering bug: one line changed in the comparison logic and one changeset file documenting the fix.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.



📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 26115f2 and 4087795.

📒 Files selected for processing (1)
  • .changeset/thirty-paths-argue.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • .changeset/thirty-paths-argue.md

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@lghuahua lghuahua changed the title fix(cli): Improve RuleName ordering and update summary snapshots close #8730 fix(cli): improve RuleName ordering and update summary snapshots close #8730 Jan 15, 2026
Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

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

Please add a changeset as per the contribution guide. And fix the PR title

@dyc3 dyc3 merged commit 6f56b6e into biomejs:main Jan 24, 2026
13 checks passed
@github-actions github-actions bot mentioned this pull request Jan 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CLI Area: CLI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 --reporter=summary merging rules and giving incorrect issue counts

3 participants