- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 735
chore: document rule-group severity relation and update rules_check #7827
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
| 
 | 
0569488    to
    5e7cf14      
    Compare
  
    | WalkthroughAdds documentation to crates/biome_analyze/CONTRIBUTING.md describing rule groups, mandatory severities per category, guidance for promoting rules out of the nursery, and rule domains with an explicit  Possibly related PRs
 Suggested reviewers
 Pre-merge checks and finishing touches❌ Failed checks (1 warning)
 ✅ Passed checks (2 passed)
 ✨ Finishing touches
 🧪 Generate unit tests (beta)
 Comment  | 
| Parser conformance results onjs/262
 jsx/babel
 symbols/microsoft
 ts/babel
 ts/microsoft
 | 
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
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
- crates/biome_analyze/CONTRIBUTING.md(2 hunks)
- xtask/rules_check/src/lib.rs(2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
crates/biome_*/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place core crates under /crates/biome_*/
Files:
- crates/biome_analyze/CONTRIBUTING.md
**/*.rs
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.rs: Format Rust files before committing (e.g., viajust fwhich formats Rust)
Document rules, assists, and options with inline rustdoc in source
Files:
- xtask/rules_check/src/lib.rs
🧠 Learnings (5)
📓 Common learnings
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.139Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : Choose rule severity appropriately (error/warn/info); set severity in declare_lint_rule! only when deviating from default
📚 Learning: 2025-10-15T09:20:19.139Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.139Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : Use RuleDomain(s) only when applicable and list them in declare_lint_rule! domains; recommended rules with domains are enabled based on manifest detection
Applied to files:
- crates/biome_analyze/CONTRIBUTING.md
📚 Learning: 2025-10-15T09:20:19.139Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.139Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : Documentation for rules must have a single-line first paragraph, include ## Examples with ### Invalid then ### Valid, and document options under ## Options with properly marked code blocks
Applied to files:
- crates/biome_analyze/CONTRIBUTING.md
📚 Learning: 2025-10-15T09:20:19.139Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.139Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : Choose rule severity appropriately (error/warn/info); set severity in declare_lint_rule! only when deviating from default
Applied to files:
- crates/biome_analyze/CONTRIBUTING.md
📚 Learning: 2025-10-15T09:20:19.139Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.139Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : When returning a code action, set category to ctx.action_category(ctx.category(), ctx.group()) and applicability via ctx.metadata().applicability()
Applied to files:
- xtask/rules_check/src/lib.rs
🧬 Code graph analysis (1)
xtask/rules_check/src/lib.rs (1)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (3)
Severity(9269-9269)
Category(8836-9259)
RuleCategory(9638-9638)
🪛 LanguageTool
crates/biome_analyze/CONTRIBUTING.md
[style] ~521-~521: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...relevant to Biome maintainers when they want to move (promote) a rule to a group that i...
(REP_WANT_TO_VB)
[uncategorized] ~526-~526: Loose punctuation mark.
Context: ...llow these constraints.  - correctness, security, and a11y rules must h...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~528-~528: Possible missing comma found.
Context: ...ould certainly be in another group (for example suspicious instead of correctness)....
(AI_HYDRA_LEO_MISSING_COMMA)
⏰ 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). (10)
- GitHub Check: Test Node.js API
- GitHub Check: Documentation
- GitHub Check: End-to-end tests
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: Check Dependencies
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: autofix
- GitHub Check: Parser conformance
🔇 Additional comments (5)
crates/biome_analyze/CONTRIBUTING.md (1)
519-537: Clear documentation of group-severity relationships.This guidance helps maintainers understand the expected severity levels for each rule group, and appropriately acknowledges legacy exceptions. Well done.
xtask/rules_check/src/lib.rs (4)
35-48: LGTM: Clean refactoring to explicit fields.The shift from a tuple struct to explicit fields improves clarity. Using
&'static strfor compile-time metadata is appropriate.
50-93: Excellent error messages with clear guidance.The pattern-matched messages are helpful and actionable. The
unreachable!at line 89 is acceptable for a build-time tool—it'll fail fast if a new group isn't handled.
112-165: Logic correctly implements group-severity constraints.The validation logic matches the documented requirements, with legacy exceptions appropriately inline-commented. Whilst the exception lists are lengthy, the PR objectives acknowledge this—good candidate for future cleanup tracking.
49-49: Good practice: implementingstd::error::Error.This enables the type to work with standard error-handling patterns.
5e7cf14    to
    e18ed57      
    Compare
  
    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
🧹 Nitpick comments (1)
crates/biome_analyze/CONTRIBUTING.md (1)
523-535: Tidy the plural phrasingThose bullets currently read “Rules that belongs…”. Could you switch them to “Rules that belong…” (and similarly for each occurrence) to keep the prose crisp?
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
- crates/biome_analyze/CONTRIBUTING.md(2 hunks)
- xtask/rules_check/src/lib.rs(2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
crates/biome_*/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place core crates under /crates/biome_*/
Files:
- crates/biome_analyze/CONTRIBUTING.md
**/*.rs
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.rs: Format Rust files before committing (e.g., viajust fwhich formats Rust)
Document rules, assists, and options with inline rustdoc in source
Files:
- xtask/rules_check/src/lib.rs
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.139Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : Documentation for rules must have a single-line first paragraph, include ## Examples with ### Invalid then ### Valid, and document options under ## Options with properly marked code blocks
📚 Learning: 2025-10-15T09:20:19.139Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.139Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : Choose rule severity appropriately (error/warn/info); set severity in declare_lint_rule! only when deviating from default
Applied to files:
- crates/biome_analyze/CONTRIBUTING.md
📚 Learning: 2025-10-15T09:20:19.139Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.139Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : Use RuleDomain(s) only when applicable and list them in declare_lint_rule! domains; recommended rules with domains are enabled based on manifest detection
Applied to files:
- crates/biome_analyze/CONTRIBUTING.md
📚 Learning: 2025-10-15T09:20:19.139Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.139Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : When returning a code action, set category to ctx.action_category(ctx.category(), ctx.group()) and applicability via ctx.metadata().applicability()
Applied to files:
- xtask/rules_check/src/lib.rs
🧬 Code graph analysis (1)
xtask/rules_check/src/lib.rs (1)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (3)
Severity(9269-9269)
Category(8836-9259)
RuleCategory(9638-9638)
🪛 LanguageTool
crates/biome_analyze/CONTRIBUTING.md
[style] ~521-~521: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...relevant to Biome maintainers when they want to move (promote) a rule to a group that i...
(REP_WANT_TO_VB)
[uncategorized] ~526-~526: Loose punctuation mark.
Context: ...llow these constraints.  - correctness, security, and a11y rules must h...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~528-~528: Possible missing comma found.
Context: ...ould certainly be in another group (for example suspicious instead of correctness)....
(AI_HYDRA_LEO_MISSING_COMMA)
⏰ 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). (10)
- GitHub Check: Documentation
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Check Dependencies
- GitHub Check: End-to-end tests
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Test Node.js API
- GitHub Check: autofix
- GitHub Check: Parser conformance
e18ed57    to
    b080a4d      
    Compare
  
    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)
xtask/rules_check/src/lib.rs (2)
401-403: Typo in comment.“arent't” → “aren't”.
- /// that arent't present in the source code but only in the AST. + /// that aren't present in the source code but only in the AST.
617-623: Fix: pass correct language types to create_analyzer_options for CSS and GraphQL.Line 617 (CSS block) incorrectly uses
JsonLanguage—should beCssLanguage. Line 663 (GraphQL block) incorrectly usesJsonLanguage—should beGraphqlLanguage. Both mismatches will cause incorrect analysis settings.- let options = create_analyzer_options::<JsonLanguage>( + let options = create_analyzer_options::<CssLanguage>( &workspace_settings, project_key, &file_path, test, );- let options = create_analyzer_options::<JsonLanguage>( + let options = create_analyzer_options::<GraphqlLanguage>( &workspace_settings, project_key, &file_path, test, );
♻️ Duplicate comments (1)
crates/biome_analyze/CONTRIBUTING.md (1)
519-539: Thanks for nailing down group↔severity (incl. Actions=info).Content matches the new checker. One tiny prose tweak: add a comma after “for example” for readability in Line 528.
- If `error` is too strict for a rule, then it should certainly be in another group (for example `suspicious` instead of `correctness`). + If `error` is too strict for a rule, then it should certainly be in another group (for example, `suspicious` instead of `correctness`).
🧹 Nitpick comments (4)
xtask/rules_check/src/lib.rs (4)
70-87: Polish Display messages: grammar and clarity.Minor English fixes and a slightly friendlier nudge.
- "Rules that belongs to the group '{group}' must not have a severity set to 'error'. Lower down the severity or change the group of the rule." + "Rules that belong to the group '{group}' must not have a severity set to 'error'. Lower the severity or change the group of the rule."- "Rules that belongs to the group '{group}' must have a severity set to 'warn'. Set the severity to 'warn' or change the group of the rule." + "Rules that belong to the group '{group}' must have a severity set to 'warn'. Set the severity to 'warn' or change the group of the rule."- "Rules that belongs to the group '{group}' must have a severity set to 'warn' or 'error'. Change the severity or change the group of the rule." + "Rules that belong to the group '{group}' must have a severity set to 'warn' or 'error'. Change the severity or change the group of the rule."- "The rule '{rule_name}' belongs to the group '{group}' and has a severity set to '{rule_severity}'. Rules that belongs to the group {group} must have a severity set to 'error'. Set the severity to 'error' or change the group of the rule." + "The rule '{rule_name}' belongs to the group '{group}' and has a severity set to '{rule_severity}'. Rules that belong to the group '{group}' must have a severity set to 'error'. Set the severity to 'error' or change the group of the rule."
88-91: Avoid panic on unknown group.unreachable! will explode if a new group lands before this code is updated. Emit a generic message instead.
- _ => { - unreachable!("Unhandled group"); - } + _ => write!( + f, + "The rule '{rule_name}' belongs to the unrecognised group '{group}' with severity '{rule_severity}'. Please update rules_check to handle this group." + ),
112-160: Complex condition is getting unwieldy; consider extracting helpers and exception sets.For readability and maintenance, lift each group check into a dedicated fn and move exception rule names into const slices per group. This makes adding/removing exceptions in a future major less error‑prone.
338-345: Nit: use usize for a count.diagnostic_count is a count; usize is more idiomatic than i32.
- diagnostic_count: i32, + diagnostic_count: usize,
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
- crates/biome_analyze/CONTRIBUTING.md(2 hunks)
- xtask/rules_check/src/lib.rs(2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.rs
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.rs: Format Rust files before committing (e.g., viajust fwhich formats Rust)
Document rules, assists, and options with inline rustdoc in source
Files:
- xtask/rules_check/src/lib.rs
crates/biome_*/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place core crates under /crates/biome_*/
Files:
- crates/biome_analyze/CONTRIBUTING.md
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.139Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : Documentation for rules must have a single-line first paragraph, include ## Examples with ### Invalid then ### Valid, and document options under ## Options with properly marked code blocks
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.139Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : Choose rule severity appropriately (error/warn/info); set severity in declare_lint_rule! only when deviating from default
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.139Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : Use RuleDomain(s) only when applicable and list them in declare_lint_rule! domains; recommended rules with domains are enabled based on manifest detection
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.139Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : Place new rules in the "nursery" group initially
📚 Learning: 2025-10-15T09:20:19.139Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.139Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : When returning a code action, set category to ctx.action_category(ctx.category(), ctx.group()) and applicability via ctx.metadata().applicability()
Applied to files:
- xtask/rules_check/src/lib.rs
📚 Learning: 2025-10-15T09:20:19.139Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.139Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : Choose rule severity appropriately (error/warn/info); set severity in declare_lint_rule! only when deviating from default
Applied to files:
- crates/biome_analyze/CONTRIBUTING.md
📚 Learning: 2025-10-15T09:20:19.139Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.139Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : Use RuleDomain(s) only when applicable and list them in declare_lint_rule! domains; recommended rules with domains are enabled based on manifest detection
Applied to files:
- crates/biome_analyze/CONTRIBUTING.md
🪛 LanguageTool
crates/biome_analyze/CONTRIBUTING.md
[style] ~521-~521: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...relevant to Biome maintainers when they want to move (promote) a rule to a group that i...
(REP_WANT_TO_VB)
[uncategorized] ~526-~526: Loose punctuation mark.
Context: ...llow these constraints.  - correctness, security, and a11y rules must h...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~528-~528: Possible missing comma found.
Context: ...ould certainly be in another group (for example suspicious instead of correctness)....
(AI_HYDRA_LEO_MISSING_COMMA)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: Documentation
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Check Dependencies
- GitHub Check: Test Node.js API
- GitHub Check: Parser conformance
- GitHub Check: autofix
🔇 Additional comments (1)
crates/biome_analyze/CONTRIBUTING.md (1)
547-559: Rule domains snippet LGTM.Import and example are clear and consistent with existing guidance. No changes needed.
b080a4d    to
    ea5e153      
    Compare
  
    48e6542    to
    d21e71c      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
xtask/rules_check/src/lib.rs (1)
39-39: Remove misleadingconstmodifier.The
const fnmodifier here provides no practical benefit sinceStringcannot be constructed in const contexts anyway. All call sites useformat!(...), which isn't const-evaluable.Apply this diff:
- const fn new(message: String) -> Self { + fn new(message: String) -> Self {
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
- crates/biome_analyze/CONTRIBUTING.md(2 hunks)
- xtask/rules_check/src/lib.rs(2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
crates/biome_*/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place core crates under /crates/biome_*/
Files:
- crates/biome_analyze/CONTRIBUTING.md
**/*.rs
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.rs: Format Rust files before committing (e.g., viajust fwhich formats Rust)
Document rules, assists, and options with inline rustdoc in source
Files:
- xtask/rules_check/src/lib.rs
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.139Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : Documentation for rules must have a single-line first paragraph, include ## Examples with ### Invalid then ### Valid, and document options under ## Options with properly marked code blocks
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.139Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : Choose rule severity appropriately (error/warn/info); set severity in declare_lint_rule! only when deviating from default
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.139Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : Place new rules in the "nursery" group initially
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.139Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : Use RuleDomain(s) only when applicable and list them in declare_lint_rule! domains; recommended rules with domains are enabled based on manifest detection
📚 Learning: 2025-10-15T09:20:19.139Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.139Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : Choose rule severity appropriately (error/warn/info); set severity in declare_lint_rule! only when deviating from default
Applied to files:
- crates/biome_analyze/CONTRIBUTING.md
📚 Learning: 2025-10-15T09:20:19.139Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.139Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : Place new rules in the "nursery" group initially
Applied to files:
- crates/biome_analyze/CONTRIBUTING.md
📚 Learning: 2025-10-15T09:20:19.139Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.139Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : Use RuleDomain(s) only when applicable and list them in declare_lint_rule! domains; recommended rules with domains are enabled based on manifest detection
Applied to files:
- crates/biome_analyze/CONTRIBUTING.md
🪛 LanguageTool
crates/biome_analyze/CONTRIBUTING.md
[style] ~522-~522: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...relevant to Biome maintainers when they want to move (promote) a rule to a group that i...
(REP_WANT_TO_VB)
[uncategorized] ~527-~527: Loose punctuation mark.
Context: ...llow these constraints.  - correctness, security, and a11y rules must h...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~529-~529: Possible missing comma found.
Context: ...ould certainly be in another group (for example suspicious instead of correctness)....
(AI_HYDRA_LEO_MISSING_COMMA)
⏰ 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: Lint project (depot-windows-2022)
- GitHub Check: Check Dependencies
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Documentation
- GitHub Check: Test Node.js API
- GitHub Check: autofix
- GitHub Check: Parser conformance
🔇 Additional comments (3)
crates/biome_analyze/CONTRIBUTING.md (2)
519-540: Excellent documentation of severity requirements.This section clearly documents all the group/severity constraints that the
rules_checkxtask now enforces. The guidance will help maintainers avoid validation errors when promoting rules from nursery.
541-572: Clear and helpful domain documentation.This section provides a solid explanation of rule domains with a practical example. The note about consulting maintainers before adding new domains is a sensible safeguard.
xtask/rules_check/src/lib.rs (1)
60-142: Comprehensive severity validation logic.The expanded validation enforces all the group/severity constraints now documented in CONTRIBUTING.md. The TODO comments for legacy exceptions are appropriately placed, and error messages clearly guide developers to fix validation failures.
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.
Just one comment to address
d21e71c    to
    cce7aa4      
    Compare
  
    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
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
- crates/biome_analyze/CONTRIBUTING.md(3 hunks)
- xtask/rules_check/src/lib.rs(2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
crates/biome_*/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place core crates under /crates/biome_*/
Files:
- crates/biome_analyze/CONTRIBUTING.md
**/*.rs
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.rs: Format Rust files before committing (e.g., viajust fwhich formats Rust)
Document rules, assists, and options with inline rustdoc in source
Files:
- xtask/rules_check/src/lib.rs
🧠 Learnings (5)
📓 Common learnings
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.139Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : Documentation for rules must have a single-line first paragraph, include ## Examples with ### Invalid then ### Valid, and document options under ## Options with properly marked code blocks
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.139Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : Choose rule severity appropriately (error/warn/info); set severity in declare_lint_rule! only when deviating from default
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.139Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : Place new rules in the "nursery" group initially
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.139Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : Use RuleDomain(s) only when applicable and list them in declare_lint_rule! domains; recommended rules with domains are enabled based on manifest detection
📚 Learning: 2025-10-15T09:20:19.139Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.139Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : Choose rule severity appropriately (error/warn/info); set severity in declare_lint_rule! only when deviating from default
Applied to files:
- crates/biome_analyze/CONTRIBUTING.md
📚 Learning: 2025-10-15T09:20:19.139Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.139Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : Documentation for rules must have a single-line first paragraph, include ## Examples with ### Invalid then ### Valid, and document options under ## Options with properly marked code blocks
Applied to files:
- crates/biome_analyze/CONTRIBUTING.md
📚 Learning: 2025-10-15T09:20:19.139Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.139Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : Place new rules in the "nursery" group initially
Applied to files:
- crates/biome_analyze/CONTRIBUTING.md
📚 Learning: 2025-10-15T09:20:19.139Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:20:19.139Z
Learning: Applies to crates/biome_analyze/**/lib/src/{lint,assist}/**/*.rs : Use RuleDomain(s) only when applicable and list them in declare_lint_rule! domains; recommended rules with domains are enabled based on manifest detection
Applied to files:
- crates/biome_analyze/CONTRIBUTING.md
🧬 Code graph analysis (1)
xtask/rules_check/src/lib.rs (1)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (3)
Severity(9269-9269)
Category(8836-9259)
RuleCategory(9638-9638)
🪛 LanguageTool
crates/biome_analyze/CONTRIBUTING.md
[style] ~523-~523: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...relevant to Biome maintainers when they want to move (promote) a rule to a group that i...
(REP_WANT_TO_VB)
[uncategorized] ~528-~528: Loose punctuation mark.
Context: ...llow these constraints.  - correctness, security, and a11y rules must h...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~530-~530: Possible missing comma found.
Context: ...ould certainly be in another group (for example suspicious instead of correctness)....
(AI_HYDRA_LEO_MISSING_COMMA)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
- GitHub Check: Test Node.js API
- GitHub Check: Documentation
- GitHub Check: Check Dependencies
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Parser conformance
- GitHub Check: autofix
🔇 Additional comments (3)
crates/biome_analyze/CONTRIBUTING.md (2)
29-29: LGTM!TOC entry correctly added for the new section.
520-574: Excellent documentation of group/severity constraints.The new sections clearly document the severity requirements for each rule group and provide helpful guidance on rule domains. All previously requested improvements have been addressed, including the action severity requirement.
xtask/rules_check/src/lib.rs (1)
68-141: Comprehensive validation logic with clear error messages.The expanded group/severity checks align well with the updated documentation. The exception lists are properly marked for future cleanup, and the error messages provide actionable guidance.
| const fn new(message: String) -> Self { | ||
| Self { message } | ||
| } | 
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.
Remove const – String isn't const-compatible.
This won't compile; const fn cannot accept String parameters because heap allocation isn't const-evaluable.
Apply this diff:
-    const fn new(message: String) -> Self {
+    fn new(message: String) -> Self {
         Self { message }
     }📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const fn new(message: String) -> Self { | |
| Self { message } | |
| } | |
| fn new(message: String) -> Self { | |
| Self { message } | |
| } | 
🤖 Prompt for AI Agents
In xtask/rules_check/src/lib.rs around lines 39 to 41, the constructor is
declared as `const fn new(message: String) -> Self` which is invalid because
`String` cannot be used in const functions; change the signature to a normal
function by removing `const` so it reads `fn new(message: String) -> Self { Self
{ message } }` (alternatively consider accepting `&str` and cloning if you
prefer), ensuring the implementation stays the same but is non-const.
Summary
Address #7758 (comment)
This PR updates the
biome_analyzeCONTRIBUTING guide and updaterules_checkxtask to emit diagnostic when a rule has a severity level unexpected in regard of its group.Also, I added the exceptions we have. There era r5e more exceptions than I expected.
We should consider removing these exceptions in a future major version by moving the rules to other groups or by updating their severity. A third possibility is to relax some checks.
Test Plan
Everything should be green on CI.
Docs
I updated the contributing guide.