Skip to content

Conversation

@Drewsz
Copy link

@Drewsz Drewsz commented Oct 22, 2025

Summary

  • Fixed #4952 by filtering --changed results to skip files that were deleted or renamed locally, preventing the internal IO error.
  • Added a regression test and snapshot for the missing-file scenario

Test Plan

  • cargo build
  • cargo test -p biome_cli

Docs

  • Not applicable; no documentation updates required.

@changeset-bot
Copy link

changeset-bot bot commented Oct 22, 2025

🦋 Changeset detected

Latest commit: a9e0358

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 Oct 22, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 22, 2025

Walkthrough

This pull request fixes issue #4952 where the --changed option was throwing an internal error when files were deleted from the working tree. The fix involves three changes: a changelog entry documenting the patch, modifications to the changed file filtering logic to check path existence before inclusion, and a new test case validating that missing changed files are handled without error.

Suggested labels

A-CLI

Suggested reviewers

  • ematipico
  • dyc3

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Title Check ✅ Passed The PR title "fix(cli): ignore missing paths from --changed" directly and clearly describes the main change in the changeset. The title is specific, concise, and avoids vague terminology or noise. It accurately conveys that the fix addresses the --changed option by filtering out missing paths, which aligns with the core modification made to the path filtering logic in crates/biome_cli/src/changed.rs.
Linked Issues Check ✅ Passed The changes directly address all coding requirements from issue #4952. The PR adds path existence validation in crates/biome_cli/src/changed.rs to filter out missing files, includes a new regression test (should_skip_missing_changed_files) in the test suite, and documents the fix in the changelog. The implementation prevents the internal IO error that occurred when --changed referenced deleted or renamed files, meeting the expected behaviour outlined in the issue.
Out of Scope Changes Check ✅ Passed All modifications in this PR are directly related to addressing issue #4952. The changelog entry documents the fix, the core logic change adds path existence checks to filter missing files, and the test case provides regression coverage. No extraneous or out-of-scope changes have been introduced; each modification serves the stated objective of preventing internal errors when files referenced by --changed no longer exist.
Description Check ✅ Passed The PR description is directly related to the changeset. It clearly references issue #4952, explains that the fix filters --changed results to skip deleted or renamed files, mentions the addition of a regression test and snapshot, and provides a test plan. The description accurately reflects what has been implemented across all three modified files.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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: 0

🧹 Nitpick comments (2)
crates/biome_cli/src/changed.rs (1)

31-49: The filtering logic correctly handles missing files.

The existence check with fallback for relative paths should work well. However, for future maintainability, consider adding a brief comment explaining why filtering is necessary (e.g., "Filter out deleted/renamed files to prevent IO errors").

crates/biome_cli/tests/commands/lint.rs (1)

2324-2346: Test validates the fix correctly, but could be clearer.

The assertion result.is_err() expects a "no matched files" error rather than an internal IO error, which the snapshot should verify. To improve clarity, consider adding a comment explaining that the error is for "no files matched" rather than an IO error, distinguishing it from the bug being fixed.

📜 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 38f8bcd and a9e0358.

⛔ Files ignored due to path filters (1)
  • crates/biome_cli/tests/snapshots/main_commands_lint/should_skip_missing_changed_files.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (3)
  • .changeset/fix-changed-missing-paths.md (1 hunks)
  • crates/biome_cli/src/changed.rs (2 hunks)
  • crates/biome_cli/tests/commands/lint.rs (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
.changeset/*.md

📄 CodeRabbit inference engine (CONTRIBUTING.md)

.changeset/*.md: In changesets, only use #### or ##### headers; other header levels are not allowed
Changesets should cover user-facing changes only; internal changes do not need changesets
Use past tense for what you did and present tense for current Biome behavior in changesets
When fixing a bug in a changeset, start with an issue link (e.g., “Fixed #1234: …”)
When referencing a rule or assist in a changeset, include a link to its page on the website
Include code blocks in changesets when applicable to illustrate changes
End every sentence in a changeset with a period

Files:

  • .changeset/fix-changed-missing-paths.md
crates/biome_*/**

📄 CodeRabbit inference engine (CLAUDE.md)

Place core crates under /crates/biome_*/

Files:

  • crates/biome_cli/tests/commands/lint.rs
  • crates/biome_cli/src/changed.rs
**/tests/**

📄 CodeRabbit inference engine (CLAUDE.md)

Place test files under a tests/ directory in each crate

Files:

  • crates/biome_cli/tests/commands/lint.rs
**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.rs: Format Rust files before committing (e.g., via just f which formats Rust)
Document rules, assists, and options with inline rustdoc in source

Files:

  • crates/biome_cli/tests/commands/lint.rs
  • crates/biome_cli/src/changed.rs
🧬 Code graph analysis (1)
crates/biome_cli/tests/commands/lint.rs (3)
crates/biome_fs/src/fs/memory.rs (1)
  • default (37-49)
crates/biome_cli/tests/main.rs (1)
  • run_cli (332-347)
crates/biome_cli/tests/snap_test.rs (1)
  • assert_cli_snapshot (407-409)
🔇 Additional comments (1)
.changeset/fix-changed-missing-paths.md (1)

1-5: LGTM!

The changeset follows all formatting guidelines and clearly documents the user-facing fix.

@Drewsz
Copy link
Author

Drewsz commented Oct 22, 2025

@coderabbitai generate docstrings

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 22, 2025

✅ Actions performed

Initiated docstring generation; will generate only if new commits exist.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 22, 2025

Note

Docstrings generation - SUCCESS
Generated docstrings for this pull request at #7818

coderabbitai bot added a commit that referenced this pull request Oct 22, 2025
Docstrings generation was requested by @Drewsz.

* #7817 (comment)

The following files were modified:

* `crates/biome_cli/src/changed.rs`
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.

🐛 --changed throws No such file or directory when file is deleted

1 participant