Skip to content

fix(cli): stdin regression#9102

Merged
ematipico merged 1 commit intomainfrom
fix/stdin-regression
Feb 16, 2026
Merged

fix(cli): stdin regression#9102
ematipico merged 1 commit intomainfrom
fix/stdin-regression

Conversation

@ematipico
Copy link
Member

Summary

Closes #9095

We couldn't catch the bug because in our tests, .read always yields the same input; however, in reality, we can read only once, and then the input is consumed.

For now I kept the changes at a minum, I will follow up with a change to better simulate the real stdin

Test Plan

Manually tested

Docs

@changeset-bot
Copy link

changeset-bot bot commented Feb 16, 2026

🦋 Changeset detected

Latest commit: 09c4da0

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 the A-CLI Area: CLI label Feb 16, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 16, 2026

No actionable comments were generated in the recent review. 🎉


Walkthrough

This patch fixes a regression in stdin formatting that was introduced in a recent refactor. The changes replace stdin-based routing with file path-based routing in the CLI runner's scan kind derivation logic. The derive_best_scan_kind and get_forced_scan_kind functions now accept an optional file path reference instead of a full Stdin object, and the runner passes only the stdin file path to determine the appropriate scan kind.

Possibly related PRs

Suggested labels

A-CLI, A-Tooling, A-Project

Suggested reviewers

  • siketyan
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Merge Conflict Detection ⚠️ Warning ❌ Merge conflicts detected (10 files):

⚔️ Cargo.lock (content)
⚔️ Cargo.toml (content)
⚔️ crates/biome_cli/src/runner/mod.rs (content)
⚔️ crates/biome_cli/src/runner/scan_kind.rs (content)
⚔️ crates/biome_cli/tests/commands/format.rs (content)
⚔️ crates/biome_css_parser/Cargo.toml (content)
⚔️ crates/biome_css_syntax/Cargo.toml (content)
⚔️ crates/biome_css_syntax/src/file_source.rs (content)
⚔️ crates/biome_service/src/workspace/server.rs (content)
⚔️ crates/biome_service/src/workspace/server.tests.rs (content)

These conflicts must be resolved before merging into main.
Resolve conflicts locally and push changes to this branch.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix(cli): stdin regression' clearly and concisely describes the main change—fixing a regression in stdin handling for the CLI.
Description check ✅ Passed The description is directly related to the changeset, explaining the stdin regression bug and linking to issue #9095 that this PR closes.
Linked Issues check ✅ Passed The code changes restore correct stdin handling by switching from stdin-based routing to stdin_file_path-based routing, directly addressing issue #9095 where piped input produced no output.
Out of Scope Changes check ✅ Passed All changes are focused on fixing stdin handling in the CLI runner and scan kind logic; no unrelated modifications detected.

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

✨ 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/stdin-regression
⚔️ Resolve merge conflicts (beta)
  • Auto-commit resolved conflicts to branch fix/stdin-regression
  • Create stacked PR with resolved conflicts
  • Post resolved changes as copyable diffs in a comment

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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

@ematipico
Copy link
Member Author

Going to merge this as it's a huge regression

@ematipico ematipico merged commit d01b903 into main Feb 16, 2026
13 checks passed
@ematipico ematipico deleted the fix/stdin-regression branch February 16, 2026 15:28
@github-actions github-actions bot mentioned this pull request Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CLI Area: CLI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

📝 Formatting from stdin does no work in Biome 2.4

1 participant