-
-
Notifications
You must be signed in to change notification settings - Fork 695
fix(analyzer): remove unhelpful diagnostic #7295
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: 35410ee 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 PR removes per-run rule category gating and the related “suppressions/unused” diagnostic. It deletes Assessment against linked issues
Out-of-scope changes(No out-of-scope functional changes detected.) Suggested labels
Suggested reviewers
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
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: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
crates/biome_analyze/src/registry.rs (1)
238-244
: Fix lingeringcategories
destructure inbiome_js_transform
The
biome_js_transform
crate still unwraps five items fromregistry.build()
, but the newBuilderResult
only returns four. Update the destructure and dropcategories
:• File
crates/biome_js_transform/src/lib.rs
, around line 48- let (registry, mut services, diagnostics, visitors, categories) = registry.build(); + let (registry, mut services, diagnostics, visitors) = registry.build();Then remove any subsequent uses of
categories
in that function. Once that’s done, all callers should align with the new 4-tuple signature.
♻️ Duplicate comments (2)
crates/biome_js_analyze/src/lib.rs (1)
123-123
: Updated destructure to four values — matches new registry::build().All good; services remain mutable for subsequent inserts.
See the verification script in crates/biome_analyze/src/registry.rs for repo-wide checks.
crates/biome_json_analyze/src/lib.rs (1)
95-95
: Switched to four‑tuple from build(); consistent with the refactor.Keeps services mutable for file_source insertion; spot on.
See the verification script in crates/biome_analyze/src/registry.rs for repo-wide checks.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (8)
.changeset/seven-glasses-attack.md
(1 hunks)crates/biome_analyze/src/lib.rs
(0 hunks)crates/biome_analyze/src/registry.rs
(1 hunks)crates/biome_css_analyze/src/lib.rs
(1 hunks)crates/biome_graphql_analyze/src/lib.rs
(1 hunks)crates/biome_js_analyze/src/lib.rs
(1 hunks)crates/biome_json_analyze/src/lib.rs
(1 hunks)crates/biome_migrate/src/lib.rs
(1 hunks)
💤 Files with no reviewable changes (1)
- crates/biome_analyze/src/lib.rs
🧰 Additional context used
📓 Path-based instructions (4)
.changeset/*.md
📄 CodeRabbit inference engine (CONTRIBUTING.md)
.changeset/*.md
: Create changesets withjust new-changeset
; store them in.changeset/
with correct frontmatter (package keys and change type).
In changeset descriptions, follow content conventions: user-facing changes only; past tense for what you did; present tense for current behavior; link issues for fixes; link rules/assists; include representative code blocks; end every sentence with a period.
When adding headers in a changeset, only use #### or ##### levels.
Files:
.changeset/seven-glasses-attack.md
**/*.{rs,toml}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Format Rust and TOML files before committing (use
just f
/just format
).
Files:
crates/biome_js_analyze/src/lib.rs
crates/biome_migrate/src/lib.rs
crates/biome_css_analyze/src/lib.rs
crates/biome_json_analyze/src/lib.rs
crates/biome_analyze/src/registry.rs
crates/biome_graphql_analyze/src/lib.rs
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**
📄 CodeRabbit inference engine (CLAUDE.md)
Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}
Files:
crates/biome_js_analyze/src/lib.rs
crates/biome_css_analyze/src/lib.rs
crates/biome_json_analyze/src/lib.rs
crates/biome_graphql_analyze/src/lib.rs
crates/biome_*/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place core crates under /crates/biome_*/
Files:
crates/biome_js_analyze/src/lib.rs
crates/biome_migrate/src/lib.rs
crates/biome_css_analyze/src/lib.rs
crates/biome_json_analyze/src/lib.rs
crates/biome_analyze/src/registry.rs
crates/biome_graphql_analyze/src/lib.rs
🧠 Learnings (5)
📓 Common learnings
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-17T08:56:30.831Z
Learning: Applies to crates/biome_analyze/crates/**/lib/src/**/nursery/**/*.rs : Use the local `rule_category!()` macro in diagnostics for the rule’s category, not string-parsed categories
📚 Learning: 2025-08-17T08:56:30.831Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-17T08:56:30.831Z
Learning: Applies to crates/biome_analyze/crates/**/lib/src/**/nursery/**/*.rs : Use the local `rule_category!()` macro in diagnostics for the rule’s category, not string-parsed categories
Applied to files:
crates/biome_js_analyze/src/lib.rs
crates/biome_migrate/src/lib.rs
crates/biome_css_analyze/src/lib.rs
crates/biome_json_analyze/src/lib.rs
crates/biome_analyze/src/registry.rs
crates/biome_graphql_analyze/src/lib.rs
📚 Learning: 2025-08-11T11:46:05.836Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:46:05.836Z
Learning: Applies to crates/biome_diagnostics/crates/biome_diagnostics_categories/src/categories.rs : When declaring a new diagnostic category, register it in crates/biome_diagnostics_categories/src/categories.rs
Applied to files:
crates/biome_js_analyze/src/lib.rs
crates/biome_migrate/src/lib.rs
crates/biome_css_analyze/src/lib.rs
crates/biome_json_analyze/src/lib.rs
📚 Learning: 2025-08-11T11:46:05.836Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:46:05.836Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Specify category and severity using #[diagnostic(...)] on the type or derive them from fields
Applied to files:
crates/biome_js_analyze/src/lib.rs
crates/biome_css_analyze/src/lib.rs
crates/biome_json_analyze/src/lib.rs
📚 Learning: 2025-08-17T08:56:30.831Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-17T08:56:30.831Z
Learning: Applies to crates/biome_analyze/crates/biome_rule_options/lib/**/*.rs : Define per-rule options in the `biome_rule_options` crate under `lib/`, with serde- and schemars-compatible derives and `#[serde(rename_all = "camelCase", deny_unknown_fields, default)]`
Applied to files:
crates/biome_css_analyze/src/lib.rs
crates/biome_json_analyze/src/lib.rs
crates/biome_analyze/src/registry.rs
crates/biome_graphql_analyze/src/lib.rs
🧬 Code graph analysis (1)
crates/biome_migrate/src/lib.rs (2)
crates/biome_service/src/workspace/server.rs (1)
diagnostics
(1216-1219)crates/biome_migrate/src/analyzers.rs (10)
registry
(34-34)registry
(36-36)registry
(37-37)registry
(38-38)registry
(39-39)registry
(40-40)registry
(41-41)registry
(42-42)registry
(43-43)registry
(52-52)
🪛 LanguageTool
.changeset/seven-glasses-attack.md
[locale-violation] ~5-~5: In British English, the spelling ‘anymore’ is sometimes considered incorrect. Did you mean “any more”?
Context: ...ome won't emit the following diagnostic anymore: ``` lib/main.ts:1:5 suppressions/unus...
(ANYMORE)
⏰ 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). (4)
- GitHub Check: Test Node.js API
- GitHub Check: Check Dependencies
- GitHub Check: Documentation
- GitHub Check: autofix
🔇 Additional comments (5)
crates/biome_css_analyze/src/lib.rs (1)
99-99
: Destructure to new build() shape — looks good.Updated to the four‑tuple from RuleRegistry::build(); matches the new API.
crates/biome_analyze/src/registry.rs (2)
2-3
: Imports pruned to remove RuleCategories.Nice tidy-up; aligns with dropping categories from the registry surface.
246-253
: build() implementation updated accordingly — no functional surprises.Tuple now omits categories; visitors/services/diagnostics are preserved as-is.
crates/biome_migrate/src/lib.rs (1)
54-54
: Leftover 5-tuple destructure in biome_js_transformIt looks like the migrator in
crates/biome_js_transform/src/lib.rs
still uses the old five-element API at line 48. You’ll need to drop thecategories
binding there (and any downstream uses of it) to match the new four-tuple signature:- let (registry, mut services, diagnostics, visitors, categories) = registry.build(); + let (registry, mut services, diagnostics, visitors) = registry.build();• File: crates/biome_js_transform/src/lib.rs
• Line: 48Please update this destructuring (and remove any now-unused
categories
references) so the build doesn’t break.⛔ Skipped due to learnings
Learnt from: CR PR: biomejs/biome#0 File: crates/biome_analyze/CONTRIBUTING.md:0-0 Timestamp: 2025-08-17T08:56:30.831Z Learning: Applies to crates/biome_analyze/crates/**/lib/src/**/nursery/**/*.rs : Use the local `rule_category!()` macro in diagnostics for the rule’s category, not string-parsed categories
Learnt from: CR PR: biomejs/biome#0 File: crates/biome_diagnostics/CONTRIBUTING.md:0-0 Timestamp: 2025-08-11T11:46:05.836Z Learning: Applies to crates/biome_diagnostics/crates/biome_diagnostics_categories/src/categories.rs : When declaring a new diagnostic category, register it in crates/biome_diagnostics_categories/src/categories.rs
Learnt from: CR PR: biomejs/biome#0 File: crates/biome_diagnostics/CONTRIBUTING.md:0-0 Timestamp: 2025-08-11T11:46:05.836Z Learning: Applies to crates/biome_diagnostics/**/*.rs : Use helper advice types from biome_diagnostics::v2 (CodeFrameAdvice, CommandAdvice, DiffAdvice, LogAdvice) when suitable
crates/biome_graphql_analyze/src/lib.rs (1)
92-92
: Please update the remaining 5-tuple destructure and clean up old suppression messagesIt looks like
registry.build()
now returns a 4-tuple, but one call site is still unpacking five values, and there are a few leftover suppression-warning strings that should be removed.• crates/biome_js_transform/src/lib.rs:48
Current:let (registry, mut services, diagnostics, visitors, categories) = registry.build();→ Update to four bindings (e.g. drop
categories
) to match the new API.• crates/biome_analyze/src/lib.rs
Lines 253–255, 275–277 and 284–285 contain old messages like"Suppression comment has no effect because another suppression comment suppresses the same rule."
and
"Suppression comment has no effect. Remove the suppression or make sure you are suppressing the correct rule."
→ Remove or update these dead-code paths now that suppressions are handled upstream.
Happy to whip up a small regression test to catch both of these if you’d like.
⛔ Skipped due to learnings
Learnt from: CR PR: biomejs/biome#0 File: crates/biome_analyze/CONTRIBUTING.md:0-0 Timestamp: 2025-08-17T08:56:30.831Z Learning: Applies to crates/biome_analyze/crates/biome_js_analyze/tests/quick_test.rs : Use `biome_js_analyze/tests/quick_test.rs` for quick, ad-hoc testing; un-ignore the test and adjust the rule filter as needed
Also, the suggested wording from coderabbit for the changeset is good, we should use that. |
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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
crates/biome_analyze/src/matcher.rs (1)
463-466
: Remove all lingeringsuppressions/unused
referencesThe
suppressions/unused
diagnostic is gone, but it’s still expected in a bunch of places. Please remove or update every reference:
- Delete the tuple in
crates/biome_analyze/src/matcher.rs:463–466
- Remove the
category!("suppressions/unused")
in
crates/biome_analyze/src/lib.rs
at lines 251, 273 & 282- Drop the check in
crates/biome_service/src/file_handlers/mod.rs:523
- Update expectations in
crates/biome_js_analyze/src/suppressions.tests.rs
(around lines 245, 483, 867 & 912)- Regenerate or scrub snapshots under
crates/biome_js_analyze/tests/multiple_rules/*.snap
- Fix the CSS-analyzer test in
crates/biome_css_analyze/src/lib.rs:351–353
- Update the CLI snapshots in
crates/biome_cli/tests/snapshots/main_cases_suppressions/*.snap
- Finally, do a repo-wide search (
rg -n 'suppressions/unused'
) to catch any stragglers and rerun the test suite.crates/biome_js_transform/src/lib.rs (1)
132-141
: Fix test imports:AnalysisFilter
andControlFlow
should come from biome_analyze, not this crateAs written,
use crate::{AnalysisFilter, ControlFlow, transform};
won’t resolve because these types aren’t re-exported by this crate. Tests compile even when ignored, so this will bite CI.Apply this diff:
- use biome_analyze::{AnalyzerOptions, Never, RuleCategoriesBuilder, RuleFilter}; + use biome_analyze::{AnalyzerOptions, Never, RuleCategoriesBuilder, RuleFilter, AnalysisFilter, ControlFlow}; @@ - use crate::{AnalysisFilter, ControlFlow, transform}; + use crate::transform;
🧹 Nitpick comments (4)
crates/biome_analyze/src/matcher.rs (1)
445-447
: Tweak the inline comment for clarityNow that the unused-suppression diagnostic is gone, the comment can explicitly state which suppression diagnostics are expected first.
- // Suppression errors first since we check suppressions before syntax rules + // Suppression errors come first (unknownGroup/unknownRule) before syntax rulescrates/biome_js_transform/src/lib.rs (2)
26-32
: Docs nit: say “transformation registry”, not “lint rules registry”Minor wording tweak so the comment matches this crate’s purpose.
Apply this diff:
-/// processed by the lint rules registry +/// processed by the transformation registry
72-87
: Unreachable panic messages are empty; make them actionableHelpful messages aid debugging if invariants are ever broken.
Apply this diff:
- unreachable!("") + unreachable!("apply_top_level_suppression should never be called in the transform pipeline") @@ - unreachable!("") + unreachable!("apply_inline_suppression should never be called in the transform pipeline") @@ - fn suppression_top_level_comment(&self, _suppression_text: &str) -> String { - unreachable!("") + fn suppression_top_level_comment(&self, _suppression_text: &str) -> String { + unreachable!("Transform pipeline does not support suppression comments")crates/biome_analyze/src/syntax.rs (1)
103-104
: Use the root re-export for Phases for consistency.Elsewhere in this file we import
Phases
from the crate root; the test pulls it fromregistry
. Favour the root re-export to avoid path churn.- matcher::MatchQueryParams, registry::Phases, + matcher::MatchQueryParams, Phases,
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (4)
.changeset/seven-glasses-attack.md
(1 hunks)crates/biome_analyze/src/matcher.rs
(1 hunks)crates/biome_analyze/src/syntax.rs
(1 hunks)crates/biome_js_transform/src/lib.rs
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- .changeset/seven-glasses-attack.md
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{rs,toml}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Format Rust and TOML files before committing (use
just f
/just format
).
Files:
crates/biome_analyze/src/syntax.rs
crates/biome_js_transform/src/lib.rs
crates/biome_analyze/src/matcher.rs
crates/biome_*/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place core crates under /crates/biome_*/
Files:
crates/biome_analyze/src/syntax.rs
crates/biome_js_transform/src/lib.rs
crates/biome_analyze/src/matcher.rs
🧠 Learnings (6)
📓 Common learnings
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-17T08:56:30.831Z
Learning: Applies to crates/biome_analyze/crates/**/lib/src/**/nursery/**/*.rs : Use the local `rule_category!()` macro in diagnostics for the rule’s category, not string-parsed categories
📚 Learning: 2025-08-17T08:56:30.831Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-17T08:56:30.831Z
Learning: Applies to crates/biome_analyze/crates/**/lib/src/**/nursery/**/*.rs : Use the local `rule_category!()` macro in diagnostics for the rule’s category, not string-parsed categories
Applied to files:
crates/biome_analyze/src/syntax.rs
crates/biome_js_transform/src/lib.rs
crates/biome_analyze/src/matcher.rs
📚 Learning: 2025-08-17T08:56:30.831Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-17T08:56:30.831Z
Learning: Applies to crates/biome_analyze/crates/biome_js_analyze/tests/quick_test.rs : Use `biome_js_analyze/tests/quick_test.rs` for quick, ad-hoc testing; un-ignore the test and adjust the rule filter as needed
Applied to files:
crates/biome_analyze/src/syntax.rs
crates/biome_analyze/src/matcher.rs
📚 Learning: 2025-08-17T08:55:30.118Z
Learnt from: CR
PR: biomejs/biome#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-17T08:55:30.118Z
Learning: Applies to crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/** : Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}
Applied to files:
crates/biome_analyze/src/syntax.rs
📚 Learning: 2025-08-17T08:56:30.831Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-08-17T08:56:30.831Z
Learning: Applies to crates/biome_analyze/crates/biome_rule_options/lib/**/*.rs : Define per-rule options in the `biome_rule_options` crate under `lib/`, with serde- and schemars-compatible derives and `#[serde(rename_all = "camelCase", deny_unknown_fields, default)]`
Applied to files:
crates/biome_analyze/src/syntax.rs
crates/biome_analyze/src/matcher.rs
📚 Learning: 2025-08-11T11:46:05.836Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:46:05.836Z
Learning: Applies to crates/biome_diagnostics/crates/biome_diagnostics_categories/src/categories.rs : When declaring a new diagnostic category, register it in crates/biome_diagnostics_categories/src/categories.rs
Applied to files:
crates/biome_js_transform/src/lib.rs
🧬 Code graph analysis (1)
crates/biome_analyze/src/matcher.rs (1)
crates/biome_analyze/src/context.rs (1)
RuleKey
(42-42)
⏰ 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). (24)
- GitHub Check: Bench (biome_json_parser)
- GitHub Check: autofix
- GitHub Check: Bench (biome_graphql_formatter)
- GitHub Check: Bench (biome_package)
- GitHub Check: Bench (biome_html_formatter)
- GitHub Check: Bench (biome_js_formatter)
- GitHub Check: Bench (biome_configuration)
- GitHub Check: Bench (biome_css_parser)
- GitHub Check: Bench (biome_module_graph)
- GitHub Check: Bench (biome_html_parser)
- GitHub Check: Bench (biome_json_analyze)
- GitHub Check: Bench (biome_css_formatter)
- GitHub Check: Bench (biome_json_formatter)
- GitHub Check: Bench (biome_css_analyze)
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Check Dependencies
- GitHub Check: Bench (biome_graphql_parser)
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Bench (biome_js_parser)
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Documentation
- GitHub Check: Test Node.js API
🔇 Additional comments (6)
crates/biome_analyze/src/matcher.rs (2)
213-215
: Imports updated for RuleCategory and DiagnosticSignal — looks goodSwitch to RuleCategory (singular) and pulling in signals::DiagnosticSignal aligns with the API changes removing RuleCategories. No objections here.
422-428
: Updated Analyzer::new call matches the new signatureConstructor usage without per-run categories is correct and consistent with the broader API simplification.
crates/biome_js_transform/src/lib.rs (2)
48-48
: Build tuple update looks correctDropping the categories binding and destructuring
(registry, services, diagnostics, visitors)
aligns with the new RuleRegistry::build() API and the PR’s goal of removing category gating. No further changes needed here.
154-156
: Sanity-check: do we still need to set categories in tests?Given the removal of per-run category gating elsewhere, verify that specifying
categories: RuleCategoriesBuilder::default().with_transformation().build()
is still required for this path. If the registry now drives phases independently of runtime categories, we can simplify the test filter and drop this field.crates/biome_analyze/src/syntax.rs (2)
103-104
: API refactor alignment looks good.Nice tidy-up on the test imports to match the
Analyzer::new
signature change (no categories arg). Keeps the test lean and focused on syntax walking.
103-104
: Looks like our sandbox can’t reach/proc/self/exe
, so the compile/tests won’t run here. Could you please verify locally that everything still builds and thesyntax_visitor
tests pass?Run locally:
# From the repo root cargo fmt --all cargo check --all-targets cargo test -p biome_analyze -- --exact syntax_visitorOnce green, you’re all set!
CodSpeed Performance ReportMerging #7295 will not alter performanceComparing Summary
|
Summary
closes #7130
Test Plan
N/A
Docs
N/A