Skip to content

fix(cli): skip with domains should not report#9623

Merged
ematipico merged 1 commit intomainfrom
fix/domain-fix
Mar 25, 2026
Merged

fix(cli): skip with domains should not report#9623
ematipico merged 1 commit intomainfrom
fix/domain-fix

Conversation

@ematipico
Copy link
Copy Markdown
Member

Summary

Closes #9258

Test Plan

Added a test, with AI

Docs

N/A

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 25, 2026

🦋 Changeset detected

Latest commit: c29aa86

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

@ematipico ematipico requested review from a team March 25, 2026 17:13
@github-actions github-actions bot added A-CLI Area: CLI A-Project Area: project labels Mar 25, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 25, 2026

Walkthrough

This patch resolves an issue where using --skip to exclude specific rules or domains would cause suppression comments targeting those skipped items to be incorrectly flagged as suppressions/unused. The fix modifies the suppression comment handling logic in ProcessLint to recognise when domains or rules are being skipped, ensuring suppression directives remain valid. A regression test validates that skipping a domain no longer produces spurious unused suppression warnings.

Suggested labels

A-CLI, A-Linter, A-Project

Suggested reviewers

  • dyc3
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix(cli): skip with domains should not report' directly describes the main bug fix addressing the issue where --skip with domains incorrectly reports suppressions/unused warnings.
Description check ✅ Passed The description links to issue #9258 and outlines the fix with a test plan, adequately explaining the changeset's purpose and approach.
Linked Issues check ✅ Passed The PR changes directly address issue #9258 by modifying ProcessLint::new to treat skip conditions like only/non-targeted lint, preventing suppressions/unused warnings when domains are skipped.
Out of Scope Changes check ✅ Passed All changes—the changeset entry, regression test, and core logic fix—are scoped to addressing the --skip with domains issue and contain no extraneous modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/domain-fix

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

Copy link
Copy Markdown
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.

🧹 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 --only selectors, 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-warnings would 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

📥 Commits

Reviewing files that changed from the base of the PR and between f3a6a6b and c29aa86.

⛔ Files ignored due to path filters (1)
  • crates/biome_cli/tests/snapshots/main_cases_linter_domains/skip_domain_does_not_report_unused_suppression.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (3)
  • .changeset/violet-lions-travel.md
  • crates/biome_cli/tests/cases/linter_domains.rs
  • crates/biome_service/src/file_handlers/mod.rs

@ematipico ematipico merged commit 13b3261 into main Mar 25, 2026
13 checks passed
@ematipico ematipico deleted the fix/domain-fix branch March 25, 2026 18:36
@github-actions github-actions bot mentioned this pull request Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CLI Area: CLI A-Project Area: project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--skip=project triggers suppressions/unused for project-rule suppressions

2 participants