Skip to content

Conversation

@ruidosujeira
Copy link
Contributor

Summary

Fixes #8518

When using "extends": "//" in monorepo packages, glob patterns from the root config are now resolved relative to the project root instead of the package directory.

Before: "!packages/*/lib/**" in root config → evaluated from package dir → didn't work
After: "!packages/*/lib/**" in root config → evaluated from root dir → works correctly

AI Assistance Notice:
This PR was developed with assistance from Claude (Anthropic).

Test Plan

  1. Tested against reproduction case: https://github.com/brandonw/biome-repro-1766175331469
  2. Verified exclusion patterns now work correctly in monorepo setups
  3. Added unit tests for glob resolution with extends_root
  4. Confirmed backward compatibility with non-monorepo configs

Docs

No documentation changes needed - bug fix for existing behavior.

…rectory instead of the current package directory.
@changeset-bot
Copy link

changeset-bot bot commented Dec 19, 2025

🦋 Changeset detected

Latest commit: 4596826

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-Project Area: project label Dec 19, 2025
@ruidosujeira ruidosujeira changed the title (fix) glob patterns are now resolved relative to the project's fix: resolve glob patterns relative to project root when extending Dec 19, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 19, 2025

Walkthrough

This PR fixes glob pattern resolution in monorepo configurations when a child package extends the root config using "extends": "//". The fix replaces loading_directory with resolution_directory in the configuration merge and plugin loading logic within the update_settings function. The resolution_directory is computed based on whether extends_root is true, determining whether paths resolve relative to the project root or workspace directory. This prevents globally excluded files from being processed in child package configurations.

Possibly related PRs

Suggested labels

A-Project, A-CLI

Suggested reviewers

  • dyc3
  • chansuke
  • siketyan

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is incomplete and cuts off mid-sentence, making it vague and unclear about the specific change being made. Complete the title to clearly convey the main change, e.g. '(fix) glob patterns are now resolved relative to the project root'
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The description is directly related to the changeset, providing context about the monorepo glob resolution fix, reproduction steps, and testing approach.
Linked Issues check ✅ Passed The PR successfully addresses issue #8518 by changing glob resolution to respect project root paths when using 'extends: //' in monorepo packages.
Out of Scope Changes check ✅ Passed All changes align with the stated objective of fixing glob resolution in monorepos; no extraneous modifications detected.
✨ 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 (1)
crates/biome_service/src/workspace/server.rs (1)

1016-1021: Consider reducing allocations from cloning resolution_directory.

resolution_directory is cloned on both line 1016 and line 1019. Consider:

  • Using as_ref() where possible to avoid clones
  • On line 1019, the pattern .clone().unwrap_or_default() could potentially be simplified depending on load_plugins' signature
💡 Potential optimisation

If load_plugins accepts &Utf8Path instead of &Utf8PathBuf, you could write:

-        let plugin_diagnostics = self.load_plugins(
-            &resolution_directory.clone().unwrap_or_default(),
+        let plugin_diagnostics = self.load_plugins(
+            resolution_directory.as_ref().map(|p| p.as_path()).unwrap_or(Utf8Path::new("")),
             &settings.as_all_plugins(),
         );

And for line 1016, if merge_with_configuration can accept a reference:

-        settings.merge_with_configuration(configuration, resolution_directory.clone())?;
+        settings.merge_with_configuration(configuration, resolution_directory.as_ref())?;
📜 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 c89cfe2 and 4596826.

📒 Files selected for processing (2)
  • .changeset/fix-monorepo-glob-resolution.md (1 hunks)
  • crates/biome_service/src/workspace/server.rs (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
crates/biome_service/src/workspace/server.rs

📄 CodeRabbit inference engine (crates/biome_service/CONTRIBUTING.md)

Use WorkspaceServer implementation for maintaining workspace state in daemon mode and CLI daemonless mode

Files:

  • crates/biome_service/src/workspace/server.rs
crates/**/*.rs

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Update inline rustdoc documentation for rules, assists, and their options when adding new features or changing existing features in Rust crates

Files:

  • crates/biome_service/src/workspace/server.rs
.changeset/*.md

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Write changesets that are concise (1-3 sentences), user-focused, use past tense for actions taken and present tense for Biome behavior, include code examples for rules, and end sentences with periods

Files:

  • .changeset/fix-monorepo-glob-resolution.md
🧠 Learnings (11)
📚 Learning: 2025-11-24T18:06:12.048Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:12.048Z
Learning: Applies to crates/biome_service/src/workspace*.rs : Implement the Workspace trait in the Biome Service to manage internal state of projects, including open documents, project layout instances, and module graph instances

Applied to files:

  • crates/biome_service/src/workspace/server.rs
📚 Learning: 2025-11-24T18:06:12.048Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:12.048Z
Learning: Applies to crates/biome_service/src/workspace/watcher.tests.rs : Implement watcher tests for workspace methods in watcher.tests.rs and end-to-end tests in LSP tests

Applied to files:

  • crates/biome_service/src/workspace/server.rs
📚 Learning: 2025-12-12T10:11:05.564Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: CONTRIBUTING.md:0-0
Timestamp: 2025-12-12T10:11:05.564Z
Learning: Applies to **/Cargo.toml : Use workspace dependencies defined in root `Cargo.toml` for internal crates with `workspace = true`, and use path dependencies for `dev-dependencies` to avoid requiring published versions

Applied to files:

  • crates/biome_service/src/workspace/server.rs
📚 Learning: 2025-11-24T18:06:12.048Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_service/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:12.048Z
Learning: Applies to crates/biome_service/src/workspace/server.rs : Use WorkspaceServer implementation for maintaining workspace state in daemon mode and CLI daemonless mode

Applied to files:

  • crates/biome_service/src/workspace/server.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Assist rules should detect refactoring opportunities and emit code action signals

Applied to files:

  • crates/biome_service/src/workspace/server.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Implement `Merge` trait for rule options to support configuration inheritance

Applied to files:

  • crates/biome_service/src/workspace/server.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Wrap rule options fields in `Option<>` to properly track set and unset options during merge

Applied to files:

  • crates/biome_service/src/workspace/server.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/biome_rule_options/lib/**/*.rs : Use `rename_all = "camelCase"` in serde derive macro for rule options

Applied to files:

  • crates/biome_service/src/workspace/server.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Check if a variable is global using the semantic model to avoid false positives

Applied to files:

  • crates/biome_service/src/workspace/server.rs
📚 Learning: 2025-12-19T12:53:30.399Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_analyze/CONTRIBUTING.md:0-0
Timestamp: 2025-12-19T12:53:30.399Z
Learning: Applies to crates/biome_analyze/**/*analyze/src/**/*.rs : Set `version` field to `next` in `declare_lint_rule!` macro

Applied to files:

  • crates/biome_service/src/workspace/server.rs
📚 Learning: 2025-08-05T14:43:29.581Z
Learnt from: dyc3
Repo: biomejs/biome PR: 7081
File: packages/@biomejs/biome/configuration_schema.json:7765-7781
Timestamp: 2025-08-05T14:43:29.581Z
Learning: The file `packages/biomejs/biome/configuration_schema.json` is auto-generated and should not be manually edited or reviewed for schema issues; any changes should be made at the code generation source.

Applied to files:

  • .changeset/fix-monorepo-glob-resolution.md
🧬 Code graph analysis (1)
crates/biome_service/src/workspace/server.rs (1)
crates/biome_configuration/src/lib.rs (1)
  • extends_root (275-277)
🔇 Additional comments (2)
.changeset/fix-monorepo-glob-resolution.md (1)

1-7: LGTM!

The changeset follows all coding guidelines: concise, user-focused, uses proper tenses, and accurately describes the fix. Well done.

crates/biome_service/src/workspace/server.rs (1)

1010-1014: No issues identified. The code at lines 1010–1014 safely handles both None and Some cases: merge_with_configuration explicitly accepts Option<Utf8PathBuf>, and load_plugins uses .unwrap_or_default() to convert None to an empty path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Project Area: project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 [Monorepo] globally excluded files are still processed

1 participant