fix(cli): skip with domains should not report#9623
Conversation
🦋 Changeset detectedLatest commit: c29aa86 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughThis patch resolves an issue where using Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
crates/biome_service/src/file_handlers/mod.rs (1)
644-645: Tweak the comment wording to match the condition.The code checks for any
--onlyselectors, not just a single rule; a tiny wording update would avoid future head-scratching.✏️ Suggested comment tweak
- // - if a single rule is run, or + // - if one or more `--only` selectors are provided, or🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@crates/biome_service/src/file_handlers/mod.rs` around lines 644 - 645, Update the comment that currently says "if a single rule is run" to accurately reflect the condition being checked (any --only selectors). Locate the comment adjacent to the logic that inspects the "--only" selectors and reword it to say something like "if any --only selectors are provided" or "if one or more --only selectors are present" so it matches the actual check for the --only flag.crates/biome_cli/tests/cases/linter_domains.rs (1)
489-493: Consider asserting the warning-promotion path explicitly.This regression is great; adding
--error-on-warningswould pin the exact failure mode from the issue and make the test even harder to regress.🧪 Tighten the CLI invocation
- Args::from(["check", "--skip=test", test1.as_str()].as_slice()), + Args::from( + ["check", "--skip=test", "--error-on-warnings", test1.as_str()].as_slice(), + ),🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@crates/biome_cli/tests/cases/linter_domains.rs` around lines 489 - 493, The test currently invokes Args::from([... "check", "--skip=test", test1.as_str() ...]) and only asserts result.is_ok(); add an explicit assertion for the warning-promotion path by invoking the CLI a second time with the "--error-on-warnings" flag (e.g., Args::from(["check", "--error-on-warnings", "--skip=test", test1.as_str()].as_slice())) and assert that this run returns an Err (or otherwise fails) to pin the exact failure mode; reference the existing Args::from call and the run_cli result/assertion when adding the new invocation and expectation.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@crates/biome_cli/tests/cases/linter_domains.rs`:
- Around line 489-493: The test currently invokes Args::from([... "check",
"--skip=test", test1.as_str() ...]) and only asserts result.is_ok(); add an
explicit assertion for the warning-promotion path by invoking the CLI a second
time with the "--error-on-warnings" flag (e.g., Args::from(["check",
"--error-on-warnings", "--skip=test", test1.as_str()].as_slice())) and assert
that this run returns an Err (or otherwise fails) to pin the exact failure mode;
reference the existing Args::from call and the run_cli result/assertion when
adding the new invocation and expectation.
In `@crates/biome_service/src/file_handlers/mod.rs`:
- Around line 644-645: Update the comment that currently says "if a single rule
is run" to accurately reflect the condition being checked (any --only
selectors). Locate the comment adjacent to the logic that inspects the "--only"
selectors and reword it to say something like "if any --only selectors are
provided" or "if one or more --only selectors are present" so it matches the
actual check for the --only flag.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: c6d8987c-23a0-45b3-9598-7628ea4def92
⛔ Files ignored due to path filters (1)
crates/biome_cli/tests/snapshots/main_cases_linter_domains/skip_domain_does_not_report_unused_suppression.snapis excluded by!**/*.snapand included by**
📒 Files selected for processing (3)
.changeset/violet-lions-travel.mdcrates/biome_cli/tests/cases/linter_domains.rscrates/biome_service/src/file_handlers/mod.rs
Summary
Closes #9258
Test Plan
Added a test, with AI
Docs
N/A