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

Skip to content

Conversation

ematipico
Copy link
Member

Summary

Improved message of noDuplicateTestHooks

Test Plan

Updated snapshot test

Docs

N/A

@changeset-bot
Copy link

changeset-bot bot commented Oct 14, 2025

🦋 Changeset detected

Latest commit: 898f0b4

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-Linter Area: linter L-JavaScript Language: JavaScript and super languages labels Oct 14, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 14, 2025

Walkthrough

Updates diagnostic text for the Suspicious/no_duplicate_test_hooks lint in crates/biome_js_analyze to reference the specific hook name and to change the note to warn that repeated hooks can cause unexpected errors and should be removed. Adds a changeset entry patching @biomejs/biome describing the improved diagnostic message. No behavioural code changes or exported/public API changes.

Suggested reviewers

  • dyc3
  • siketyan

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 succinctly indicates that the diagnostic message for the noDuplicateTestHooks rule is being fixed, matching the primary change in the pull request.
Description Check ✅ Passed The description directly references the improved noDuplicateTestHooks message and outlines the updated test plan, so it is clearly related to the changeset.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/improve-message-rule

📜 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 6b28add and 898f0b4.

⛔ Files ignored due to path filters (4)
  • crates/biome_cli/tests/snapshots/main_cases_linter_domains/does_enable_test_rules.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_linter_domains/does_enable_test_rules_when_recommended_rules_are_disabled_but_domain_is_enabled.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_cases_rules_via_dependencies/enables_test_globals_via_dependencies.snap is excluded by !**/*.snap and included by **
  • crates/biome_js_analyze/tests/specs/suspicious/noDuplicateTestHooks/invalid.js.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (2)
  • .changeset/witty-tools-love.md (1 hunks)
  • crates/biome_js_analyze/src/lint/suspicious/no_duplicate_test_hooks.rs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • crates/biome_js_analyze/src/lint/suspicious/no_duplicate_test_hooks.rs
  • .changeset/witty-tools-love.md
⏰ 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). (11)
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Check Dependencies
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Documentation
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Test Node.js API
  • GitHub Check: autofix
  • GitHub Check: Bench (biome_js_parser)
  • GitHub Check: Bench (biome_js_analyze)
  • GitHub Check: Bench (biome_js_formatter)

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: 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 b622425 and 8d4306e.

⛔ Files ignored due to path filters (1)
  • crates/biome_js_analyze/tests/specs/suspicious/noDuplicateTestHooks/invalid.js.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (2)
  • .changeset/witty-tools-love.md (1 hunks)
  • crates/biome_js_analyze/src/lint/suspicious/no_duplicate_test_hooks.rs (1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
.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/witty-tools-love.md
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**

📄 CodeRabbit inference engine (CLAUDE.md)

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

Files:

  • crates/biome_js_analyze/src/lint/suspicious/no_duplicate_test_hooks.rs
crates/biome_*/**

📄 CodeRabbit inference engine (CLAUDE.md)

Place core crates under /crates/biome_*/

Files:

  • crates/biome_js_analyze/src/lint/suspicious/no_duplicate_test_hooks.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_js_analyze/src/lint/suspicious/no_duplicate_test_hooks.rs
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

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

Files:

  • crates/biome_js_analyze/src/lint/suspicious/no_duplicate_test_hooks.rs
🧬 Code graph analysis (1)
crates/biome_js_analyze/src/lint/suspicious/no_duplicate_test_hooks.rs (1)
crates/biome_service/src/workspace.rs (1)
  • markup (1130-1132)
⏰ 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). (11)
  • GitHub Check: Test Node.js API
  • GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Documentation
  • GitHub Check: Test (depot-ubuntu-24.04-arm-16)
  • GitHub Check: Test (depot-windows-2022-16)
  • GitHub Check: Lint project (depot-windows-2022)
  • GitHub Check: Check Dependencies
  • GitHub Check: Bench (biome_js_formatter)
  • GitHub Check: Bench (biome_js_parser)
  • GitHub Check: Bench (biome_js_analyze)
  • GitHub Check: autofix
🔇 Additional comments (2)
.changeset/witty-tools-love.md (1)

1-5: Changeset looks good.

The format is correct, the description is clear, and it follows the guidelines (past tense, ends with full stop). Just ensure this was created using just new-changeset as per the coding guidelines.

As per coding guidelines.

crates/biome_js_analyze/src/lint/suspicious/no_duplicate_test_hooks.rs (1)

231-231: Clearer diagnostic message.

The new message "Detected multiple test hooks." is more direct and actionable than the previous version. Good improvement.

@ematipico ematipico force-pushed the fix/improve-message-rule branch from 8d4306e to 6b28add Compare October 14, 2025 14:56
@ematipico ematipico requested review from a team October 14, 2025 14:56
@codspeed-hq
Copy link

codspeed-hq bot commented Oct 14, 2025

CodSpeed Performance Report

Merging #7756 will not alter performance

Comparing fix/improve-message-rule (898f0b4) with main (2db73ae)1

Summary

✅ 53 untouched
⏩ 85 skipped2

Footnotes

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

  2. 85 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.

invalid.js:4:2 lint/suspicious/noDuplicateTestHooks ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
× Disallow duplicate setup and teardown hooks.
× The test hook beforeEach is used multiple times in the same test block.
Copy link
Contributor

Choose a reason for hiding this comment

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

funny saw the word hook and first reaction was to associate with react. :-)

@ematipico ematipico force-pushed the fix/improve-message-rule branch from 6b28add to 898f0b4 Compare October 16, 2025 07:54
@github-actions github-actions bot added the A-CLI Area: CLI label Oct 16, 2025
@ematipico ematipico merged commit d665c97 into main Oct 16, 2025
17 checks passed
@ematipico ematipico deleted the fix/improve-message-rule branch October 16, 2025 16:30
@github-actions github-actions bot mentioned this pull request Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CLI Area: CLI A-Linter Area: linter L-JavaScript Language: JavaScript and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants