-
-
Notifications
You must be signed in to change notification settings - Fork 726
feat(cli): --skip/--only with domains #7392
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: 41b6196 The changes in this PR will be included in the next version bump. This PR includes changesets to release 15 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 |
WalkthroughAdds domain-aware selector support across CLI, configuration, service, LSP, workspace, visitors and codegen. Introduces Assessment against linked issues
Assessment against linked issues: Out-of-scope changes
Suggested labels
Suggested reviewers
✨ 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: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (4)
crates/biome_service/src/configuration.rs (1)
732-739:domains.projectin config forces project scan even when--skip=projectis set.If the config enables the project domain, you set
requires_project_scan = truebefore considering CLI selectors. That negates the main perf goal of “skip project domain rules”.Gate this block with CLI selectors, e.g. only set the flag when:
--skipdoes not include the project domain, and- either
--onlyis empty or it includes the project domain.Happy to draft a follow‑up patch once the
AnalyzerSelectordomain variant shape is confirmed.crates/biome_service/src/file_handlers/mod.rs (3)
1058-1080: Unreachable branch prevents disabling recommended domain rules.Early-return on “no configured domains” makes the subsequent “if recommended and has domains and no configured domains => disable” block dead code. Remove the early return so recommended domain rules can be disabled when no domain is configured.
Apply this diff:
@@ fn record_rule_from_domains<R, L>(&mut self, rule_filter: RuleFilter<'static>) - // no domains, no need to record the rule - if domains.as_ref().is_none_or(|d| d.is_empty()) { - return; - }
1129-1141: Bug: default config never applied whenonlyis None.
has_only_filter = self.only.is_none_or(|only| !only.is_empty())evaluates to true forNone, so config rules are skipped in the common case. Intended meaning is “only present and non-empty”.Apply this diff:
- let has_only_filter = self.only.is_none_or(|only| !only.is_empty()); + let has_only_filter = self.only.is_some_and(|only| !only.is_empty());Please mirror this logic anywhere the same predicate is used.
1366-1376: Sameonlypredicate bug in assists.Replicate the fix for assists so configured assists aren’t dropped when
onlyisNone.Apply this diff:
- let has_only_filter = self.only.is_none_or(|only| !only.is_empty()); + let has_only_filter = self.only.is_some_and(|only| !only.is_empty());
🧹 Nitpick comments (20)
crates/biome_analyze/src/rule.rs (2)
517-529: DRY up: have Display delegate to as_str.Avoid duplicating the string mapping in two places.
You can simplify the Display impl (lines 438–452) to:
impl Display for RuleDomain { fn fmt(&self, fmt: &mut Formatter) -> std::io::Result<()> { fmt.write_str(self.as_str()) } }Also consider a tiny round‑trip test ensuring from_str(x).unwrap().as_str() == x for all domains.
Happy to draft the tests if useful.
531-547: Make parsing case-insensitive and trim input; unify error text.This will reduce CLI foot‑guns (e.g. -->
Apply:
impl FromStr for RuleDomain { type Err = &'static str; fn from_str(s: &str) -> Result<Self, Self::Err> { - match s { + let s = s.trim().to_ascii_lowercase(); + match s.as_str() { "react" => Ok(Self::React), "test" => Ok(Self::Test), "solid" => Ok(Self::Solid), "next" => Ok(Self::Next), "qwik" => Ok(Self::Qwik), "vue" => Ok(Self::Vue), "project" => Ok(Self::Project), "tailwind" => Ok(Self::Tailwind), - - _ => Err("Invalid rule domain"), + _ => Err("This domain doesn't exist."), } } }The error message now matches crates/biome_configuration/src/analyzer/mod.rs for consistency.
.changeset/wet-results-talk.md (1)
5-19: Polish the changeset: punctuation + link the issue.Keeps to the project’s “end sentences with a period” rule and references the issue.
-For example, the following command will only run the rules that belong to the [next](https://biomejs.dev/linter/domains/#next) domain: +For example, run the following command to only run rules in the [next](https://biomejs.dev/linter/domains/#next) domain. ```shell biome lint -->-Another example, the following command will skip the rules that belong to the project domain:
+For example, run the following command to skip rules in the project domain.biome lint --skip=project
+Closes #6880.
</blockquote></details> <details> <summary>crates/biome_cli/tests/cases/linter_domains.rs (1)</summary><blockquote> `359-414`: **Strengthen the “enable via CLI” test by disabling the domain in config** To prove `-- truly enables the domain irrespective of config, set the domain to `"none"` in `biome.json`. That avoids the config already enabling it. Apply this minimal diff to the embedded JSON: ```diff - "domains": { - "test": "all" - } + "domains": { + "test": "none" + }crates/biome_service/src/file_handlers/css.rs (1)
519-526: Rename local var to ‘selectors’ for clarity (avoids confusion with rule lists).The field is still named
enabled_rules, but you’re now passing selectors. Renaming the local binding improves readability.- enabled_rules: rules, + enabled_rules: selectors, ... - .with_enabled_selectors(&rules) + .with_enabled_selectors(&selectors)Also applies to: 578-586, 624-631
crates/biome_service/src/configuration.rs (1)
904-912: Nice coverage, but add a domain‑selector case.Please add a test proving that
--skip=projectavoids project scans even when the project domain is enabled via config.Proposed test to add under this module’s
tests:#[test] fn should_not_scan_project_when_project_domain_is_skipped_via_cli() { let configuration = Configuration { linter: Some(LinterConfiguration { // Simulate config that would otherwise require project analysis domains: { let mut d = FxHashMap::default(); d.insert(RuleDomain::Project, RuleDomainValue::Recommended); Some(RuleDomains(d)) }, ..Default::default() }), ..Default::default() }; // Skip the entire project domain via CLI let scan = ProjectScanComputer::new(&configuration) .with_rule_selectors( // Any Domain(Project) selector here &[ // Replace with the actual constructor once available, e.g.: // AnalyzerSelector::from(DomainSelector::Project) ], &[], ) .compute(); assert_ne!(scan, ScanKind::Project, "skip=project should prevent project scan"); }Once
AnalyzerSelectordomain construction is confirmed, I can wire the exact selector.Also applies to: 933-941
crates/biome_service/src/file_handlers/javascript.rs (1)
765-769: Same naming nit as CSS: prefer ‘selectors’ over ‘rules’.Avoids mixing the old “rules” wording with the new selector API.
- enabled_rules: rules, + enabled_rules: selectors, ... - .with_enabled_selectors(&rules) + .with_enabled_selectors(&selectors)Also applies to: 776-783
crates/biome_service/src/file_handlers/json.rs (2)
576-576: Minor naming mismatch: rules are selectors here.
enabled_rules: rulesis now passed towith_enabled_selectors. Consider renaming the binding toselectorsfor clarity.- enabled_rules: rules, + enabled_rules: selectors, ... - .with_enabled_selectors(&rules) + .with_enabled_selectors(&selectors)
625-625: Consistent terminology in fix-all.Same nit as above:
params.enabled_rulesnow carries selectors. Consider renaming the field or local binding when you touch the API next to avoid cognitive load.crates/biome_service/src/file_handlers/graphql.rs (2)
487-487: Rename the local for readability.
enabled_rules: rules→ used as selectors. Renaming toselectorsimproves intent.- enabled_rules: rules, + enabled_rules: selectors, ... - .with_enabled_selectors(&rules) + .with_enabled_selectors(&selectors)
533-533: Same terminology nit in fix-all.
params.enabled_rulesnow represents selectors; consider harmonising names across handlers when feasible.xtask/codegen/src/generate_configuration.rs (5)
22-25: Great addition: domain → rules index.Nice choice of BTreeMap/BTreeSet for stable, deterministic output. Note: the doc says
(<group>/<rule>, ...)but the type is actually(group, rule); tweak wording for precision when you’re nearby.- /// e.g next => (<group>/<rule>, <group>/<rule>) + /// e.g. next => ((<group>, <rule>), (<group>, <rule>))
43-48: Domain collection is JS-only; intentional?You populate
domainsin the JS visitor only. If non-JS languages ever tag rules with domains, we’ll miss them. Low-effort future-proofing would be to mirror this loop in the JSON/CSS/GraphQL visitors.impl RegistryVisitor<JsonLanguage> for LintRulesVisitor { @@ fn record_rule<R>(&mut self) where R: Rule<Options: Default, Query: Queryable<Language = JsonLanguage, Output: Clone>> + 'static, { self.groups .entry(<R::Group as RuleGroup>::NAME) .or_default() .insert(R::METADATA.name, R::METADATA); + for domain in R::METADATA.domains.iter() { + self.domains + .entry(domain.as_str()) + .or_default() + .insert((<R::Group as RuleGroup>::NAME, R::METADATA.name)); + } } }
1143-1149: Prefer static slices over LazyLock<Vec<...>> for zero-allocation access.The generated contents are compile-time known. You can emit
&'static [RuleFilter]and avoid the runtime LazyLock and later clone.- lazy_locks.push(quote! { - static #domain_filters: LazyLock<Vec<RuleFilter<'static>>> = LazyLock::new(|| { - vec![ - #( #vector ),* - ] - }); - }); + lazy_locks.push(quote! { + static #domain_filters: &[RuleFilter<'static>] = &[ + #( #vector ),* + ]; + });And then adjust call sites accordingly:
- #domain_as_string => #domain_filters.clone() + #domain_as_string => #domain_filters.to_vec()
1160-1176: Nit: error message mentions DomainFilter.The type here is
DomainSelector. Minor copy edit.- _ => unreachable!( - "DomainFilter::as_rule_filters: domain {} not found", + _ => unreachable!( + "DomainSelector::as_rule_filters: domain {} not found", self.0 )
1178-1187: Consistency: unknown domain branch.Here it returns
false, above it panics. Consider aligning behaviours (bothunreachable!or both graceful), depending on howDomainSelectoris constructed. If it’s validated on construction,unreachable!is fine.- _ => false, + _ => unreachable!("DomainSelector::match_rule: domain {} not found", self.0),crates/biome_service/src/workspace.rs (2)
921-927: Prefer “selectors” terminology (rules or domains) in docs and names.Fields now accept domains, but still read “enabled_rules”. Consider renaming to
enabled_selectorsin the public API on the next breaking bump; at minimum, update the docstrings now to avoid confusion.Apply docstring tweak:
--- a/crates/biome_service/src/workspace.rs +++ b/crates/biome_service/src/workspace.rs @@ - /// Rules to apply on top of the configuration + /// Selectors (rules or domains) to apply on top of the configuration @@ - /// Rules to apply to the file + /// Selectors (rules or domains) to apply to the fileAlso applies to: 949-956, 1022-1028
1637-1651: Exposeenabled_selectorsin FileGuard::pull_diagnostics.You added
enabled_rulestoPullDiagnosticsParamsbut the FileGuard wrapper drops it. Mirrorpull_actionsand thread it through.Apply this diff:
@@ pub fn pull_diagnostics( - pub fn pull_diagnostics( + pub fn pull_diagnostics( &self, categories: RuleCategories, only: Vec<AnalyzerSelector>, skip: Vec<AnalyzerSelector>, + enabled_rules: Vec<AnalyzerSelector>, pull_code_actions: bool, ) -> Result<PullDiagnosticsResult, WorkspaceError> { self.workspace.pull_diagnostics(PullDiagnosticsParams { project_key: self.project_key, path: self.path.clone(), categories, only, skip, - enabled_rules: vec![], + enabled_rules, pull_code_actions, }) }crates/biome_service/src/file_handlers/mod.rs (1)
1465-1486: Nit: parameter name mismatch.
with_enabled_selectorstakesenabled_rules. Rename the argument for clarity.Apply:
- pub(crate) fn with_enabled_selectors(mut self, enabled_rules: &'b [AnalyzerSelector]) -> Self { - self.enabled_selectors = Some(enabled_rules); + pub(crate) fn with_enabled_selectors(mut self, enabled_selectors: &'b [AnalyzerSelector]) -> Self { + self.enabled_selectors = Some(enabled_selectors); self }crates/biome_configuration/src/analyzer/mod.rs (1)
699-748: DomainSelector serde is fine; tiny micro-optimisation available.You can avoid
format!in serialisation.Apply:
- serializer.serialize_str(&format!("{self}")) + serializer.serialize_str(self.0)
📜 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 ignored due to path filters (6)
crates/biome_cli/tests/snapshots/main_cases_linter_domains/should_disable_domain_via_cli.snapis excluded by!**/*.snapand included by**crates/biome_cli/tests/snapshots/main_cases_linter_domains/should_enable_domain_via_cli.snapis excluded by!**/*.snapand included by**crates/biome_cli/tests/snapshots/main_commands_lint/lint_help.snapis excluded by!**/*.snapand included by**crates/biome_cli/tests/snapshots/main_commands_lint/lint_only_rule_doesnt_exist.snapis excluded by!**/*.snapand included by**crates/biome_configuration/src/generated/domain_selector.rsis excluded by!**/generated/**,!**/generated/**and included by**packages/@biomejs/backend-jsonrpc/src/workspace.tsis excluded by!**/backend-jsonrpc/src/workspace.tsand included by**
📒 Files selected for processing (21)
.changeset/wet-results-talk.md(1 hunks)crates/biome_analyze/src/rule.rs(2 hunks)crates/biome_cli/src/commands/lint.rs(2 hunks)crates/biome_cli/src/commands/mod.rs(2 hunks)crates/biome_cli/src/commands/scan_kind.rs(1 hunks)crates/biome_cli/src/execute/mod.rs(2 hunks)crates/biome_cli/tests/cases/linter_domains.rs(1 hunks)crates/biome_configuration/src/analyzer/mod.rs(5 hunks)crates/biome_configuration/src/generated.rs(1 hunks)crates/biome_lsp/src/handlers/analysis.rs(2 hunks)crates/biome_lsp/src/server.tests.rs(7 hunks)crates/biome_service/src/configuration.rs(6 hunks)crates/biome_service/src/file_handlers/css.rs(3 hunks)crates/biome_service/src/file_handlers/graphql.rs(3 hunks)crates/biome_service/src/file_handlers/javascript.rs(3 hunks)crates/biome_service/src/file_handlers/json.rs(3 hunks)crates/biome_service/src/file_handlers/mod.rs(13 hunks)crates/biome_service/src/workspace.rs(7 hunks)crates/biome_service/src/workspace.tests.rs(1 hunks)crates/biome_service/src/workspace/server.rs(1 hunks)xtask/codegen/src/generate_configuration.rs(4 hunks)
🧰 Additional context used
📓 Path-based instructions (8)
**/*.{rs,toml}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Format Rust and TOML files before committing (use
just f/just format).
Files:
crates/biome_cli/src/commands/lint.rscrates/biome_cli/src/commands/scan_kind.rscrates/biome_configuration/src/generated.rscrates/biome_analyze/src/rule.rscrates/biome_lsp/src/server.tests.rscrates/biome_cli/src/execute/mod.rscrates/biome_service/src/file_handlers/css.rscrates/biome_service/src/workspace.rsxtask/codegen/src/generate_configuration.rscrates/biome_service/src/workspace.tests.rscrates/biome_cli/tests/cases/linter_domains.rscrates/biome_service/src/file_handlers/javascript.rscrates/biome_service/src/file_handlers/graphql.rscrates/biome_service/src/configuration.rscrates/biome_service/src/file_handlers/json.rscrates/biome_cli/src/commands/mod.rscrates/biome_service/src/workspace/server.rscrates/biome_lsp/src/handlers/analysis.rscrates/biome_configuration/src/analyzer/mod.rscrates/biome_service/src/file_handlers/mod.rs
crates/biome_*/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place core crates under /crates/biome_*/
Files:
crates/biome_cli/src/commands/lint.rscrates/biome_cli/src/commands/scan_kind.rscrates/biome_configuration/src/generated.rscrates/biome_analyze/src/rule.rscrates/biome_lsp/src/server.tests.rscrates/biome_cli/src/execute/mod.rscrates/biome_service/src/file_handlers/css.rscrates/biome_service/src/workspace.rscrates/biome_service/src/workspace.tests.rscrates/biome_cli/tests/cases/linter_domains.rscrates/biome_service/src/file_handlers/javascript.rscrates/biome_service/src/file_handlers/graphql.rscrates/biome_service/src/configuration.rscrates/biome_service/src/file_handlers/json.rscrates/biome_cli/src/commands/mod.rscrates/biome_service/src/workspace/server.rscrates/biome_lsp/src/handlers/analysis.rscrates/biome_configuration/src/analyzer/mod.rscrates/biome_service/src/file_handlers/mod.rs
crates/biome_configuration/src/**
📄 CodeRabbit inference engine (CLAUDE.md)
Keep configuration sources under biome_configuration/src/
Files:
crates/biome_configuration/src/generated.rscrates/biome_configuration/src/analyzer/mod.rs
crates/biome_service/../biome_lsp/src/server.tests.rs
📄 CodeRabbit inference engine (crates/biome_service/CONTRIBUTING.md)
Keep end-to-end LSP tests in biome_lsp’s server.tests.rs
Files:
crates/biome_lsp/src/server.tests.rs
crates/biome_service/src/workspace.rs
📄 CodeRabbit inference engine (crates/biome_service/CONTRIBUTING.md)
Implement the Workspace trait in src/workspace.rs
Files:
crates/biome_service/src/workspace.rs
**/tests/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place test files under a tests/ directory in each crate
Files:
crates/biome_cli/tests/cases/linter_domains.rs
crates/biome_service/src/workspace/server.rs
📄 CodeRabbit inference engine (crates/biome_service/CONTRIBUTING.md)
Use WorkspaceServer (src/workspace/server.rs) to maintain workspace state in daemon and CLI daemonless modes
Files:
crates/biome_service/src/workspace/server.rs
.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/wet-results-talk.md
🧠 Learnings (17)
📓 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 `domains` in `declare_lint_rule!` when applicable; recommended rules with domains enable only when the domain is active
📚 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 : When porting from other linters, declare `sources: &[RuleSource::<...>]` in `declare_lint_rule!` using `.same()` or `.inspired()` as appropriate
Applied to files:
crates/biome_cli/src/commands/lint.rscrates/biome_cli/src/commands/scan_kind.rscrates/biome_service/src/workspace.tests.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/lib/src/lint/nursery/*.rs : For new JavaScript lint rules generated by `just new-js-lintrule`, implement the rule in the generated file under `biome_js_analyze/lib/src/lint/nursery/`
Applied to files:
crates/biome_cli/src/commands/lint.rscrates/biome_cli/src/execute/mod.rsxtask/codegen/src/generate_configuration.rscrates/biome_service/src/file_handlers/javascript.rscrates/biome_cli/src/commands/mod.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/**/lib/src/**/nursery/**/*.rs : Use `domains` in `declare_lint_rule!` when applicable; recommended rules with domains enable only when the domain is active
Applied to files:
crates/biome_cli/src/commands/lint.rscrates/biome_cli/src/commands/scan_kind.rscrates/biome_configuration/src/generated.rscrates/biome_analyze/src/rule.rscrates/biome_lsp/src/server.tests.rsxtask/codegen/src/generate_configuration.rscrates/biome_service/src/workspace.tests.rscrates/biome_cli/tests/cases/linter_domains.rscrates/biome_service/src/file_handlers/javascript.rscrates/biome_service/src/configuration.rscrates/biome_cli/src/commands/mod.rscrates/biome_service/src/workspace/server.rscrates/biome_configuration/src/analyzer/mod.rscrates/biome_service/src/file_handlers/mod.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/**/lib/src/**/nursery/**/*.rs : If a rule is deprecated, set the `deprecated:` field in `declare_lint_rule!` with a reason and alternative
Applied to files:
crates/biome_cli/src/commands/lint.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/**/lib/src/**/nursery/**/*.rs : In `declare_lint_rule!` declarations, set `version: "next"`
Applied to files:
crates/biome_cli/src/commands/lint.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/**/lib/src/**/nursery/**/*.rs : Choose an appropriate `severity` in `declare_lint_rule!` (default is info); use `Severity::Error` for hard errors, `Warning` for potential issues, `Information` for style
Applied to files:
crates/biome_cli/src/commands/lint.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_cli/src/commands/lint.rscrates/biome_cli/src/commands/scan_kind.rscrates/biome_analyze/src/rule.rscrates/biome_lsp/src/server.tests.rscrates/biome_cli/src/execute/mod.rscrates/biome_service/src/workspace.rscrates/biome_service/src/file_handlers/javascript.rscrates/biome_service/src/configuration.rscrates/biome_service/src/file_handlers/json.rscrates/biome_cli/src/commands/mod.rscrates/biome_configuration/src/analyzer/mod.rscrates/biome_service/src/file_handlers/mod.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_cli/src/commands/scan_kind.rscrates/biome_lsp/src/server.tests.rscrates/biome_cli/src/execute/mod.rscrates/biome_service/src/workspace.tests.rscrates/biome_cli/tests/cases/linter_domains.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/**/lib/src/**/nursery/**/*.rs : If a rule provides a code action, add `fix_kind` in `declare_lint_rule!` and use `ctx.action_category(ctx.category(), ctx.group())` and `ctx.metadata().applicability()` when constructing actions
Applied to files:
crates/biome_cli/src/commands/scan_kind.rscrates/biome_lsp/src/server.tests.rscrates/biome_configuration/src/analyzer/mod.rs
📚 Learning: 2025-08-11T11:48:27.774Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:48:27.774Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/tests/spec_test.rs : Create tests/spec_test.rs implementing the run(spec_input_file, _expected_file, test_directory, _file_type) function as shown and include!("language.rs")
Applied to files:
crates/biome_cli/src/commands/scan_kind.rscrates/biome_cli/tests/cases/linter_domains.rs
📚 Learning: 2025-08-11T11:53:15.299Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:53:15.299Z
Learning: Applies to crates/biome_service/../biome_lsp/src/server.tests.rs : Keep end-to-end LSP tests in biome_lsp’s server.tests.rs
Applied to files:
crates/biome_lsp/src/server.tests.rscrates/biome_service/src/workspace.tests.rscrates/biome_cli/tests/cases/linter_domains.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/**/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_lsp/src/server.tests.rscrates/biome_cli/src/execute/mod.rscrates/biome_service/src/workspace.rscrates/biome_service/src/workspace.tests.rscrates/biome_lsp/src/handlers/analysis.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 : Use helper advice types from biome_diagnostics::v2 (CodeFrameAdvice, CommandAdvice, DiffAdvice, LogAdvice) when suitable
Applied to files:
crates/biome_lsp/src/server.tests.rscrates/biome_cli/src/execute/mod.rscrates/biome_service/src/workspace.tests.rscrates/biome_configuration/src/analyzer/mod.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_cli/src/execute/mod.rscrates/biome_service/src/workspace.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 : Types implementing Diagnostic must also implement Debug (e.g., use #[derive(Debug, Diagnostic)])
Applied to files:
crates/biome_cli/src/execute/mod.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_cli/src/execute/mod.rs
🧬 Code graph analysis (5)
crates/biome_analyze/src/rule.rs (1)
crates/biome_configuration/src/analyzer/mod.rs (3)
from_str(452-457)from_str(578-656)from_str(716-722)
xtask/codegen/src/generate_configuration.rs (2)
crates/biome_analyze/src/rule.rs (4)
domains(601-604)new(551-569)new(1315-1326)new(1440-1452)xtask/codegen/src/lib.rs (1)
update(53-73)
crates/biome_cli/tests/cases/linter_domains.rs (4)
crates/biome_service/src/configuration.rs (2)
new(129-135)new(707-716)crates/biome_service/src/file_handlers/mod.rs (12)
new(515-528)new(716-730)new(985-1003)new(1300-1314)new(1453-1463)from(88-90)from(94-96)from(100-102)from(106-108)from(112-114)from(118-120)from(124-126)crates/biome_cli/tests/main.rs (1)
run_cli(332-347)crates/biome_cli/tests/snap_test.rs (1)
assert_cli_snapshot(407-409)
crates/biome_service/src/configuration.rs (1)
crates/biome_service/src/file_handlers/mod.rs (2)
selector(1169-1169)selector(1186-1186)
crates/biome_configuration/src/analyzer/mod.rs (1)
crates/biome_analyze/src/rule.rs (4)
fmt(72-78)fmt(170-207)fmt(439-451)from_str(534-547)
⏰ 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). (23)
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Bench (biome_graphql_formatter)
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Bench (biome_json_formatter)
- GitHub Check: Bench (biome_html_formatter)
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Bench (biome_js_formatter)
- GitHub Check: Bench (biome_module_graph)
- GitHub Check: Documentation
- GitHub Check: Bench (biome_configuration)
- GitHub Check: Bench (biome_graphql_parser)
- GitHub Check: Bench (biome_json_analyze)
- GitHub Check: Bench (biome_package)
- GitHub Check: autofix
- GitHub Check: Bench (biome_css_analyze)
- GitHub Check: Bench (biome_json_parser)
- GitHub Check: Bench (biome_html_parser)
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: Check Dependencies
- GitHub Check: Bench (biome_css_parser)
- GitHub Check: Bench (biome_css_formatter)
- GitHub Check: Bench (biome_js_parser)
🔇 Additional comments (25)
crates/biome_analyze/src/rule.rs (1)
19-19: Import looks fine.crates/biome_configuration/src/generated.rs (1)
2-2: Keepmod domain_selector;private
No external references togenerated::domain_selectorwere found—visibility is correct.crates/biome_cli/src/execute/mod.rs (1)
21-21: LGTM: switch to AnalyzerSelector unblocks domain selectors end‑to‑end.crates/biome_cli/src/commands/lint.rs (2)
5-5: LGTM: correct import for the new selector type.
29-31: Resolve: --only/--skip help text and tests already support DOMAIN
Thebpafannotations useargument("GROUP|RULE|DOMAIN")for both --only and --skip (mod.rs lines 245/256) and there’s alinter_domains.rstest covering domains. No change needed.crates/biome_lsp/src/handlers/analysis.rs (1)
10-10: Correctly switching from RuleSelector to AnalyzerSelector in LSP code actionsThe conversion via
AnalyzerSelector::fromis the right way to keep LSP filters interoperable with the new selector type. No issues spotted.Also applies to: 158-163
crates/biome_service/src/workspace/server.rs (1)
1311-1312: Plumbing updated toenabled_selectorslooks soundPassing
enabled_rules(nowVec<AnalyzerSelector>) intoLintParams { enabled_selectors: … }aligns with the new API. All good.crates/biome_lsp/src/server.tests.rs (1)
3469-3470: Tests updated to.into()for AnalyzerSelector are correctUsing
.into()fromRuleSelectorkeeps tests readable and future-proof with the new union type. Nice and tidy.Also applies to: 3499-3500, 3525-3526, 3680-3681, 3714-3715, 3745-3746
crates/biome_cli/tests/cases/linter_domains.rs (1)
416-455: CLI skip-by-domain scenario looks good
--skip=testwith no domain enabled in config is a clear, focused check. Snapshot assertion is appropriate.crates/biome_service/src/workspace.tests.rs (1)
276-279: LGTM on selector conversion in workspace testsSwitching to
RuleSelector::Rule(...).into()matches the newAnalyzerSelectorflow. No further changes needed here.crates/biome_cli/src/commands/scan_kind.rs (1)
83-85: Test adapts cleanly toAnalyzerSelector. LGTM.The
IntoonRuleSelectorkeeps the test concise and future‑proof.Also applies to: 92-92
crates/biome_service/src/file_handlers/javascript.rs (1)
721-729: Selector migration looks good here.The switch to
with_enabled_selectorsinlintis correct and consistent with the builder API.crates/biome_cli/src/commands/mod.rs (2)
236-258: Clear CLI help and examples for DOMAIN support.Nice touch including
test/projectexamples; argument label widened toGROUP|RULE|DOMAINreads well.
942-947: Passing CLI selectors into scan‑kind computation is the right hook.This ensures the workspace scan respects
--only/--skipfrom the start.crates/biome_service/src/file_handlers/json.rs (1)
509-509: Switch to selectors API looks correct.Good swap to
.with_enabled_selectors(¶ms.enabled_selectors). Nothing else in this block changes behaviour.crates/biome_service/src/file_handlers/graphql.rs (1)
429-429: Selectors API adoption LGTM.
.with_enabled_selectors(¶ms.enabled_selectors)aligns GraphQL with the new selector model.xtask/codegen/src/generate_configuration.rs (2)
278-279: Codegen hook for domains: nice integration point.Calling
generate_for_domainshere is clean and keeps the generation single-sourced with group generation.
1161-1164: No action required: MSRV 1.89.0 supportsstd::sync::LazyLock, and it’s already in use across multiple crates.crates/biome_service/src/workspace.rs (2)
68-68: Import swap to AnalyzerSelector looks good.
1656-1672: LGTM on selector plumbing for actions/fixes.Also applies to: 1708-1724
crates/biome_service/src/file_handlers/mod.rs (3)
21-22: Importing AnalyzerSelector and RuleDomainValue is correct.
415-430: Selector plumping LGTM.Struct field changes and visitor params swapped to
AnalyzerSelectorread well.Also applies to: 482-497, 608-623
1160-1174: Verify codegen inclusion for DomainSelector helpers
Ensure the crate’s build script orinclude!invocation incrates/biome_configuration/src/analyzer/mod.rsactually injects animpl DomainSelectorcontaining bothpub fn match_rule::<R>()andpub fn as_rule_filters(); without those methods the calls infile_handlers/mod.rswon’t compile.crates/biome_configuration/src/analyzer/mod.rs (2)
416-447: Introducing AnalyzerSelector is sound.The union, parsing, and serde shape look tidy.
Also applies to: 449-486
597-606: RuleSelector group-name check simplification: nice.
CodSpeed Performance ReportMerging #7392 will not alter performanceComparing Summary
|
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
♻️ Duplicate comments (1)
crates/biome_configuration/src/analyzer/mod.rs (1)
530-541: Doctests reference the wrong type (should use RuleSelector).This will fail doctests; same note as earlier review.
- /// use biome_configuration::analyzer::{AnalyzerSelector, RuleSelector}; + /// use biome_configuration::analyzer::RuleSelector; @@ - /// let selector = AnalyzerSelector::from_lsp_filter(filter).unwrap(); - /// assert_eq!(selector, RuleSelector::Rule("source", "useSortedKeys").into()); + /// let selector = RuleSelector::from_lsp_filter(filter).unwrap(); + /// assert_eq!(selector, RuleSelector::Rule("source", "useSortedKeys")); @@ - /// let selector = AnalyzerSelector::from_lsp_filter(filter).unwrap(); - /// assert_eq!(selector, RuleSelector::Rule("style", "useConst").into()); + /// let selector = RuleSelector::from_lsp_filter(filter).unwrap(); + /// assert_eq!(selector, RuleSelector::Rule("style", "useConst")); @@ - /// let selector = AnalyzerSelector::from_lsp_filter(filter).unwrap(); - /// assert_eq!(selector, RuleSelector::Rule("a11y", "useAltText").into()); + /// let selector = RuleSelector::from_lsp_filter(filter).unwrap(); + /// assert_eq!(selector, RuleSelector::Rule("a11y", "useAltText"));
🧹 Nitpick comments (2)
crates/biome_configuration/src/analyzer/mod.rs (2)
416-497: AnalyzerSelector design looks solid; make FromStr return more helpful errors.Currently returns a generic message, losing
RuleSelector’s detailed errors. Prefer bubbling up the specific rule error if domain parsing also fails.impl FromStr for AnalyzerSelector { type Err = &'static str; fn from_str(s: &str) -> Result<Self, Self::Err> { - RuleSelector::from_str(s) - .map(Self::Rule) - .or(DomainSelector::from_str(s).map(Self::Domain)) - .or(Err("The rule, group or domain doesn't exist.")) + match RuleSelector::from_str(s) { + Ok(rule) => Ok(Self::Rule(rule)), + Err(rule_err) => match DomainSelector::from_str(s) { + Ok(domain) => Ok(Self::Domain(domain)), + Err(_) => Err(rule_err), + }, + } } }
699-748: DomainSelector looks good; tiny serialisation nit.Avoid allocating via
format!during serialisation.impl serde::Serialize for DomainSelector { fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> { - serializer.serialize_str(&format!("{self}")) + serializer.serialize_str(self.0) } }
📜 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 (1)
crates/biome_configuration/src/analyzer/mod.rs(5 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{rs,toml}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Format Rust and TOML files before committing (use
just f/just format).
Files:
crates/biome_configuration/src/analyzer/mod.rs
crates/biome_*/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place core crates under /crates/biome_*/
Files:
crates/biome_configuration/src/analyzer/mod.rs
crates/biome_configuration/src/**
📄 CodeRabbit inference engine (CLAUDE.md)
Keep configuration sources under biome_configuration/src/
Files:
crates/biome_configuration/src/analyzer/mod.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 `domains` in `declare_lint_rule!` when applicable; recommended rules with domains enable only when the domain is active
📚 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_configuration/src/analyzer/mod.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_configuration/src/analyzer/mod.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/**/lib/src/**/nursery/**/*.rs : If a rule provides a code action, add `fix_kind` in `declare_lint_rule!` and use `ctx.action_category(ctx.category(), ctx.group())` and `ctx.metadata().applicability()` when constructing actions
Applied to files:
crates/biome_configuration/src/analyzer/mod.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/**/lib/src/**/nursery/**/*.rs : Use `domains` in `declare_lint_rule!` when applicable; recommended rules with domains enable only when the domain is active
Applied to files:
crates/biome_configuration/src/analyzer/mod.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 : Use helper advice types from biome_diagnostics::v2 (CodeFrameAdvice, CommandAdvice, DiffAdvice, LogAdvice) when suitable
Applied to files:
crates/biome_configuration/src/analyzer/mod.rs
🧬 Code graph analysis (1)
crates/biome_configuration/src/analyzer/mod.rs (1)
crates/biome_analyze/src/rule.rs (4)
fmt(72-78)fmt(170-207)fmt(439-451)from_str(534-547)
⏰ 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). (8)
- GitHub Check: Documentation
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: End-to-end tests
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: autofix
- GitHub Check: Check Dependencies
🔇 Additional comments (2)
crates/biome_configuration/src/analyzer/mod.rs (2)
7-7: Import of RuleDomain is appropriate.Needed for
DomainSelector::from_str. All good.
603-611: Ignore is_none_or MSRV concern. This is the stableis_none_orextension from theis_none_orcrate (not the nightly std API) and carries no MSRV implications. (docs.rs)Likely an incorrect or invalid review 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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
crates/biome_service/src/configuration.rs (1)
746-755: Gate--onlyscan by linter enabledWrap the
for selector in self.only.iter()block in ProjectScanComputer underif self.configuration.is_linter_enabled()so that project‐level scanning isn’t forced when linting is disabled (crates/biome_service/src/configuration.rs lines 766–772).crates/biome_configuration/src/analyzer/mod.rs (1)
623-637: Replace unstable Option::is_none_or usage
Option::is_none_or is a nightly-only API (unstable featureis_none_or, issue #126383) and won’t compile on the repo’s MSRV (Rust 1.89.0). Replace calls withoptional_group_name.map_or(true, |n| n == static_group_name)to maintain compatibility.
♻️ Duplicate comments (1)
crates/biome_configuration/src/analyzer/mod.rs (1)
543-554: Doctest still references the wrong type here.These examples sit under
RuleSelector::from_lsp_filterbut callAnalyzerSelector::from_lsp_filter. Unless that function definitely exists and is preferred here, this will fail or confuse readers. UseRuleSelectorin the examples.- /// use biome_configuration::analyzer::{AnalyzerSelector, RuleSelector}; + /// use biome_configuration::analyzer::RuleSelector; @@ - /// let selector = AnalyzerSelector::from_lsp_filter(filter).unwrap(); - /// assert_eq!(selector, RuleSelector::Rule("source", "useSortedKeys").into()); + /// let selector = RuleSelector::from_lsp_filter(filter).unwrap(); + /// assert_eq!(selector, RuleSelector::Rule("source", "useSortedKeys")); @@ - /// let selector = AnalyzerSelector::from_lsp_filter(filter).unwrap(); - /// assert_eq!(selector, RuleSelector::Rule("style", "useConst").into()); + /// let selector = RuleSelector::from_lsp_filter(filter).unwrap(); + /// assert_eq!(selector, RuleSelector::Rule("style", "useConst")); @@ - /// let selector = AnalyzerSelector::from_lsp_filter(filter).unwrap(); - /// assert_eq!(selector, RuleSelector::Rule("a11y", "useAltText").into()); + /// let selector = RuleSelector::from_lsp_filter(filter).unwrap(); + /// assert_eq!(selector, RuleSelector::Rule("a11y", "useAltText"));
🧹 Nitpick comments (3)
crates/biome_service/src/configuration.rs (2)
720-722: API change is fine; consider minor ergonomics.Accepting
&[AnalyzerSelector]works. Optionally acceptimpl IntoIterator<Item = AnalyzerSelector>to avoid callers needing temporary vecs.- pub fn with_rule_selectors( - mut self, - skip: &'a [AnalyzerSelector], - only: &'a [AnalyzerSelector], - ) -> Self { + pub fn with_rule_selectors<I1, I2>(mut self, skip: I1, only: I2) -> Self + where + I1: IntoIterator<Item = AnalyzerSelector>, + I2: IntoIterator<Item = AnalyzerSelector>, + { - self.skip = skip; - self.> + // store into owned Vecs if you go this route; adjust struct fields accordingly + // self.skip = skip.into_iter().collect(); + // self.> self }
949-971: Domain “only” tests are great; add a skip-domain case too?Consider adding
--skip=projectcoverage to show we avoid project scans when all project-domain rules are excluded.+ #[test] + fn should_not_return_project_if_project_domain_is_skipped() { + let configuration = Configuration::default(); + assert_eq!( + ProjectScanComputer::new(&configuration) + .with_rule_selectors(&[DomainSelector("project").into()], &[]) + .compute(), + ScanKind::NoScanner + ); + }crates/biome_configuration/src/analyzer/mod.rs (1)
752-756: Avoid alloc inDomainSelectorserialisation.Use the inner
&'static strdirectly.impl serde::Serialize for DomainSelector { fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> { - serializer.serialize_str(&format!("{self}")) + serializer.serialize_str(self.0) } }
📜 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 (2)
crates/biome_configuration/src/analyzer/mod.rs(7 hunks)crates/biome_service/src/configuration.rs(7 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{rs,toml}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Format Rust and TOML files before committing (use
just f/just format).
Files:
crates/biome_service/src/configuration.rscrates/biome_configuration/src/analyzer/mod.rs
crates/biome_*/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place core crates under /crates/biome_*/
Files:
crates/biome_service/src/configuration.rscrates/biome_configuration/src/analyzer/mod.rs
crates/biome_configuration/src/**
📄 CodeRabbit inference engine (CLAUDE.md)
Keep configuration sources under biome_configuration/src/
Files:
crates/biome_configuration/src/analyzer/mod.rs
🧠 Learnings (10)
📓 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 `domains` in `declare_lint_rule!` when applicable; recommended rules with domains enable only when the domain is active
📚 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 `domains` in `declare_lint_rule!` when applicable; recommended rules with domains enable only when the domain is active
Applied to files:
crates/biome_service/src/configuration.rscrates/biome_configuration/src/analyzer/mod.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_service/src/configuration.rscrates/biome_configuration/src/analyzer/mod.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_service/src/configuration.rs
📚 Learning: 2025-08-11T11:53:15.299Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:53:15.299Z
Learning: Applies to crates/biome_service/../biome_lsp/src/server.tests.rs : Keep end-to-end LSP tests in biome_lsp’s server.tests.rs
Applied to files:
crates/biome_service/src/configuration.rs
📚 Learning: 2025-08-11T11:48:27.774Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:48:27.774Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/tests/spec_test.rs : Create tests/spec_test.rs implementing the run(spec_input_file, _expected_file, test_directory, _file_type) function as shown and include!("language.rs")
Applied to files:
crates/biome_service/src/configuration.rs
📚 Learning: 2025-08-11T11:48:27.774Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:48:27.774Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/tests/spec_tests.rs : Create tests/spec_tests.rs in the biome_html_formatter crate that generates tests via tests_macros::gen_tests! for all HTML files at tests/specs/html/**/*.html
Applied to files:
crates/biome_service/src/configuration.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/**/lib/src/**/nursery/**/*.rs : Choose an appropriate `severity` in `declare_lint_rule!` (default is info); use `Severity::Error` for hard errors, `Warning` for potential issues, `Information` for style
Applied to files:
crates/biome_service/src/configuration.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/**/lib/src/**/nursery/**/*.rs : If a rule provides a code action, add `fix_kind` in `declare_lint_rule!` and use `ctx.action_category(ctx.category(), ctx.group())` and `ctx.metadata().applicability()` when constructing actions
Applied to files:
crates/biome_configuration/src/analyzer/mod.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 : Use helper advice types from biome_diagnostics::v2 (CodeFrameAdvice, CommandAdvice, DiffAdvice, LogAdvice) when suitable
Applied to files:
crates/biome_configuration/src/analyzer/mod.rs
🧬 Code graph analysis (2)
crates/biome_service/src/configuration.rs (1)
crates/biome_service/src/file_handlers/mod.rs (8)
selector(1169-1169)selector(1186-1186)filter(1164-1164)filter(1164-1164)filter(1181-1181)filter(1181-1181)filter(1333-1333)filter(1351-1351)
crates/biome_configuration/src/analyzer/mod.rs (3)
crates/biome_service/src/file_handlers/mod.rs (4)
domain(1338-1338)domain(1356-1356)fmt(375-405)fmt(409-411)crates/biome_analyze/src/rule.rs (4)
fmt(72-78)fmt(170-207)fmt(439-451)from_str(534-547)crates/biome_service/src/configuration.rs (1)
s(773-773)
⏰ 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). (21)
- GitHub Check: Bench (biome_html_formatter)
- GitHub Check: Bench (biome_configuration)
- GitHub Check: Bench (biome_module_graph)
- GitHub Check: Bench (biome_package)
- GitHub Check: autofix
- GitHub Check: Bench (biome_css_parser)
- GitHub Check: Bench (biome_html_parser)
- GitHub Check: Bench (biome_graphql_formatter)
- GitHub Check: Bench (biome_json_parser)
- GitHub Check: Bench (biome_json_analyze)
- GitHub Check: Bench (biome_js_formatter)
- GitHub Check: Bench (biome_css_formatter)
- GitHub Check: Bench (biome_json_formatter)
- GitHub Check: Bench (biome_css_analyze)
- GitHub Check: Bench (biome_js_parser)
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: Bench (biome_graphql_parser)
- GitHub Check: Documentation
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Check Dependencies
🔇 Additional comments (9)
crates/biome_service/src/configuration.rs (6)
7-7: Import update aligns with new selector model.Switch to
AnalyzerSelectorandRuleDomainValuelooks correct.
702-704: Struct fields switched toAnalyzerSelector— good migration.This unblocks domain-aware matching downstream.
765-775: Correct: selectors now honoured viamatch_rule(domains included).This fixes the earlier bug where
--skip/--onlydomain selectors had no effect on scan computation.
825-826: Test imports reflect new API.Bringing
DomainSelectorinto scope is expected with domain-aware tests.
912-914: Rule-only skip path covered.Good regression test ensuring a project-domain rule can be skipped.
941-943: Rule-only “only” path covered.Confirms “only rule” forces project scan — nice.
crates/biome_configuration/src/analyzer/mod.rs (3)
7-7: Import additions OK.
RuleDomainandRuleFilterare used below; all good.
417-471: NewAnalyzerSelectorabstraction is solid.
- Enum + conversions cover both rules and domains.
FromStr, Display/Debug, serde, and schema implementations look consistent.match_ruledelegates appropriately.Nice consolidation.
570-576: HelperRuleSelector::match_ruleis neat.Keeps call sites terse by deferring to
RuleFilter.
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: 2
🧹 Nitpick comments (4)
crates/biome_configuration/src/analyzer/mod.rs (2)
543-554: Doc example: drop the unusedAnalyzerSelectorimport.Tiny nit: importing
AnalyzerSelectorhere may confuse readers.Apply:
- /// use biome_configuration::analyzer::{AnalyzerSelector, RuleSelector}; + /// use biome_configuration::analyzer::RuleSelector;
719-776:DomainSelectoris lean; avoid alloc inSerialize.Serialising via
format!("{self}")allocates. Serialise the inner&'static strdirectly.Apply:
impl serde::Serialize for DomainSelector { fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> { - serializer.serialize_str(&format!("{self}")) + serializer.serialize_str(self.0) } }crates/biome_service/src/configuration.rs (2)
765-775: Matching logic now honours domains.This fixes the prior equality check blind spot for
--skip/--onlywith domains.You can simplify the “only” branch to mirror the “skip” style:
- if !self.only.is_empty() { - for selector in self.only.iter() { - if selector.match_rule::<R>() { - let domains = R::METADATA.domains; - self.requires_project_scan |= domains.contains(&RuleDomain::Project); - break; - } - } + if !self.only.is_empty() { + if self.only.iter().any(|s| s.match_rule::<R>()) { + let domains = R::METADATA.domains; + self.requires_project_scan |= domains.contains(&RuleDomain::Project); + } } else if !self.skip.iter().any(|s| s.match_rule::<R>()) && self.enabled_rules.contains(&filter) {
961-971: Non-project domain test is good; optional API polish.Minor: prefer parsing via
DomainSelector::from_str("test").unwrap()to validate inputs in tests as well.If preferred:
- .with_rule_selectors(&[], &[DomainSelector("test").into()]) + .with_rule_selectors(&[], &[DomainSelector::from_str("test").unwrap().into()])
📜 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 (2)
crates/biome_configuration/src/analyzer/mod.rs(7 hunks)crates/biome_service/src/configuration.rs(7 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{rs,toml}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Format Rust and TOML files before committing (use
just f/just format).
Files:
crates/biome_service/src/configuration.rscrates/biome_configuration/src/analyzer/mod.rs
crates/biome_*/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place core crates under /crates/biome_*/
Files:
crates/biome_service/src/configuration.rscrates/biome_configuration/src/analyzer/mod.rs
crates/biome_configuration/src/**
📄 CodeRabbit inference engine (CLAUDE.md)
Keep configuration sources under biome_configuration/src/
Files:
crates/biome_configuration/src/analyzer/mod.rs
🧠 Learnings (10)
📓 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 `domains` in `declare_lint_rule!` when applicable; recommended rules with domains enable only when the domain is active
📚 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 `domains` in `declare_lint_rule!` when applicable; recommended rules with domains enable only when the domain is active
Applied to files:
crates/biome_service/src/configuration.rscrates/biome_configuration/src/analyzer/mod.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_service/src/configuration.rscrates/biome_configuration/src/analyzer/mod.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_service/src/configuration.rs
📚 Learning: 2025-08-11T11:53:15.299Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:53:15.299Z
Learning: Applies to crates/biome_service/../biome_lsp/src/server.tests.rs : Keep end-to-end LSP tests in biome_lsp’s server.tests.rs
Applied to files:
crates/biome_service/src/configuration.rs
📚 Learning: 2025-08-11T11:48:27.774Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:48:27.774Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/tests/spec_tests.rs : Create tests/spec_tests.rs in the biome_html_formatter crate that generates tests via tests_macros::gen_tests! for all HTML files at tests/specs/html/**/*.html
Applied to files:
crates/biome_service/src/configuration.rs
📚 Learning: 2025-08-11T11:48:27.774Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:48:27.774Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/tests/spec_test.rs : Create tests/spec_test.rs implementing the run(spec_input_file, _expected_file, test_directory, _file_type) function as shown and include!("language.rs")
Applied to files:
crates/biome_service/src/configuration.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/**/lib/src/**/nursery/**/*.rs : Choose an appropriate `severity` in `declare_lint_rule!` (default is info); use `Severity::Error` for hard errors, `Warning` for potential issues, `Information` for style
Applied to files:
crates/biome_service/src/configuration.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/**/lib/src/**/nursery/**/*.rs : If a rule provides a code action, add `fix_kind` in `declare_lint_rule!` and use `ctx.action_category(ctx.category(), ctx.group())` and `ctx.metadata().applicability()` when constructing actions
Applied to files:
crates/biome_configuration/src/analyzer/mod.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 : Use helper advice types from biome_diagnostics::v2 (CodeFrameAdvice, CommandAdvice, DiffAdvice, LogAdvice) when suitable
Applied to files:
crates/biome_configuration/src/analyzer/mod.rs
🧬 Code graph analysis (2)
crates/biome_service/src/configuration.rs (1)
crates/biome_service/src/file_handlers/mod.rs (8)
selector(1169-1169)selector(1186-1186)filter(1164-1164)filter(1164-1164)filter(1181-1181)filter(1181-1181)filter(1333-1333)filter(1351-1351)
crates/biome_configuration/src/analyzer/mod.rs (3)
crates/biome_service/src/file_handlers/mod.rs (4)
domain(1338-1338)domain(1356-1356)fmt(375-405)fmt(409-411)crates/biome_analyze/src/rule.rs (4)
fmt(72-78)fmt(170-207)fmt(439-451)from_str(534-547)crates/biome_service/src/configuration.rs (1)
s(773-773)
⏰ 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). (19)
- GitHub Check: Bench (biome_graphql_formatter)
- GitHub Check: Bench (biome_js_formatter)
- GitHub Check: Bench (biome_configuration)
- GitHub Check: Bench (biome_html_parser)
- GitHub Check: Bench (biome_module_graph)
- GitHub Check: Bench (biome_json_analyze)
- GitHub Check: Bench (biome_graphql_parser)
- GitHub Check: Bench (biome_package)
- GitHub Check: Bench (biome_json_parser)
- GitHub Check: Bench (biome_html_formatter)
- GitHub Check: Bench (biome_json_formatter)
- GitHub Check: Bench (biome_css_analyze)
- GitHub Check: Bench (biome_css_formatter)
- GitHub Check: Bench (biome_css_parser)
- GitHub Check: Bench (biome_js_parser)
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: Documentation
- GitHub Check: Check Dependencies
- GitHub Check: autofix
🔇 Additional comments (13)
crates/biome_configuration/src/analyzer/mod.rs (9)
7-7: Imports look right.Bringing
RuleDomainandRuleinto scope is appropriate for the new selector plumbing.
18-18: Deref import is appropriate.Needed for the
DomainSelectorwrapper ergonomics.
417-446: New union selector type is tidy and future-proof.
AnalyzerSelectorcleanly models rule vs domain selection.
447-451: Debug/Display impls are consistent.Forwarding
DebugtoDisplaykeeps output consistent across both variants.Also applies to: 453-460
462-471: FromStr fallback chain reads well.Tries rule, then domain, with a clear error on failure.
473-480: Serde Visitor is fine.String-based serialisation/deserialisation matches the CLI/JSON shape.
Also applies to: 482-499
501-509: Schema output is acceptable.Naming it “Selector” as a string type is sensible for public schema stability.
570-576: Good: reuseRuleFilterfor rule matching.Keeps match semantics centralised.
623-624: No MSRV issue:Option::is_none_oris supported under Rust 1.89.0
rust-toolchain.toml pins channel to 1.89.0 (stabilised in 1.72), so no change needed.crates/biome_service/src/configuration.rs (4)
7-7: Import switch toAnalyzerSelectoris correct.You’ll need it for domain-aware
--skip/--only.
702-704: Types updated forskip/only.Moving to
&[AnalyzerSelector]is the right abstraction.
719-722: API signature updated accordingly.
with_rule_selectorsnow accepts the union selector—good.
949-959: Domain-only project scan test reads well.Nice coverage for
--only projec 8871 t.
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 (3)
crates/biome_service/src/configuration.rs (3)
763-765: Tiny fast-path: bail early once a project scan is decided.Avoid extra registry visits after we already know the answer.
Apply:
let filter = RuleFilter::Rule(<R::Group as RuleGroup>::NAME, R::METADATA.name); +if self.requires_project_scan { + return; +} + if !self.only.is_empty() {
949-972: Verifytestis recognised or use a known non-project domain
DomainSelector("test")isn’t in the generated domain list, so your test may pass vacuously. Swap to a known non-project domain (e.g."core") or add an assertion that"test"actually resolves.
702-704: Call sites now correctly useAnalyzerSelectorslices (converted with.into()). API update is sound; consider adding awith_selectorsalias and deprecatingwith_rule_selectorsfor clarity.
📜 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 (1)
crates/biome_service/src/configuration.rs(7 hunks)
🧰 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_service/src/configuration.rs
crates/biome_*/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place core crates under /crates/biome_*/
Files:
crates/biome_service/src/configuration.rs
🧠 Learnings (14)
📓 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 `domains` in `declare_lint_rule!` when applicable; recommended rules with domains enable only when the domain is active
📚 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 `domains` in `declare_lint_rule!` when applicable; recommended rules with domains enable only when the domain is active
Applied to files:
crates/biome_service/src/configuration.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_service/src/configuration.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)]`
A 834F pplied to files:
crates/biome_service/src/configuration.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/lib/src/lint/nursery/*.rs : For new JavaScript lint rules generated by `just new-js-lintrule`, implement the rule in the generated file under `biome_js_analyze/lib/src/lint/nursery/`
Applied to files:
crates/biome_service/src/configuration.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/**/lib/src/**/nursery/**/*.rs : Choose an appropriate `severity` in `declare_lint_rule!` (default is info); use `Severity::Error` for hard errors, `Warning` for potential issues, `Information` for style
Applied to files:
crates/biome_service/src/configuration.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 : Use helper advice types from biome_diagnostics::v2 (CodeFrameAdvice, CommandAdvice, DiffAdvice, LogAdvice) when suitable
Applied to files:
crates/biome_service/src/configuration.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/**/lib/src/**/nursery/**/*.rs : Place all new rules in the nursery group (implement new rule files under a `nursery` directory)
Applied to files:
crates/biome_service/src/configuration.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/**/lib/src/**/nursery/**/*.rs : When porting from other linters, declare `sources: &[RuleSource::<...>]` in `declare_lint_rule!` using `.same()` or `.inspired()` as appropriate
Applied to files:
crates/biome_service/src/configuration.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/**/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_service/src/configuration.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/**/lib/src/**/nursery/**/*.rs : If a rule provides a code action, add `fix_kind` in `declare_lint_rule!` and use `ctx.action_category(ctx.category(), ctx.group())` and `ctx.metadata().applicability()` when constructing actions
Applied to files:
crates/biome_service/src/configuration.rs
📚 Learning: 2025-08-11T11:53:15.299Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:53:15.299Z
Learning: Applies to crates/biome_service/../biome_lsp/src/server.tests.rs : Keep end-to-end LSP tests in biome_lsp’s server.tests.rs
Applied to files:
crates/biome_service/src/configuration.rs
📚 Learning: 2025-08-11T11:48:27.774Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:48:27.774Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/tests/spec_test.rs : Create tests/spec_test.rs implementing the run(spec_input_file, _expected_file, test_directory, _file_type) function as shown and include!("language.rs")
Applied to files:
crates/biome_service/src/configuration.rs
📚 Learning: 2025-08-11T11:48:27.774Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:48:27.774Z
Learning: Applies to crates/biome_formatter/biome_html_formatter/tests/spec_tests.rs : Create tests/spec_tests.rs in the biome_html_formatter crate that generates tests via tests_macros::gen_tests! for all HTML files at tests/specs/html/**/*.html
Applied to files:
crates/biome_service/src/configuration.rs
🧬 Code graph analysis (1)
crates/biome_service/src/configuration.rs (1)
crates/biome_service/src/file_handlers/mod.rs (8)
selector(1169-1169)selector(1186-1186)filter(1164-1164)filter(1164-1164)filter(1181-1181)filter(1181-1181)filter(1333-1333)filter(1351-1351)
⏰ 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). (23)
- GitHub Check: Documentation
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Check Dependencies
- GitHub Check: Bench (biome_graphql_parser)
- GitHub Check: Bench (biome_configuration)
- GitHub Check: Bench (biome_json_analyze)
- GitHub Check: Bench (biome_package)
- GitHub Check: Bench (biome_module_graph)
- GitHub Check: autofix
- GitHub Check: Bench (biome_html_parser)
- GitHub Check: Bench (biome_css_formatter)
- GitHub Check: Bench (biome_html_formatter)
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: Bench (biome_js_parser)
- GitHub Check: Bench (biome_json_formatter)
- GitHub Check: Bench (biome_css_parser)
- GitHub Check: Bench (biome_graphql_formatter)
- GitHub Check: Bench (biome_js_formatter)
- GitHub Check: Bench (biome_json_parser)
- GitHub Check: Bench (biome_css_analyze)
🔇 Additional comments (4)
crates/biome_service/src/configuration.rs (4)
7-7: Importing AnalyzerSelector is correct.Matches the new selector model used below. No further action.
765-775: Selector matching fix looks solid.Using
selector.match_rule::<R>()ensures domain-only flags are honoured. This addresses the earlier equality-comparison pitfall.
825-826: Tests import set is right.
RuleSelector,DomainSelector, and friends are all in scope; good.
912-913: Explicit.into()to AnalyzerSelector is appropriate.Keeps tests readable while exercising the new API.
Also applies to: 942-943
Summary
Closes #6880
Now
--skipand--onlysupport domains too! They work the same as when you pass a group. However, we need to rely to some codegen because domains work across groups, so we need to codegen the filters generated by those domains.Test Plan
Added new tests
Docs
Updated the relative CLI commands. Docs will be updated automatically upon release.