Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Netail
Copy link
Member

@Netail Netail commented Oct 3, 2025

Summary

Implement Eslint Graphql's description-style

Related # #3303

Test Plan

Docs

@changeset-bot
Copy link

changeset-bot bot commented Oct 3, 2025

πŸ¦‹ Changeset detected

Latest commit: c14d38f

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

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

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added A-Project Area: project A-Linter Area: linter A-Diagnostic Area: diagnostocis labels Oct 3, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Oct 3, 2025

CodSpeed Performance Report

Merging #7672 will not alter performance

Comparing Netail:feat/use-description-style (c14d38f) with main (b785a21)1

Summary

βœ… 1 untouched
⏩ 154 skipped2

Footnotes

  1. No successful run was found on main (8b93578) during the generation of this report, so b785a21 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

  2. 154 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 3, 2025

Walkthrough

Adds a new GraphQL linter rule useConsistentGraphqlDescriptions (nursery) with implementation, diagnostics and examples; introduces configuration types UseConsistentGraphqlDescriptionsOptions and Style (Block|Inline) with parsing/serialization in biome_rule_options; exports the new module and wires the rule into the GraphQL analyzer crate; adds a changelog entry documenting the rule.

Suggested reviewers

  • ematipico

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
βœ… Passed checks (2 passed)
Check name Status Explanation
Title check βœ… Passed The title accurately describes the main change: implementing a new GraphQL linter rule for consistent descriptions.
Description check βœ… Passed The description relates to the changeset by referencing ESLint GraphQL's description-style rule and a related discussion, though it lacks concrete test plan details.
✨ Finishing touches
  • πŸ“ Generate docstrings
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

πŸ“œ Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 459a6ac and 9147ffa.

β›” Files ignored due to path filters (7)
  • crates/biome_configuration/src/analyzer/linter/rules.rs is excluded by !**/rules.rs and included by **
  • crates/biome_diagnostics_categories/src/categories.rs is excluded by !**/categories.rs and included by **
  • crates/biome_graphql_analyze/src/lint/nursery.rs is excluded by !**/nursery.rs and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useDescriptionStyle/invalid.graphql.snap is excluded by !**/*.snap and included by **
  • crates/biome_graphql_analyze/tests/specs/nursery/useDescriptionStyle/valid.graphql.snap is excluded by !**/*.snap and included by **
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts is excluded by !**/backend-jsonrpc/src/workspace.ts and included by **
  • packages/@biomejs/biome/configuration_schema.json is excluded by !**/configuration_schema.json and included by **
πŸ“’ Files selected for processing (7)
  • .changeset/chubby-bottles-lick.md (1 hunks)
  • crates/biome_graphql_analyze/src/lint.rs (1 hunks)
  • crates/biome_graphql_analyze/src/lint/nursery/use_description_style.rs (1 hunks)
  • crates/biome_graphql_analyze/tests/specs/nursery/useDescriptionStyle/invalid.graphql (1 hunks)
  • crates/biome_graphql_analyze/tests/specs/nursery/useDescriptionStyle/valid.graphql (1 hunks)
  • crates/biome_rule_options/src/lib.rs (1 hunks)
  • crates/biome_rule_options/src/use_description_style.rs (1 hunks)
🧰 Additional context used
πŸ““ Path-based instructions (6)
crates/biome_*/**

πŸ“„ CodeRabbit inference engine (CLAUDE.md)

Place core crates under /crates/biome_*/

Files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_graphql_analyze/src/lint.rs
  • crates/biome_graphql_analyze/tests/specs/nursery/useDescriptionStyle/valid.graphql
  • crates/biome_rule_options/src/use_description_style.rs
  • crates/biome_graphql_analyze/tests/specs/nursery/useDescriptionStyle/invalid.graphql
  • crates/biome_graphql_analyze/src/lint/nursery/use_description_style.rs
**/*.{rs,toml}

πŸ“„ CodeRabbit inference engine (CONTRIBUTING.md)

Before committing, format Rust and TOML files (e.g., via just f/just format)

Files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_graphql_analyze/src/lint.rs
  • crates/biome_rule_options/src/use_description_style.rs
  • crates/biome_graphql_analyze/src/lint/nursery/use_description_style.rs
**/*.rs

πŸ“„ CodeRabbit inference engine (CONTRIBUTING.md)

Document rules, assists, and options via inline rustdoc in Rust source

Files:

  • crates/biome_rule_options/src/lib.rs
  • crates/biome_graphql_analyze/src/lint.rs
  • crates/biome_rule_options/src/use_description_style.rs
  • crates/biome_graphql_analyze/src/lint/nursery/use_description_style.rs
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**

πŸ“„ CodeRabbit inference engine (CLAUDE.md)

Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}

Files:

  • crates/biome_graphql_analyze/src/lint.rs
  • crates/biome_graphql_analyze/tests/specs/nursery/useDescriptionStyle/valid.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useDescriptionStyle/invalid.graphql
  • crates/biome_graphql_analyze/src/lint/nursery/use_description_style.rs
**/tests/**

πŸ“„ CodeRabbit inference engine (CLAUDE.md)

Place test files under a tests/ directory in each crate

Files:

  • crates/biome_graphql_analyze/tests/specs/nursery/useDescriptionStyle/valid.graphql
  • crates/biome_graphql_analyze/tests/specs/nursery/useDescriptionStyle/invalid.graphql
.changeset/**/*.md

πŸ“„ CodeRabbit inference engine (CONTRIBUTING.md)

.changeset/**/*.md: Create changesets using the just new-changeset command; do not author them manually
In changeset markdown, only use headers #### or #####
Changeset descriptions must end every sentence with a full stop (.)
For bug fixes, start the changeset description with a linked issue reference like β€œFixed #1234”
Prefer past tense for what was done and present tense for current behavior in changesets

Files:

  • .changeset/chubby-bottles-lick.md
🧠 Learnings (4)
πŸ“š Learning: 2025-10-02T12:57:33.209Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:57:33.209Z
Learning: Applies to crates/biome_analyze/crates/biome_js_analyze/lib/src/lint/nursery/*.rs : Place all new JavaScript lint rules in the nursery group under biome_js_analyze/lib/src/lint/nursery/<rule_name>.rs

Applied to files:

  • crates/biome_graphql_analyze/src/lint.rs
πŸ“š Learning: 2025-10-02T12:57:33.209Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:57:33.209Z
Learning: Applies to crates/biome_analyze/crates/biome_rule_options/lib/*.rs : Define per-rule options in biome_rule_options/lib/<rule>.rs with a dedicated options struct/enum (camelCase serde names, deny_unknown_fields, default) and derive Serialize/Deserialize/Deserializable (and schemars JsonSchema when schema feature is on)

Applied to files:

  • crates/biome_rule_options/src/use_description_style.rs
πŸ“š Learning: 2025-10-02T12:57:33.209Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:57:33.209Z
Learning: Applies to crates/biome_analyze/crates/**/src/**/lint/**/*.rs : Document rules in the declare_lint_rule! doc comment with a one-line first paragraph, followed by sections including ## Examples, ### Invalid (first) and ### Valid, and optional ## Options

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_description_style.rs
πŸ“š Learning: 2025-10-02T12:57:33.209Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:57:33.209Z
Learning: Applies to crates/biome_analyze/crates/**/src/**/lint/**/*.rs : In documentation code blocks: specify a language; mark invalid examples with expect_diagnostic (exactly one diagnostic per snippet); valid examples must parse with no diagnostics; order modifiers consistently; use options/full_options/use_options where applicable

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_description_style.rs
🧬 Code graph analysis (3)
crates/biome_graphql_analyze/src/lint.rs (1)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (2)
  • Nursery (1627-1764)
  • Style (1850-2139)
crates/biome_rule_options/src/use_description_style.rs (1)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (2)
  • UseDescriptionStyleOptions (8216-8216)
  • Style (1850-2139)
crates/biome_graphql_analyze/src/lint/nursery/use_description_style.rs (2)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (2)
  • Style (1850-2139)
  • UseDescriptionStyleOptions (8216-8216)
crates/biome_analyze/src/rule.rs (3)
  • sources (576-579)
  • same (244-249)
  • recommended (561-564)
⏰ 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). (12)
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Documentation
  • GitHub Check: Check Dependencies
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: autofix
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Test Node.js API
  • GitHub Check: Bench (biome_configuration)
  • GitHub Check: Check JS Files
  • GitHub Check: Bench (biome_graphql_formatter)
  • GitHub Check: Bench (biome_graphql_parser)
πŸ”‡ Additional comments (6)
crates/biome_rule_options/src/use_description_style.rs (1)

1-41: LGTM!

The options struct and enum follow the project conventions: camelCase serde naming, deny_unknown_fields, proper derives (including JsonSchema under feature gate), and sensible defaults.

crates/biome_rule_options/src/lib.rs (1)

277-277: LGTM!

Module export is correctly placed in alphabetical order.

crates/biome_graphql_analyze/tests/specs/nursery/useDescriptionStyle/valid.graphql (1)

1-15: LGTM!

Valid test spec correctly demonstrates block-style descriptions (the default), and the comment accurately states no diagnostics should be generated.

crates/biome_graphql_analyze/tests/specs/nursery/useDescriptionStyle/invalid.graphql (1)

1-8: LGTM!

Invalid test spec correctly demonstrates inline-style descriptions, which should trigger diagnostics when the default block style is enforced.

crates/biome_graphql_analyze/src/lint.rs (1)

6-9: LGTM!

The nursery module is correctly exposed, and the Lint category declaration properly includes the new Nursery group. This follows the established pattern for adding lint groups.

crates/biome_graphql_analyze/src/lint/nursery/use_description_style.rs (1)

62-78: LGTM!

The diagnostic message correctly identifies the violation and provides clear guidance on the expected style, assuming the run method is fixed to signal both Block and Inline violations.

@Netail Netail force-pushed the feat/use-description-style branch from 02192ad to 9107c7b Compare October 3, 2025 12:58
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
crates/biome_graphql_analyze/src/lint/nursery/use_description_style.rs (1)

10-33: Consider documenting the style option.

The doc comment follows the required structure (one-line summary, ## Examples, ### Invalid first, ### Valid). However, since the rule accepts UseDescriptionStyleOptions with a configurable style field, consider adding an optional ## Options section to document the available choices (block or inline) and the default.

Example addition after line 32:

+    ///
+    /// ## Options
+    ///
+    /// Use the `style` option to specify the required description style:
+    /// - `"block"` (default): Requires triple-quoted block descriptions (`"""..."""`)
+    /// - `"inline"`: Requires single-quoted inline descriptions (`"..."`)

Based on learnings.

πŸ“œ Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 02192ad and 9107c7b.

β›” Files ignored due to path filters (1)
  • crates/biome_graphql_analyze/tests/specs/nursery/useDescriptionStyle/invalid.graphql.snap is excluded by !**/*.snap and included by **
πŸ“’ Files selected for processing (2)
  • .changeset/chubby-bottles-lick.md (1 hunks)
  • crates/biome_graphql_analyze/src/lint/nursery/use_description_style.rs (1 hunks)
🧰 Additional context used
πŸ““ Path-based instructions (5)
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**

πŸ“„ CodeRabbit inference engine (CLAUDE.md)

Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}

Files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_description_style.rs
crates/biome_*/**

πŸ“„ CodeRabbit inference engine (CLAUDE.md)

Place core crates under /crates/biome_*/

Files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_description_style.rs
**/*.{rs,toml}

πŸ“„ CodeRabbit inference engine (CONTRIBUTING.md)

Before committing, format Rust and TOML files (e.g., via just f/just format)

Files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_description_style.rs
**/*.rs

πŸ“„ CodeRabbit inference engine (CONTRIBUTING.md)

Document rules, assists, and options via inline rustdoc in Rust source

Files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_description_style.rs
.changeset/**/*.md

πŸ“„ CodeRabbit inference engine (CONTRIBUTING.md)

.changeset/**/*.md: Create changesets using the just new-changeset command; do not author them manually
In changeset markdown, only use headers #### or #####
Changeset descriptions must end every sentence with a full stop (.)
For bug fixes, start the changeset description with a linked issue reference like β€œFixed #1234”
Prefer past tense for what was done and present tense for current behavior in changesets

Files:

  • .changeset/chubby-bottles-lick.md
🧠 Learnings (4)
πŸ“š Learning: 2025-10-02T12:57:33.209Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:57:33.209Z
Learning: Applies to crates/biome_analyze/crates/**/src/**/lint/**/*.rs : Document rules in the declare_lint_rule! doc comment with a one-line first paragraph, followed by sections including ## Examples, ### Invalid (first) and ### Valid, and optional ## Options

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_description_style.rs
πŸ“š Learning: 2025-10-02T12:57:33.209Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:57:33.209Z
Learning: Applies to crates/biome_analyze/crates/**/src/**/lint/**/*.rs : When deprecating a rule, add deprecated: "<reason>" in declare_lint_rule! with an explanatory message

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_description_style.rs
πŸ“š Learning: 2025-10-02T12:57:33.209Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:57:33.209Z
Learning: Applies to crates/biome_analyze/crates/**/src/**/lint/**/*.rs : In documentation code blocks: specify a language; mark invalid examples with expect_diagnostic (exactly one diagnostic per snippet); valid examples must parse with no diagnostics; order modifiers consistently; use options/full_options/use_options where applicable

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_description_style.rs
πŸ“š Learning: 2025-10-02T12:55:57.541Z
Learnt from: CR
PR: biomejs/biome#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:55:57.541Z
Learning: Applies to .changeset/**/*.md : Changeset descriptions must end every sentence with a full stop (.)

Applied to files:

  • .changeset/chubby-bottles-lick.md
🧬 Code graph analysis (1)
crates/biome_graphql_analyze/src/lint/nursery/use_description_style.rs (2)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (2)
  • Style (8582-8582)
  • UseDescriptionStyleOptions (8216-8218)
crates/biome_analyze/src/rule.rs (3)
  • sources (576-579)
  • same (244-249)
  • recommended (561-564)
⏰ 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). (12)
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Documentation
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Check Dependencies
  • GitHub Check: Test Node.js API
  • GitHub Check: Check JS Files
  • GitHub Check: Bench (biome_graphql_formatter)
  • GitHub Check: Bench (biome_graphql_parser)
  • GitHub Check: autofix
  • GitHub Check: Bench (biome_configuration)
πŸ”‡ Additional comments (5)
.changeset/chubby-bottles-lick.md (1)

1-25: LGTM!

The changeset follows all coding guidelines:

  • Uses correct header level (#####)
  • Description ends with a full stop
  • Uses "descriptions" terminology (not "comments")
  • Past tense for what was added
  • Valid/invalid examples are clear
crates/biome_graphql_analyze/src/lint/nursery/use_description_style.rs (4)

1-7: Imports look good.

All necessary dependencies are imported cleanly.


34-40: Rule metadata is correct.

The metadata properly declares this as a nursery rule aligned with ESLint GraphQL's description-style rule.


49-64: Run method logic is sound.

Both Block and Inline style enforcement are correctly implemented. The method properly returns a signal when the description style doesn't match the configured option.


66-82: Diagnostic message is clear and helpful.

The diagnostic correctly highlights the unexpected style and provides a note indicating the expected style.

Comment on lines +32 to +33
/// ```
///
Copy link
Member

Choose a reason for hiding this comment

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

The docs must describe the options, explain the defaults and show a failing example with the options that isn't the default

@Netail Netail changed the title feat(biome_graphql_analyze): implement useDescriptionStyle feat(biome_graphql_analyze): implement useConsistentGraphqlDescriptions Oct 3, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

πŸ“œ Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 9107c7b and afe9897.

β›” Files ignored due to path filters (5)
  • crates/biome_configuration/src/analyzer/linter/rules.rs is excluded by !**/rules.rs and included by **
  • crates/biome_diagnostics_categories/src/categories.rs is excluded by !**/categories.rs and included by **
  • crates/biome_graphql_analyze/src/lint/nursery.rs is excluded by !**/nursery.rs and included by **
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts is excluded by !**/backend-jsonrpc/src/workspace.ts and included by **
  • packages/@biomejs/biome/configuration_schema.json is excluded by !**/configuration_schema.json and included by **
πŸ“’ Files selected for processing (4)
  • .changeset/chubby-bottles-lick.md (1 hunks)
  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs (1 hunks)
  • crates/biome_rule_options/src/lib.rs (1 hunks)
  • crates/biome_rule_options/src/use_consistent_graphql_descriptions.rs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/biome_rule_options/src/lib.rs
🧰 Additional context used
πŸ““ Path-based instructions (5)
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**

πŸ“„ CodeRabbit inference engine (CLAUDE.md)

Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}

Files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
crates/biome_*/**

πŸ“„ CodeRabbit inference engine (CLAUDE.md)

Place core crates under /crates/biome_*/

Files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
  • crates/biome_rule_options/src/use_consistent_graphql_descriptions.rs
**/*.{rs,toml}

πŸ“„ CodeRabbit inference engine (CONTRIBUTING.md)

Before committing, format Rust and TOML files (e.g., via just f/just format)

Files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
  • crates/biome_rule_options/src/use_consistent_graphql_descriptions.rs
**/*.rs

πŸ“„ CodeRabbit inference engine (CONTRIBUTING.md)

Document rules, assists, and options via inline rustdoc in Rust source

Files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
  • crates/biome_rule_options/src/use_consistent_graphql_descriptions.rs
.changeset/**/*.md

πŸ“„ CodeRabbit inference engine (CONTRIBUTING.md)

.changeset/**/*.md: Create changesets using the just new-changeset command; do not author them manually
In changeset markdown, only use headers #### or #####
Changeset descriptions must end every sentence with a full stop (.)
For bug fixes, start the changeset description with a linked issue reference like β€œFixed #1234”
Prefer past tense for what was done and present tense for current behavior in changesets

Files:

  • .changeset/chubby-bottles-lick.md
🧠 Learnings (2)
πŸ“š Learning: 2025-10-02T12:55:57.541Z
Learnt from: CR
PR: biomejs/biome#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:55:57.541Z
Learning: Applies to .changeset/**/*.md : Changeset descriptions must end every sentence with a full stop (.)

Applied to files:

  • .changeset/chubby-bottles-lick.md
πŸ“š Learning: 2025-10-02T12:57:33.209Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:57:33.209Z
Learning: Applies to crates/biome_analyze/crates/biome_rule_options/lib/*.rs : Define per-rule options in biome_rule_options/lib/<rule>.rs with a dedicated options struct/enum (camelCase serde names, deny_unknown_fields, default) and derive Serialize/Deserialize/Deserializable (and schemars JsonSchema when schema feature is on)

Applied to files:

  • crates/biome_rule_options/src/use_consistent_graphql_descriptions.rs
🧬 Code graph analysis (2)
crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs (2)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (2)
  • Style (8584-8584)
  • UseConsistentGraphqlDescriptionsOptions (8213-8218)
crates/biome_analyze/src/rule.rs (2)
  • sources (576-579)
  • same (244-249)
crates/biome_rule_options/src/use_consistent_graphql_descriptions.rs (2)
crates/biome_configuration/src/analyzer/linter/rules.rs (2)
  • from_str (56-68)
  • from_str (1186-1555)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (2)
  • UseConsistentGraphqlDescriptionsOptions (8213-8218)
  • Style (8584-8584)
πŸ”‡ Additional comments (6)
crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs (2)

83-98: LGTM!

Both Block and Inline style violations are correctly detected.


100-116: LGTM!

Diagnostic message construction is clear and correct.

crates/biome_rule_options/src/use_consistent_graphql_descriptions.rs (4)

6-12: LGTM!

Struct derives, serde attributes, and docstrings align with project conventions.


14-23: LGTM!

Enum derives, serde attributes, and docstrings are correct.


25-35: LGTM!

FromStr implementation is correct.


37-44: LGTM!

Display implementation mirrors FromStr correctly.

@Netail Netail force-pushed the feat/use-description-style branch from afe9897 to adffd9d Compare October 3, 2025 22:57
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 (2)
crates/biome_rule_options/src/use_consistent_graphql_descriptions.rs (2)

10-10: Minor grammar fix.

Change "Default to" to "Defaults to" for correct verb tense.

Apply this diff:

-    /// The description style to enforce. Default to "block"
+    /// The description style to enforce. Defaults to "block"

25-35: Consider a more helpful error message.

The current error message is generic. Users would benefit from knowing the valid options.

Apply this diff:

-            _ => Err("Value not supported for description style"),
+            _ => Err("Value not supported for description style, expected 'block' or 'inline'"),
πŸ“œ Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between afe9897 and adffd9d.

β›” Files ignored due to path filters (5)
  • crates/biome_configuration/src/analyzer/linter/rules.rs is excluded by !**/rules.rs and included by **
  • crates/biome_diagnostics_categories/src/categories.rs is excluded by !**/categories.rs and included by **
  • crates/biome_graphql_analyze/src/lint/nursery.rs is excluded by !**/nursery.rs and included by **
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts is excluded by !**/backend-jsonrpc/src/workspace.ts and included by **
  • packages/@biomejs/biome/configuration_schema.json is excluded by !**/configuration_schema.json and included by **
πŸ“’ Files selected for processing (4)
  • .changeset/chubby-bottles-lick.md (1 hunks)
  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs (1 hunks)
  • crates/biome_rule_options/src/lib.rs (1 hunks)
  • crates/biome_rule_options/src/use_consistent_graphql_descriptions.rs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/biome_rule_options/src/lib.rs
🧰 Additional context used
πŸ““ Path-based instructions (5)
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**

πŸ“„ CodeRabbit inference engine (CLAUDE.md)

Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}

Files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
crates/biome_*/**

πŸ“„ CodeRabbit inference engine (CLAUDE.md)

Place core crates under /crates/biome_*/

Files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
  • crates/biome_rule_options/src/use_consistent_graphql_descriptions.rs
**/*.{rs,toml}

πŸ“„ CodeRabbit inference engine (CONTRIBUTING.md)

Before committing, format Rust and TOML files (e.g., via just f/just format)

Files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
  • crates/biome_rule_options/src/use_consistent_graphql_descriptions.rs
**/*.rs

πŸ“„ CodeRabbit inference engine (CONTRIBUTING.md)

Document rules, assists, and options via inline rustdoc in Rust source

Files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
  • crates/biome_rule_options/src/use_consistent_graphql_descriptions.rs
.changeset/**/*.md

πŸ“„ CodeRabbit inference engine (CONTRIBUTING.md)

.changeset/**/*.md: Create changesets using the just new-changeset command; do not author them manually
In changeset markdown, only use headers #### or #####
Changeset descriptions must end every sentence with a full stop (.)
For bug fixes, start the changeset description with a linked issue reference like β€œFixed #1234”
Prefer past tense for what was done and present tense for current behavior in changesets

Files:

  • .changeset/chubby-bottles-lick.md
🧠 Learnings (7)
πŸ“š Learning: 2025-10-02T12:57:33.209Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:57:33.209Z
Learning: Applies to crates/biome_analyze/crates/**/src/**/lint/**/*.rs : In declare_lint_rule! blocks, set version: "next" for all rules

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
πŸ“š Learning: 2025-10-02T12:57:33.209Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:57:33.209Z
Learning: Applies to crates/biome_analyze/crates/**/src/**/lint/**/*.rs : Document rules in the declare_lint_rule! doc comment with a one-line first paragraph, followed by sections including ## Examples, ### Invalid (first) and ### Valid, and optional ## Options

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
πŸ“š Learning: 2025-10-02T12:57:33.209Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:57:33.209Z
Learning: Applies to crates/biome_analyze/crates/**/src/**/lint/**/*.rs : When deprecating a rule, add deprecated: "<reason>" in declare_lint_rule! with an explanatory message

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
πŸ“š Learning: 2025-10-02T12:57:33.209Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:57:33.209Z
Learning: Applies to crates/biome_analyze/crates/biome_js_analyze/lib/src/lint/nursery/*.rs : Place all new JavaScript lint rules in the nursery group under biome_js_analyze/lib/src/lint/nursery/<rule_name>.rs

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
πŸ“š Learning: 2025-10-02T12:57:33.209Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:57:33.209Z
Learning: Applies to crates/biome_analyze/crates/**/src/**/lint/**/*.rs : In documentation code blocks: specify a language; mark invalid examples with expect_diagnostic (exactly one diagnostic per snippet); valid examples must parse with no diagnostics; order modifiers consistently; use options/full_options/use_options where applicable

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
πŸ“š Learning: 2025-10-02T12:57:33.209Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:57:33.209Z
Learning: Applies to crates/biome_analyze/crates/biome_rule_options/lib/*.rs : Define per-rule options in biome_rule_options/lib/<rule>.rs with a dedicated options struct/enum (camelCase serde names, deny_unknown_fields, default) and derive Serialize/Deserialize/Deserializable (and schemars JsonSchema when schema feature is on)

Applied to files:

  • crates/biome_rule_options/src/use_consistent_graphql_descriptions.rs
πŸ“š Learning: 2025-10-02T12:55:57.541Z
Learnt from: CR
PR: biomejs/biome#0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:55:57.541Z
Learning: Applies to .changeset/**/*.md : Changeset descriptions must end every sentence with a full stop (.)

Applied to files:

  • .changeset/chubby-bottles-lick.md
🧬 Code graph analysis (2)
crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs (2)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (2)
  • Style (8584-8584)
  • UseConsistentGraphqlDescriptionsOptions (8213-8218)
crates/biome_analyze/src/rule.rs (3)
  • sources (576-579)
  • same (244-249)
  • recommended (561-564)
crates/biome_rule_options/src/use_consistent_graphql_descriptions.rs (1)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (2)
  • UseConsistentGraphqlDescriptionsOptions (8213-8218)
  • Style (8584-8584)
πŸ”‡ Additional comments (7)
crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs (4)

1-10: LGTM!

Imports are clean and appropriate for the rule implementation.


11-75: LGTM!

The rule documentation is thorough and well-structured:

  • One-line summary followed by clear Examples and Options sections.
  • Both style: "block" and style: "inline" configurations are demonstrated with Invalid and Valid examples.
  • Annotations (expect_diagnostic) are correctly placed on Invalid examples only.
  • Metadata is complete with version: "next" and sources referencing ESLint GraphQL's description-style.

83-98: LGTM!

The run method correctly enforces both style configurations:

  • Flags inline descriptions when style: "block" is set.
  • Flags block descriptions when style: "inline" is set.

100-116: LGTM!

The diagnostic message clearly indicates the unexpected style and the expected style, making it easy for users to understand and fix the violation.

crates/biome_rule_options/src/use_consistent_graphql_descriptions.rs (3)

1-4: LGTM!

Imports are minimal and appropriate.


14-23: LGTM!

The Style enum is well-documented with clear docstrings for each variant, correctly sets Block as the default, and uses appropriate derives for configuration usage.


37-44: LGTM!

The Display implementation is clean and correctly integrates with biome_console::fmt::Formatter.

@Netail Netail force-pushed the feat/use-description-style branch from adffd9d to c19a003 Compare October 3, 2025 23:04
Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

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

Documentation must be updated to follow the advised format. Same for diagnostics, it misses a pillar

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

♻️ Duplicate comments (1)
crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs (1)

12-12: Enhance the rule description to explain the rationale.

Whilst the description states what the rule does, it doesn't explain why (consistency, readability). Per Biome's rule pillars, clarify the benefit to users.

Consider revising to something like:

-    /// Require all descriptions to follow the same style (either block or inline)
+    /// Require all descriptions to follow the same style (either block or inline).
+    ///
+    /// Consistent description formatting improves readability and makes GraphQL schemas easier to maintain.

Based on maintainer feedback.

πŸ“œ Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between c3672ee and 3cc9177.

πŸ“’ Files selected for processing (1)
  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs (1 hunks)
🧰 Additional context used
πŸ““ Path-based instructions (4)
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**

πŸ“„ CodeRabbit inference engine (CLAUDE.md)

Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}

Files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
crates/biome_*/**

πŸ“„ CodeRabbit inference engine (CLAUDE.md)

Place core crates under /crates/biome_*/

Files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
**/*.{rs,toml}

πŸ“„ CodeRabbit inference engine (CONTRIBUTING.md)

Before committing, format Rust and TOML files (e.g., via just f/just format)

Files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
**/*.rs

πŸ“„ CodeRabbit inference engine (CONTRIBUTING.md)

Document rules, assists, and options via inline rustdoc in Rust source

Files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
🧠 Learnings (5)
πŸ““ Common learnings
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:57:33.209Z
Learning: Applies to crates/biome_analyze/crates/biome_rule_options/lib/*.rs : Define per-rule options in biome_rule_options/lib/<rule>.rs with a dedicated options struct/enum (camelCase serde names, deny_unknown_fields, default) and derive Serialize/Deserialize/Deserializable (and schemars JsonSchema when schema feature is on)
πŸ“š Learning: 2025-10-02T12:57:33.209Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:57:33.209Z
Learning: Applies to crates/biome_analyze/crates/**/src/**/lint/**/*.rs : When deprecating a rule, add deprecated: "<reason>" in declare_lint_rule! with an explanatory message

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
πŸ“š Learning: 2025-10-02T12:57:33.209Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:57:33.209Z
Learning: Applies to crates/biome_analyze/crates/**/src/**/lint/**/*.rs : Document rules in the declare_lint_rule! doc comment with a one-line first paragraph, followed by sections including ## Examples, ### Invalid (first) and ### Valid, and optional ## Options

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
πŸ“š Learning: 2025-10-02T12:57:33.209Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:57:33.209Z
Learning: Applies to crates/biome_analyze/crates/**/src/**/lint/**/*.rs : In declare_lint_rule! blocks, set version: "next" for all rules

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
πŸ“š Learning: 2025-10-02T12:57:33.209Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:57:33.209Z
Learning: Applies to crates/biome_analyze/crates/**/src/**/lint/**/*.rs : In documentation code blocks: specify a language; mark invalid examples with expect_diagnostic (exactly one diagnostic per snippet); valid examples must parse with no diagnostics; order modifiers consistently; use options/full_options/use_options where applicable

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
🧬 Code graph analysis (1)
crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs (2)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (2)
  • Style (8640-8640)
  • UseConsistentGraphqlDescriptionsOptions (8264-8269)
crates/biome_analyze/src/rule.rs (1)
  • same (244-249)
⏰ 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). (12)
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Documentation
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Check Dependencies
  • GitHub Check: Bench (biome_graphql_formatter)
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Bench (biome_graphql_parser)
  • GitHub Check: Bench (biome_configuration)
  • GitHub Check: autofix
  • GitHub Check: Test Node.js API
  • GitHub Check: Check JS Files
πŸ”‡ Additional comments (2)
crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs (2)

78-93: LGTM! Both style configurations are now enforced correctly.

The logic properly handles both Block and Inline styles, signalling violations when descriptions don't match the configured style.


95-112: LGTM! Diagnostic message clearly indicates the violation.

The message correctly shows the unexpected style (opposite of configured) and the note guides users to the expected style.

Comment on lines 38 to 61
/// ## Options
///
/// ### `style`
///
/// This option will specify the description style.
/// - `"block"`: Requires triple-quoted block descriptions (`"""..."""`)
/// - `"inline"`: Requires single-quoted inline descriptions (`"..."`)
///
/// Default `"block"`
///
/// ```json,options
/// {
/// "options": {
/// "style": "block"
/// }
/// }
/// ```
///
/// ```graphql,expect_diagnostic,use_options
/// enum EnumValue {
/// "this is a description"
/// DEFAULT
/// }
/// ```
Copy link
Contributor

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion | 🟠 Major

Add examples demonstrating the non-default option value.

The maintainer requested "a failing example with the options that isn't the default." Whilst lines 48-61 show the default "block" configuration, there are no examples demonstrating style: "inline". Adding a subsection for ### style: inline with corresponding Invalid/Valid examples would make the documentation more complete.

Consider adding after line 61:

+    ///
+    /// ### style: `inline`
+    ///
+    /// #### Invalid
+    ///
+    /// ```json,options
+    /// {
+    ///   "options": {
+    ///     "style": "inline"
+    ///   }
+    /// }
+    /// ```
+    ///
+    /// ```graphql,expect_diagnostic,use_options
+    /// enum EnumValue {
+    ///   """
+    ///   this is a description
+    ///   """
+    ///   DEFAULT
+    /// }
+    /// ```
+    ///
+    /// #### Valid
+    ///
+    /// ```graphql,use_options
+    /// enum EnumValue {
+    ///   "this is a description"
+    ///   DEFAULT
+    /// }
+    /// ```

Based on maintainer feedback.

πŸ€– Prompt for AI Agents
In
crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
around lines 38 to 61, the docs show only the default "block" style and lack
examples for the non-default "inline" option; add a new subsection after line 61
titled something like "### style: inline" that includes the JSON options block
setting "style": "inline", an Invalid (expect_diagnostic) GraphQL example that
uses block triple-quoted descriptions (to show the failing case), and a Valid
GraphQL example that uses inline quoted descriptions (to show the passing case),
mirroring the structure/formatting used for the "block" examples so the test
harness picks up the options and diagnostics correctly.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 (1)
crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs (1)

12-12: Enhance the rule description with a rationale.

The description states what the rule does but doesn't explain why enforcing consistent description styles benefits the codebase (e.g., improved readability, easier maintenance, team consistency).

Consider expanding to something like:

-    /// Require all descriptions to follow the same style (either block or inline)
+    /// Require all descriptions to follow the same style (either block or inline).
+    ///
+    /// Consistent description formatting improves readability and makes GraphQL schemas easier to maintain.

Based on maintainer feedback.

πŸ“œ Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 3cc9177 and 8cd7afe.

πŸ“’ Files selected for processing (1)
  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs (1 hunks)
🧰 Additional context used
πŸ““ Path-based instructions (4)
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**

πŸ“„ CodeRabbit inference engine (CLAUDE.md)

Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}

Files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
crates/biome_*/**

πŸ“„ CodeRabbit inference engine (CLAUDE.md)

Place core crates under /crates/biome_*/

Files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
**/*.{rs,toml}

πŸ“„ CodeRabbit inference engine (CONTRIBUTING.md)

Before committing, format Rust and TOML files (e.g., via just f/just format)

Files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
**/*.rs

πŸ“„ CodeRabbit inference engine (CONTRIBUTING.md)

Document rules, assists, and options via inline rustdoc in Rust source

Files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
🧠 Learnings (5)
πŸ““ Common learnings
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:57:33.228Z
Learning: Applies to crates/biome_analyze/crates/**/src/**/lint/**/*.rs : Document rules in the declare_lint_rule! doc comment with a one-line first paragraph, followed by sections including ## Examples, ### Invalid (first) and ### Valid, and optional ## Options
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:57:33.228Z
Learning: Applies to crates/biome_analyze/crates/biome_rule_options/lib/*.rs : Define per-rule options in biome_rule_options/lib/<rule>.rs with a dedicated options struct/enum (camelCase serde names, deny_unknown_fields, default) and derive Serialize/Deserialize/Deserializable (and schemars JsonSchema when schema feature is on)
πŸ“š Learning: 2025-10-02T12:57:33.228Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:57:33.228Z
Learning: Applies to crates/biome_analyze/crates/**/src/**/lint/**/*.rs : When deprecating a rule, add deprecated: "<reason>" in declare_lint_rule! with an explanatory message

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
πŸ“š Learning: 2025-10-02T12:57:33.228Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:57:33.228Z
Learning: Applies to crates/biome_analyze/crates/**/src/**/lint/**/*.rs : In declare_lint_rule! blocks, set version: "next" for all rules

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
πŸ“š Learning: 2025-10-02T12:57:33.228Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:57:33.228Z
Learning: Applies to crates/biome_analyze/crates/**/src/**/lint/**/*.rs : Document rules in the declare_lint_rule! doc comment with a one-line first paragraph, followed by sections including ## Examples, ### Invalid (first) and ### Valid, and optional ## Options

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
πŸ“š Learning: 2025-10-02T12:57:33.228Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:57:33.228Z
Learning: Applies to crates/biome_analyze/crates/**/src/**/lint/**/*.rs : In documentation code blocks: specify a language; mark invalid examples with expect_diagnostic (exactly one diagnostic per snippet); valid examples must parse with no diagnostics; order modifiers consistently; use options/full_options/use_options where applicable

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
🧬 Code graph analysis (1)
crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs (2)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (2)
  • Style (8640-8640)
  • UseConsistentGraphqlDescriptionsOptions (8264-8269)
crates/biome_analyze/src/rule.rs (1)
  • same (244-249)
⏰ 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). (12)
  • GitHub Check: Check JS Files
  • GitHub Check: autofix
  • GitHub Check: Bench (biome_graphql_parser)
  • GitHub Check: Test Node.js API
  • GitHub Check: Bench (biome_graphql_formatter)
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Documentation
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Check Dependencies
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Bench (biome_configuration)
πŸ”‡ Additional comments (2)
crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs (2)

80-95: Well done on the fix!

Both style checks are now correctly implemented. The logic properly handles violations for both Block and Inline configurations.


97-113: LGTM!

The diagnostic message clearly identifies the unexpected style and guides users towards the expected one.

@Netail Netail force-pushed the feat/use-description-style branch from 8cd7afe to 42e5a2a Compare October 9, 2025 22:53
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

♻️ Duplicate comments (1)
crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs (1)

12-12: Add rationale explaining why consistency matters.

The rule description states what it does but not why. Per maintainer feedback, include the "second pillar" explaining benefits like consistency, readability, and maintainability.

Based on maintainer feedback.

Consider:

-    /// Require all descriptions to follow the same style (either block or inline)
+    /// Require all descriptions to follow the same style (either block or inline).
+    ///
+    /// Consistent description formatting improves codebase readability and reduces cognitive load when reviewing GraphQL schemas. Mixing block and inline styles within a project can make the schema harder to scan and maintain.
πŸ“œ Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 8cd7afe and 42e5a2a.

πŸ“’ Files selected for processing (1)
  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs (1 hunks)
🧰 Additional context used
πŸ““ Path-based instructions (4)
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**

πŸ“„ CodeRabbit inference engine (CLAUDE.md)

Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}

Files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
crates/biome_*/**

πŸ“„ CodeRabbit inference engine (CLAUDE.md)

Place core crates under /crates/biome_*/

Files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
**/*.{rs,toml}

πŸ“„ CodeRabbit inference engine (CONTRIBUTING.md)

Before committing, format Rust and TOML files (e.g., via just f/just format)

Files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
**/*.rs

πŸ“„ CodeRabbit inference engine (CONTRIBUTING.md)

Document rules, assists, and options via inline rustdoc in Rust source

Files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
🧠 Learnings (3)
πŸ“š Learning: 2025-10-02T12:57:33.228Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:57:33.228Z
Learning: Applies to crates/biome_analyze/crates/**/src/**/lint/**/*.rs : In declare_lint_rule! blocks, set version: "next" for all rules

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
πŸ“š Learning: 2025-10-02T12:57:33.228Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:57:33.228Z
Learning: Applies to crates/biome_analyze/crates/**/src/**/lint/**/*.rs : In documentation code blocks: specify a language; mark invalid examples with expect_diagnostic (exactly one diagnostic per snippet); valid examples must parse with no diagnostics; order modifiers consistently; use options/full_options/use_options where applicable

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
πŸ“š Learning: 2025-10-02T12:57:33.228Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:57:33.228Z
Learning: Applies to crates/biome_analyze/crates/**/src/**/lint/**/*.rs : Document rules in the declare_lint_rule! doc comment with a one-line first paragraph, followed by sections including ## Examples, ### Invalid (first) and ### Valid, and optional ## Options

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
⏰ 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). (13)
  • GitHub Check: Test Node.js API
  • GitHub Check: Documentation
  • GitHub Check: End-to-end tests
  • 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: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Check Dependencies
  • GitHub Check: Check JS Files
  • GitHub Check: autofix
  • GitHub Check: Bench (biome_graphql_parser)
  • GitHub Check: Bench (biome_graphql_formatter)
  • GitHub Check: Bench (biome_configuration)
πŸ”‡ Additional comments (2)
crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs (2)

80-95: LGTM!

Both style checks (Block and Inline) are correctly implemented. The logic properly signals violations when descriptions don't match the configured style.


97-113: LGTM!

The diagnostic message correctly inverts the style to indicate which style was found (unexpected), and the note clearly states the expected style. Well done.

@Netail Netail force-pushed the feat/use-description-style branch from 9970f59 to adebefe Compare October 23, 2025 23:42
@Netail Netail marked this pull request as draft November 3, 2025 18:42
@Netail Netail marked this pull request as ready for review November 4, 2025 08:51
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

♻️ Duplicate comments (1)
crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs (1)

56-63: Add the missing Valid example for the inline style option.

The Options section demonstrates the failing case when style: "inline" is configured but lacks the corresponding passing example. This was mentioned in previous reviews as fixed, but it's missing from the current code.

Add after line 63:

+    ///
+    /// #### Valid
+    ///
+    /// ```graphql,use_options
+    /// enum EnumValue {
+    ///   "this is a description"
+    ///   DEFAULT
+    /// }
+    /// ```

Based on maintainer feedback.

πŸ“œ Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between aa7abe9 and 7929050.

πŸ“’ Files selected for processing (1)
  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs (1 hunks)
🧰 Additional context used
🧠 Learnings (7)
πŸ“š Learning: 2025-10-15T09:21:24.116Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:21:24.116Z
Learning: A diagnostic must explain why something went wrong, using log advices and links to documentation when helpful

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
πŸ“š Learning: 2025-10-15T09:21:24.116Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:21:24.116Z
Learning: `#[derive(Diagnostic)]` is supported on enums; each variant must contain a type that is itself a diagnostic

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
πŸ“š Learning: 2025-10-15T09:21:24.116Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:21:24.116Z
Learning: Prefer implementing the Diagnostic trait via `#[derive(Diagnostic)]`

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
πŸ“š Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/tests/specs/**/options.json : Use options.json files colocated with test inputs to override formatting options for all files in that folder

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
πŸ“š Learning: 2025-08-05T14:43:29.581Z
Learnt from: dyc3
Repo: biomejs/biome PR: 7081
File: packages/@biomejs/biome/configuration_schema.json:7765-7781
Timestamp: 2025-08-05T14:43:29.581Z
Learning: The file `packages/biomejs/biome/configuration_schema.json` is auto-generated and should not be manually edited or reviewed for schema issues; any changes should be made at the code generation source.

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
πŸ“š Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/**/*.rs : After generation, remove usages of `format_verbatim_node` and implement real formatting with biome_formatter utilities

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
πŸ“š Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:46.002Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Implement the `Format` trait for your node type and use `JsFormatter` with `write!`/`format_args!` to define formatting

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
🧬 Code graph analysis (1)
crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs (2)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (2)
  • Style (8783-8783)
  • UseConsistentGraphqlDescriptionsOptions (8391-8396)
crates/biome_analyze/src/rule.rs (1)
  • same (246-251)
⏰ 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: 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: Bench (biome_configuration)
  • GitHub Check: Check JS Files
  • GitHub Check: Test Node.js API
  • GitHub Check: Bench (biome_graphql_formatter)
  • GitHub Check: Bench (biome_graphql_parser)
  • GitHub Check: autofix
πŸ”‡ Additional comments (2)
crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs (2)

1-9: LGTM!

Imports are appropriate for the rule implementation.


74-114: Implementation logic looks correct.

The run method properly checks both Block and Inline style violations, and the diagnostic method provides clear messaging about what was found and what is expected.

@Netail Netail requested review from Conaclos and ematipico November 4, 2025 10:10
Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

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

Happy to merge it. Please check the coderrabit bot feedback just in case, I think it added something around docs

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 7929050 and c14d38f.

β›” Files ignored due to path filters (2)
  • crates/biome_configuration/src/analyzer/linter/rules.rs is excluded by !**/rules.rs and included by **
  • crates/biome_diagnostics_categories/src/categories.rs is excluded by !**/categories.rs and included by **
πŸ“’ Files selected for processing (1)
  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs (1 hunks)
🧰 Additional context used
🧠 Learnings (7)
πŸ“š Learning: 2025-10-15T09:21:24.116Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:21:24.116Z
Learning: A diagnostic must explain why something went wrong, using log advices and links to documentation when helpful

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
πŸ“š Learning: 2025-10-15T09:21:24.116Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:21:24.116Z
Learning: `#[derive(Diagnostic)]` is supported on enums; each variant must contain a type that is itself a diagnostic

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
πŸ“š Learning: 2025-10-15T09:21:24.116Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:21:24.116Z
Learning: Prefer implementing the Diagnostic trait via `#[derive(Diagnostic)]`

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
πŸ“š Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/tests/specs/**/options.json : Use options.json files colocated with test inputs to override formatting options for all files in that folder

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
πŸ“š Learning: 2025-08-05T14:43:29.581Z
Learnt from: dyc3
Repo: biomejs/biome PR: 7081
File: packages/@biomejs/biome/configuration_schema.json:7765-7781
Timestamp: 2025-08-05T14:43:29.581Z
Learning: The file `packages/biomejs/biome/configuration_schema.json` is auto-generated and should not be manually edited or reviewed for schema issues; any changes should be made at the code generation source.

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
πŸ“š Learning: 2025-10-15T09:22:15.851Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:15.851Z
Learning: Applies to crates/biome_formatter/src/**/*.rs : After generation, remove usages of `format_verbatim_node` and implement real formatting with biome_formatter utilities

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
πŸ“š Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:46.002Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Implement the `Format` trait for your node type and use `JsFormatter` with `write!`/`format_args!` to define formatting

Applied to files:

  • crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs
🧬 Code graph analysis (1)
crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs (1)
crates/biome_analyze/src/rule.rs (2)
  • same (246-251)
  • span (1477-1479)
⏰ 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). (14)
  • GitHub Check: Test Node.js API
  • GitHub Check: Validate rules documentation
  • GitHub Check: Documentation
  • GitHub Check: End-to-end tests
  • GitHub Check: Bench (biome_graphql_formatter)
  • GitHub Check: Bench (biome_graphql_parser)
  • 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-ubuntu-24.04-arm-16)
  • GitHub Check: autofix
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Bench (biome_configuration)
  • GitHub Check: Check JS Files
πŸ”‡ Additional comments (3)
crates/biome_graphql_analyze/src/lint/nursery/use_consistent_graphql_descriptions.rs (3)

1-9: LGTM!

Imports are clean and appropriate for the rule implementation.


80-95: LGTM!

The logic correctly handles both Block and Inline style configurations. Well done addressing the previous critical issue.


97-113: LGTM!

The diagnostic messages are clear and correctly convey both the violation (unexpected style) and the remedy (write in configured style).

@Netail Netail merged commit f1d5725 into biomejs:main Nov 11, 2025
19 checks passed
@Netail Netail deleted the feat/use-description-style branch November 11, 2025 16:03
@github-actions github-actions bot mentioned this pull request Nov 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Diagnostic Area: diagnostocis A-Linter Area: linter A-Project Area: project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants