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

Skip to content

Conversation

Netail
Copy link
Member

@Netail Netail commented Oct 14, 2025

Summary

Woops, wrongly usage of expect_diagnostic. Use ignore instead

Test Plan

Docs

@changeset-bot
Copy link

changeset-bot bot commented Oct 14, 2025

⚠️ No Changeset found

Latest commit: 6a89e42

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 14, 2025

Walkthrough

This PR updates documentation/test directives in two lint rule files: graphql no_empty_source and json no_empty_source. In GraphQL docs, the code block annotation changes from graphql,expect_diagnostic,use_options to graphql,ignore,use_options. In JSONC docs, the invalid example changes from expecting a diagnostic to ignoring it for jsonc,use_options. There are no code, control-flow, or API changes; only doctest expectations are adjusted.

Possibly related PRs

Suggested labels

A-Linter, L-JSON

Suggested reviewers

  • ematipico

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title Check ❓ Inconclusive The title indicates a minor documentation update for the useEmptySource rule but is too vague to convey the specific change of replacing expect_diagnostic with ignore in the code examples, using the non-descriptive term “slight improvement” rather than detailing what was improved. It does not clearly summarise the main change, making it harder for reviewers to grasp the intent at a glance. A more specific title would directly describe the swap from expect_diagnostic to ignore. Please update the PR title to explicitly reference replacing expect_diagnostic with ignore in the useEmptySource examples, for example “docs(lint): replace expect_diagnostic with ignore in useEmptySource examples.”
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed The description clearly states that expect_diagnostic was replaced with ignore and directly relates to the changes in the documentation examples, accurately reflecting the content of the pull request. It is brief but on-topic and aligns with the modifications made.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent 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 b622425 and 6a89e42.

📒 Files selected for processing (2)
  • crates/biome_graphql_analyze/src/lint/nursery/no_empty_source.rs (1 hunks)
  • crates/biome_json_analyze/src/lint/nursery/no_empty_source.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/no_empty_source.rs
  • crates/biome_json_analyze/src/lint/nursery/no_empty_source.rs
crates/biome_*/**

📄 CodeRabbit inference engine (CLAUDE.md)

Place core crates under /crates/biome_*/

Files:

  • crates/biome_graphql_analyze/src/lint/nursery/no_empty_source.rs
  • crates/biome_json_analyze/src/lint/nursery/no_empty_source.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/no_empty_source.rs
  • crates/biome_json_analyze/src/lint/nursery/no_empty_source.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/no_empty_source.rs
  • crates/biome_json_analyze/src/lint/nursery/no_empty_source.rs
🧠 Learnings (4)
📚 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/no_empty_source.rs
  • crates/biome_json_analyze/src/lint/nursery/no_empty_source.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/no_empty_source.rs
📚 Learning: 2025-10-02T12:58:00.914Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-02T12:58:00.914Z
Learning: Applies to crates/biome_js_formatter/src/**/*.rs : Do not attempt to fix code: if a mandatory token/node is missing, return None

Applied to files:

  • crates/biome_json_analyze/src/lint/nursery/no_empty_source.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/biome_js_analyze/tests/quick_test.rs : Use tests/quick_test.rs for ad-hoc testing: un-ignore the test and set the rule filter (e.g., RuleFilter::Rule("nursery", "<ruleName>"))

Applied to files:

  • crates/biome_json_analyze/src/lint/nursery/no_empty_source.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). (14)
  • GitHub Check: Documentation
  • GitHub Check: Bench (biome_json_analyze)
  • GitHub Check: End-to-end tests
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Check Dependencies
  • GitHub Check: Bench (biome_json_parser)
  • GitHub Check: Bench (biome_json_formatter)
  • GitHub Check: Test Node.js API
  • GitHub Check: autofix
  • GitHub Check: Bench (biome_graphql_formatter)
  • GitHub Check: Bench (biome_graphql_parser)
🔇 Additional comments (2)
crates/biome_json_analyze/src/lint/nursery/no_empty_source.rs (1)

57-57: Correct removal of diagnostic expectation in Valid section.

Consistent with the graphql file, this change properly fixes the misuse of expect_diagnostic in what should be a valid example (comment-only file with allowComments: true).

The same verification applies: confirm whether ignore is the standard approach for valid examples with options, or if jsonc,use_options alone would be more appropriate.

Based on learnings.

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

62-62: Use ignore for comment-only valid examples. This matches the pattern in other language analyzers (e.g. JSON).


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

@github-actions github-actions bot added A-Linter Area: linter L-JSON Language: JSON and super languages labels Oct 14, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Oct 14, 2025

CodSpeed Performance Report

Merging #7757 will not alter performance

Comparing Netail:docs/slight-alignment (6a89e42) with main (b622425)

Summary

✅ 15 untouched
⏩ 120 skipped1

Footnotes

  1. 120 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.

@dyc3 dyc3 merged commit b324b5b into biomejs:main Oct 15, 2025
18 checks passed
@Netail Netail deleted the docs/slight-alignment branch October 15, 2025 07:34
ematipico pushed a commit that referenced this pull request Oct 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Linter Area: linter L-JSON Language: JSON and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants