-
-
Notifications
You must be signed in to change notification settings - Fork 794
fix(biome_analyze): handle suppressed categories properly for range suppressions #8182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: a618040 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 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 |
WalkthroughThis pull request fixes range suppressions to properly handle suppressed categories, addressing issue Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. 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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
crates/biome_cli/tests/cases/suppressions.rs (1)
461-490: Test validates the fix correctly.The test structure is sound and follows existing patterns. The category-only suppression is properly exercised.
Optional suggestion: The test name includes
syntax_rulebut actually tests thelintcategory. Consider renaming tolint_range_suppression_category_onlyfor clarity, or add additional tests for other categories (syntax,action) to ensure comprehensive coverage.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
crates/biome_cli/tests/snapshots/main_cases_suppressions/syntax_rule_range_suppression_category_only.snapis excluded by!**/*.snapand included by**
📒 Files selected for processing (3)
.changeset/rare-bees-hug.md(1 hunks)crates/biome_analyze/src/suppressions.rs(2 hunks)crates/biome_cli/tests/cases/suppressions.rs(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-05T14:43:29.581Z
Learnt from: dyc3
Repo: biomejs/biome PR: 7081
File: packages/@biomejs/biome/configuration_schema.json:7765-7781
Timestamp: 2025-08-05T14:43:29.581Z
Learning: The file `packages/biomejs/biome/configuration_schema.json` is auto-generated and should not be manually edited or reviewed for schema issues; any changes should be made at the code generation source.
Applied to files:
.changeset/rare-bees-hug.md
🧬 Code graph analysis (2)
crates/biome_cli/tests/cases/suppressions.rs (1)
crates/biome_cli/tests/snap_test.rs (1)
assert_cli_snapshot(407-409)
crates/biome_analyze/src/suppressions.rs (1)
crates/biome_js_analyze/src/suppressions.tests.rs (1)
suppression(107-215)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Check Dependencies
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: Documentation
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: End-to-end tests
- GitHub Check: Test Node.js API
- GitHub Check: autofix
🔇 Additional comments (3)
.changeset/rare-bees-hug.md (1)
1-13: LGTM!The changeset clearly documents the fix with a helpful example. Good work addressing issue #7877.
crates/biome_analyze/src/suppressions.rs (2)
278-304: Range end matching logic is correct.The backward search properly handles category-only range ends by matching against
suppressed_categories. The use of.rev()and theis_endedfilter ensures nested suppressions work correctly (LIFO behavior).
339-345: Correct implementation of category-wide suppression matching.The logic now properly checks both
suppressed_categories(for category-wide suppressions likelint) andfilters_by_category(for specific rule suppressions). This is precisely the fix needed for issue #7877 whilst maintaining backward compatibility.
ematipico
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Summary
This PR fixes an issue where
biome_analyzedid not correctly handle range suppressions specified using only a category (such aslintinstead oflint/correctness/noUnusedVariables).Closes #7877.
Test Plan
A test case was added to:
crates/biome_cli/tests/cases/suppressions.rsDocs