-
-
Notifications
You must be signed in to change notification settings - Fork 795
fix(cli): allow --stdin-file-path outside files.includes #8508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 785732c 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 |
ematipico
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good idea! I didn't think about it! I believe it's fine to ship it as a patch, however we must update the docs and document this behaviour.
| pub features: FeatureName, | ||
|
|
||
| #[serde(default, skip_serializing_if = "is_false")] | ||
| pub ignore_includes: bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling it ignore_includes is a bit reductive, because we also check VCS-ignored files. I suggest a more generic a more generic name e.g. skip_ignore_check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think of this suggestion @tt-a1i ?
.changeset/warm-houses-switch.md
Outdated
| "@biomejs/biome": patch | ||
| --- | ||
|
|
||
| Fixed [#6783](https://github.com/biomejs/biome/issues/6783): stdin formatting using `--stdin-file-path` is no longer blocked by `files.includes` when the provided path doesn't exist on disk. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Fixed [#6783](https://github.com/biomejs/biome/issues/6783): stdin formatting using `--stdin-file-path` is no longer blocked by `files.includes` when the provided path doesn't exist on disk. | |
| Fixed [#6783](https://github.com/biomejs/biome/issues/6783): now, when a path is provided via `--stdin-file-path`, Biome checks whether the file exists within the current project. If the path doesn't exist, ignore checks - `files.includes` and VCS-ignore files - are skipped, and the file is handled. |
What do you think of this suggestion? I think it is a bit clearer for our end users. Feel free to change it, but the idea is that we need to mention VCS too, and making the phrase generic towards stdin, not formatting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tt-a1i what do you think of this suggestion?
|
Good call — I’ve added a note to the
Pushed in If you’d prefer this documented somewhere else as well (e.g. the website docs), happy to follow up. |
|
I still think we shouldn't mention |
|
Yep, that’s fair — mentioning I reworded the help text to be more generic (talks about ignore behaviour / project file set, and explicitly calls out VCS ignore files as an example), without singling out Pushed in |
|
FYI: I fixed the CI failures from the previous run:
New CI run is in progress. |
WalkthroughAdds a boolean flag Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
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. Comment |
There was a problem hiding this 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
♻️ Duplicate comments (2)
.changeset/warm-houses-switch.md (1)
5-5: Consider the suggested rewording from the previous review.The past review comment suggests a clearer phrasing that mentions both
files.includesand VCS-ignore files, which better reflects the actual behaviour of the fix.crates/biome_service/src/workspace.rs (1)
124-125: Consider the naming suggestion from the previous review.The past review comment suggests
skip_ignore_checkas a more generic name, since the flag affects bothfiles.includesand VCS ignore files. If that discussion is still open, the alternative name might be clearer.
🧹 Nitpick comments (2)
crates/biome_lsp/src/handlers/analysis.rs (1)
75-82: LSP analysis correctly opts into include filtering; consider a tiny helper laterUsing
ignore_includes: falsein bothcode_actionsandfix_allkeeps code‑action discovery and fix‑all aligned with the configured project file set and matches previous behaviour. If you find yourself touching these again, a small helper for constructingSupportsFeatureParamsfor LSP documents might trim a bit of repetition, but it’s strictly sugar.Also applies to: 309-320
crates/biome_service/src/projects.rs (1)
18-26: Add rustdoc for the public struct and its fields.This struct is now part of the public API. A brief doc comment explaining its purpose would help consumers, and the
ignore_includesfield in particular deserves a note on when it should betrue(e.g. virtual stdin paths that don't exist on disk).Suggested documentation
+/// Parameters for querying which features are supported for a given file. pub struct GetFileFeaturesParams<'a> { + /// The file system used for path existence checks. pub fs: &'a dyn FileSystem, + /// Key identifying the project containing the file. pub project_key: ProjectKey, + /// Path to the file being queried. pub path: &'a Utf8Path, + /// The set of features to check support for. pub features: FeatureName, + /// The detected or declared language of the file. pub language: DocumentFileSource, + /// Capabilities of the file handler for this language. pub capabilities: &'a Capabilities, + /// When `true`, bypasses `files.includes` filtering (useful for virtual + /// paths such as stdin content that may not exist on disk). VCS ignores + /// and per-feature ignores still apply. pub ignore_includes: bool, }As per coding guidelines, rustdoc should be updated when adding new features in Rust crates.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (5)
crates/biome_cli/tests/snapshots/main_commands_check/check_help.snapis excluded by!**/*.snapand included by**crates/biome_cli/tests/snapshots/main_commands_format/format_help.snapis excluded by!**/*.snapand included by**crates/biome_cli/tests/snapshots/main_commands_format/format_stdin_formats_virtual_path_outside_includes.snapis excluded by!**/*.snapand included by**crates/biome_cli/tests/snapshots/main_commands_lint/lint_help.snapis excluded by!**/*.snapand included by**packages/@biomejs/backend-jsonrpc/src/workspace.tsis excluded by!**/backend-jsonrpc/src/workspace.tsand included by**
📒 Files selected for processing (14)
.changeset/warm-houses-switch.md(1 hunks)crates/biome_cli/src/commands/mod.rs(3 hunks)crates/biome_cli/src/execute/process_file.rs(1 hunks)crates/biome_cli/src/execute/std_in.rs(2 hunks)crates/biome_cli/src/execute/traverse.rs(1 hunks)crates/biome_cli/tests/commands/format.rs(2 hunks)crates/biome_cli/tests/configs.rs(1 hunks)crates/biome_formatter_test/src/spec.rs(1 hunks)crates/biome_lsp/src/handlers/analysis.rs(2 hunks)crates/biome_lsp/src/handlers/formatting.rs(3 hunks)crates/biome_lsp/src/session.rs(1 hunks)crates/biome_service/src/projects.rs(3 hunks)crates/biome_service/src/workspace.rs(1 hunks)crates/biome_service/src/workspace/server.rs(2 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
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_cli/tests/configs.rscrates/biome_cli/src/execute/process_file.rscrates/biome_service/src/workspace.rscrates/biome_formatter_test/src/spec.rscrates/biome_lsp/src/handlers/formatting.rscrates/biome_cli/src/execute/traverse.rscrates/biome_lsp/src/handlers/analysis.rscrates/biome_service/src/workspace/server.rscrates/biome_service/src/projects.rscrates/biome_lsp/src/session.rscrates/biome_cli/src/commands/mod.rscrates/biome_cli/tests/commands/format.rscrates/biome_cli/src/execute/std_in.rs
crates/biome_service/src/workspace*.rs
📄 CodeRabbit inference engine (crates/biome_service/CONTRIBUTING.md)
Implement the Workspace trait in the Biome Service to manage internal state of projects, including open documents, project layout instances, and module graph instances
Files:
crates/biome_service/src/workspace.rs
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
.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/warm-houses-switch.md
🧠 Learnings (41)
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/Cargo.toml : Include development dependencies in `Cargo.toml` for formatter tests: `biome_formatter_test`, `biome_<language>_factory`, `biome_<language>_parser`, `biome_parser`, `biome_service`, `countme`, `iai`, `quickcheck`, `quickcheck_macros`, and `tests_macros`
Applied to files:
crates/biome_cli/tests/configs.rscrates/biome_service/src/workspace.rscrates/biome_formatter_test/src/spec.rscrates/biome_cli/src/execute/traverse.rscrates/biome_cli/tests/commands/format.rscrates/biome_cli/src/execute/std_in.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 : Use `full_options` code block property for complete biome.json configuration snippets in documentation
Applied to files:
crates/biome_cli/tests/configs.rscrates/biome_cli/src/execute/process_file.rscrates/biome_formatter_test/src/spec.rscrates/biome_lsp/src/handlers/formatting.rscrates/biome_cli/src/execute/traverse.rscrates/biome_service/src/workspace/server.rscrates/biome_service/src/projects.rscrates/biome_lsp/src/session.rscrates/biome_cli/src/commands/mod.rscrates/biome_cli/tests/commands/format.rscrates/biome_cli/src/execute/std_in.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/language_kind.rs : Add a new language prefix to the `LANGUAGE_PREFIXES` constant in `language_kind.rs` file
Applied to files:
crates/biome_cli/tests/configs.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 : Lines prefixed with `#` in rule documentation code examples will be hidden from output
Applied to files:
crates/biome_cli/tests/configs.rscrates/biome_cli/src/execute/process_file.rscrates/biome_lsp/src/handlers/formatting.rscrates/biome_cli/src/execute/traverse.rscrates/biome_cli/src/commands/mod.rscrates/biome_cli/tests/commands/format.rscrates/biome_cli/src/execute/std_in.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 : Use `options` code block property for rule-specific configuration snippets in documentation
Applied to files:
crates/biome_cli/tests/configs.rscrates/biome_lsp/src/handlers/formatting.rscrates/biome_lsp/src/session.rscrates/biome_cli/src/commands/mod.rscrates/biome_cli/tests/commands/format.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 : Use `ignore` code block property to exclude documentation code examples from automatic validation
Applied to files:
crates/biome_cli/tests/configs.rscrates/biome_cli/src/execute/process_file.rscrates/biome_service/src/workspace.rscrates/biome_formatter_test/src/spec.rscrates/biome_lsp/src/handlers/formatting.rscrates/biome_cli/src/execute/traverse.rscrates/biome_lsp/src/handlers/analysis.rscrates/biome_service/src/projects.rscrates/biome_lsp/src/session.rscrates/biome_cli/src/commands/mod.rscrates/biome_cli/src/execute/std_in.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 : Prefix line with `#` in documentation code examples sparingly; prefer concise complete snippets
Applied to files:
crates/biome_cli/tests/configs.rscrates/biome_cli/src/commands/mod.rscrates/biome_cli/tests/commands/format.rs
📚 Learning: 2025-12-04T13:29:49.287Z
Learnt from: dyc3
Repo: biomejs/biome PR: 8291
File: crates/biome_html_formatter/tests/specs/prettier/vue/html-vue/elastic-header.html:10-10
Timestamp: 2025-12-04T13:29:49.287Z
Learning: Files under `crates/biome_html_formatter/tests/specs/prettier` are test fixtures synced from Prettier and should not receive detailed code quality reviews (e.g., HTTP vs HTTPS, formatting suggestions, etc.). These files are test data meant to validate formatter behavior and should be preserved as-is.
Applied to files:
crates/biome_cli/tests/configs.rscrates/biome_formatter_test/src/spec.rscrates/biome_cli/tests/commands/format.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 : Use `file=<path>` property for multi-file rule documentation examples
Applied to files:
crates/biome_cli/tests/configs.rscrates/biome_cli/src/execute/process_file.rscrates/biome_service/src/workspace/server.rscrates/biome_service/src/projects.rscrates/biome_cli/src/commands/mod.rscrates/biome_cli/src/execute/std_in.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/src/context.rs : Define `<Language>FormatContext` struct in a `context.rs` file containing `comments` and `source_map` fields, implementing `FormatContext` and `CstFormatContext` traits
Applied to files:
crates/biome_cli/tests/configs.rscrates/biome_lsp/src/handlers/formatting.rscrates/biome_cli/tests/commands/format.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 `deny_unknown_fields` in serde derive macro for rule options
Applied to files:
crates/biome_cli/src/execute/process_file.rscrates/biome_service/src/workspace.rscrates/biome_formatter_test/src/spec.rscrates/biome_lsp/src/handlers/formatting.rscrates/biome_cli/src/execute/traverse.rscrates/biome_lsp/src/handlers/analysis.rscrates/biome_lsp/src/session.rscrates/biome_cli/src/execute/std_in.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_cli/src/execute/process_file.rscrates/biome_service/src/workspace.rscrates/biome_formatter_test/src/spec.rscrates/biome_lsp/src/handlers/formatting.rscrates/biome_cli/src/execute/traverse.rscrates/biome_cli/src/execute/std_in.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 crates/**/*.rs : Update inline rustdoc documentation for rules, assists, and their options when adding new features or changing existing features in Rust crates
Applied to files:
crates/biome_cli/src/execute/process_file.rscrates/biome_lsp/src/handlers/formatting.rscrates/biome_service/src/workspace/server.rscrates/biome_cli/src/commands/mod.rscrates/biome_cli/tests/commands/format.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 : Rule documentation code blocks should be ordered as language, expect_diagnostic, options/full_options/use_options, ignore, file
Applied to files:
crates/biome_cli/src/execute/process_file.rscrates/biome_lsp/src/session.rscrates/biome_cli/src/commands/mod.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_cli/src/execute/process_file.rscrates/biome_cli/src/execute/traverse.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_cli/src/execute/process_file.rscrates/biome_cli/src/execute/traverse.rscrates/biome_lsp/src/handlers/analysis.rscrates/biome_lsp/src/session.rscrates/biome_cli/src/execute/std_in.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*.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.rscrates/biome_formatter_test/src/spec.rscrates/biome_service/src/workspace/server.rscrates/biome_service/src/projects.rscrates/biome_lsp/src/session.rscrates/biome_cli/src/execute/std_in.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/lint/nursery/**/*.rs : Set `recommended` field to `false` for new rules in the nursery group
Applied to files:
crates/biome_service/src/workspace.rscrates/biome_lsp/src/handlers/analysis.rscrates/biome_lsp/src/session.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/*.rs : Distinguish between `TypeData::Unknown` and `TypeData::UnknownKeyword` to measure inference effectiveness versus explicit user-provided unknown types
Applied to files:
crates/biome_service/src/workspace.rscrates/biome_cli/src/execute/traverse.rscrates/biome_cli/src/execute/std_in.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_formatter_test/src/spec.rscrates/biome_service/src/workspace/server.rscrates/biome_cli/src/execute/std_in.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/tests/spec_tests.rs : Use the `tests_macros::gen_tests!` macro in `spec_tests.rs` to generate test functions for each specification file matching the pattern `tests/specs/<language>/**/*.<ext>`
Applied to files:
crates/biome_formatter_test/src/spec.rscrates/biome_cli/tests/commands/format.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/tests/language.rs : Implement `TestFormatLanguage` trait in `tests/language.rs` for the formatter's test language
Applied to files:
crates/biome_formatter_test/src/spec.rscrates/biome_cli/tests/commands/format.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_lsp/src/handlers/formatting.rscrates/biome_lsp/src/session.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/lint/nursery/**/*.rs : Add `issue_number` field to `declare_lint_rule!` macro for work-in-progress rules
Applied to files:
crates/biome_lsp/src/handlers/formatting.rscrates/biome_lsp/src/handlers/analysis.rscrates/biome_lsp/src/session.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_cli/src/execute/traverse.rscrates/biome_lsp/src/handlers/analysis.rscrates/biome_service/src/workspace/server.rscrates/biome_service/src/projects.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 : Implement `action` function in Rule trait to provide code actions
Applied to files:
crates/biome_lsp/src/handlers/analysis.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 : Specify `fix_kind: FixKind::Safe` in `declare_lint_rule!` for safe code actions
Applied to files:
crates/biome_lsp/src/handlers/analysis.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 : Specify `fix_kind: FixKind::Unsafe` in `declare_lint_rule!` for unsafe code actions
Applied to files:
crates/biome_lsp/src/handlers/analysis.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 rule severity to `info` for code action rules in analyzer
Applied to files:
crates/biome_lsp/src/handlers/analysis.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/warm-houses-switch.md
📚 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: Create a changeset for user-facing bug fixes and features using `just new-changeset`, selecting appropriate packages and change type (`major`, `minor`, or `patch`)
Applied to files:
.changeset/warm-houses-switch.md
📚 Learning: 2025-09-25T12:32:59.003Z
Learnt from: arendjr
Repo: biomejs/biome PR: 7593
File: crates/biome_service/src/workspace/server.rs:1306-1306
Timestamp: 2025-09-25T12:32:59.003Z
Learning: In the biomejs/biome project, do not flag compilation errors during code review as they are handled by the existing test infrastructure and CI. Focus on other code quality aspects instead.
Applied to files:
.changeset/warm-houses-switch.md
📚 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 : Rule documentation must include `## Options` section if the rule has options
Applied to files:
crates/biome_cli/src/commands/mod.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 : The first paragraph of rule documentation must be a single line describing what the rule does
Applied to files:
crates/biome_cli/src/commands/mod.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Import the `FormatNode` trait and implement it for your Node when creating formatters in biome_js_formatter
Applied to files:
crates/biome_cli/tests/commands/format.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/src/lib.rs : Expose a public `format_node` function that accepts formatting options and a root syntax node, returning a `FormatResult<Formatted<Context>>` with appropriate documentation
Applied to files:
crates/biome_cli/tests/commands/format.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/tests/specs/**/*.jsonc : Use `.jsonc` files to contain arrays of code snippet strings for snapshot tests
Applied to files:
crates/biome_cli/tests/commands/format.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 : Use `use_options` code block property for code examples that follow an options configuration in documentation
Applied to files:
crates/biome_cli/tests/commands/format.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Use the `dbg_write!` macro to debug formatter output instead of other logging methods
Applied to files:
crates/biome_cli/tests/commands/format.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Create specification test files in `tests/specs/<language>/` directories with one or more test files; use `cargo insta accept` or `cargo insta review` to accept/reject snapshots
Applied to files:
crates/biome_cli/tests/commands/format.rs
📚 Learning: 2025-11-24T18:05:42.356Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:42.356Z
Learning: Applies to crates/biome_js_type_info/**/local_inference.rs : Implement local inference in dedicated modules to derive type definitions from expressions without context of surrounding scopes
Applied to files:
crates/biome_cli/src/execute/std_in.rs
🧬 Code graph analysis (1)
crates/biome_cli/src/execute/std_in.rs (1)
crates/biome_service/src/workspace/server.rs (2)
file_features(1173-1196)new(119-141)
🔇 Additional comments (18)
crates/biome_cli/src/execute/process_file.rs (1)
139-139: LGTM!Correctly passes
ignore_includes: falsefor regular file processing, ensuring thatfiles.includesrules apply as expected.crates/biome_formatter_test/src/spec.rs (1)
73-73: LGTM!Correctly passes
ignore_includes: falsefor formatter test specs, maintaining normal include/exclude behaviour in tests.crates/biome_cli/src/commands/mod.rs (3)
184-188: LGTM!The documentation clearly explains the behaviour for virtual paths with
--stdin-file-path, noting both the relaxed includes requirement and the continuing applicability of ignore rules.
295-299: LGTM!Consistent documentation across the lint command.
358-362: LGTM!Consistent documentation across the format command.
crates/biome_cli/tests/configs.rs (1)
36-47: LGTM!New test configuration constant to support exercising stdin formatting with
files.includesrules.crates/biome_service/src/workspace.rs (1)
112-114: LGTM!Helper function for serde serialisation.
crates/biome_lsp/src/handlers/formatting.rs (3)
41-41: LGTM!Correctly passes
ignore_includes: falsefor LSP formatting, maintaining normal include/exclude behaviour.
111-111: LGTM!Consistent with the format function.
204-204: LGTM!Consistent across all LSP formatting operations.
crates/biome_cli/src/execute/std_in.rs (3)
41-41: LGTM!Clever logic: virtual paths (non-existent on disk) set
ignore_includes: trueto bypassfiles.includesfiltering, whilst real paths respect the normal rules.
50-50: LGTM!Correctly threads the computed flag through to the formatter feature query.
132-132: LGTM!Correctly threads the flag through to the lint/check feature query.
crates/biome_lsp/src/session.rs (1)
419-426: Explicitignore_includeshere correctly preserves LSP diagnostic behaviourWiring
ignore_includes: falsethroughSupportsFeatureParamskeeps diagnostics subject to the configured file set while adapting to the new API. No issues spotted.crates/biome_cli/src/execute/traverse.rs (1)
575-580: Correct default forignore_includesduring filesystem traversalPassing
ignore_includes: falsehere matches the existing traversal semantics: real files are still filtered by the configured include set, while the new flag is available for stdin/virtual paths elsewhere. Looks good.crates/biome_cli/tests/commands/format.rs (1)
2-4: New stdin regression test nicely captures the virtual‑path caseImporting
CONFIG_FILES_INCLUDES_EXCLUDES_STDIN_PATHand the newformat_stdin_formats_virtual_path_outside_includestest together give solid coverage for the bug this PR fixes: stdin formatting with a non‑existent path that wouldn’t match the include set. The test structure mirrors the existing stdin tests and looks spot‑on.Also applies to: 1213-1254
crates/biome_service/src/workspace/server.rs (1)
13-13: Cleanfile_featuresrefactor with correctignore_includesthreadingThe switch to
GetFileFeaturesParamsis tidy: you passfs,project_key,path,features,language,capabilities, and cruciallyignore_includes: params.ignore_includes, so all existing behaviour is preserved and the new flag is available to callers that care (e.g. stdin/virtual paths). The added import matches the new usage. Nicely wired.Also applies to: 1187-1195
crates/biome_service/src/projects.rs (1)
248-282: LGTM — logic correctly distinguishes virtual vs. real paths.The branching on
ignore_includesneatly separates behaviour:
- Virtual paths (
ignore_includes: true): only VCS ignores apply.- Real paths (
ignore_includes: false): fullfiles.includes+ VCS check viais_ignored_by_top_level_config.Per-feature ignores are evaluated afterwards regardless, preserving feature-specific overrides. Nicely done.
|
done — renamed to |
There was a problem hiding this 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/projects.rs (1)
18-26: Add rustdoc comments to the new public struct.The
GetFileFeaturesParamsstruct is public and consolidates several parameters. Consider adding rustdoc comments, particularly forskip_ignore_checkto explain when it should betrue(e.g., for virtual stdin paths not on disk).📝 Example documentation
+/// Parameters for querying file features. +/// +/// This struct consolidates all parameters needed to determine which features +/// (formatting, linting, etc.) are supported for a given file path. pub struct GetFileFeaturesParams<'a> { pub fs: &'a dyn FileSystem, pub project_key: ProjectKey, pub path: &'a Utf8Path, pub features: FeatureName, pub language: DocumentFileSource, pub capabilities: &'a Capabilities, + /// When `true`, skips `files.includes` and ancestor checks, but still respects + /// VCS ignores. Used for virtual paths (e.g., `--stdin-file-path`) that don't + /// exist on disk. pub skip_ignore_check: bool, }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
packages/@biomejs/backend-jsonrpc/src/workspace.tsis excluded by!**/backend-jsonrpc/src/workspace.tsand included by**
📒 Files selected for processing (11)
.changeset/warm-houses-switch.mdcrates/biome_cli/src/execute/process_file.rscrates/biome_cli/src/execute/std_in.rscrates/biome_cli/src/execute/traverse.rscrates/biome_formatter_test/src/spec.rscrates/biome_lsp/src/handlers/analysis.rscrates/biome_lsp/src/handlers/formatting.rscrates/biome_lsp/src/session.rscrates/biome_service/src/projects.rscrates/biome_service/src/workspace.rscrates/biome_service/src/workspace/server.rs
🚧 Files skipped from review as they are similar to previous changes (8)
- crates/biome_cli/src/execute/process_file.rs
- crates/biome_formatter_test/src/spec.rs
- crates/biome_cli/src/execute/std_in.rs
- crates/biome_cli/src/execute/traverse.rs
- .changeset/warm-houses-switch.md
- crates/biome_lsp/src/handlers/analysis.rs
- crates/biome_service/src/workspace.rs
- crates/biome_service/src/workspace/server.rs
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rs
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.rs: Use inline rustdoc documentation for rules, assists, and their options
Use thedbg!()macro for debugging output in Rust tests and code
Use doc tests (doctest) format with code blocks in rustdoc comments; ensure assertions pass in tests
Files:
crates/biome_lsp/src/session.rscrates/biome_lsp/src/handlers/formatting.rscrates/biome_service/src/projects.rs
🧠 Learnings (21)
📚 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_lsp/src/session.rscrates/biome_service/src/projects.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 : Use `ignore` code block property to exclude documentation code examples from automatic validation
Applied to files:
crates/biome_lsp/src/session.rscrates/biome_service/src/projects.rs
📚 Learning: 2025-11-24T18:04:57.309Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:57.309Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Fields with #[advice] or #[verbose_advice] attributes must implement the Advices trait to record advices on the diagnostic
Applied to files:
crates/biome_lsp/src/session.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_lsp/src/session.rscrates/biome_lsp/src/handlers/formatting.rs
📚 Learning: 2025-11-24T18:04:57.309Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:57.309Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Use helper types from the biome_diagnostics::v2 module (CodeFrameAdvice, CommandAdvice, DiffAdvice, LogAdvice) or implement the Advices trait yourself for custom advice handling
Applied to files:
crates/biome_lsp/src/session.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 : Use `full_options` code block property for complete biome.json configuration snippets in documentation
Applied to files:
crates/biome_lsp/src/session.rscrates/biome_service/src/projects.rs
📚 Learning: 2025-11-24T18:04:57.309Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:57.309Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Ensure the type implementing Diagnostic derives Debug
Applied to files:
crates/biome_lsp/src/session.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/lint/nursery/**/*.rs : Add `issue_number` field to `declare_lint_rule!` macro for work-in-progress rules
Applied to files:
crates/biome_lsp/src/session.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 : Valid code examples in rule documentation should not trigger any diagnostics
Applied to files:
crates/biome_lsp/src/session.rs
📚 Learning: 2025-11-24T18:04:57.309Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_diagnostics/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:04:57.309Z
Learning: Applies to crates/biome_diagnostics/**/*.rs : Implement the Diagnostic trait on types, or use the #[derive(Diagnostic)] procedural macro to implement the trait. Configure category, severity, description, message, location, and tags using the #[diagnostic] attribute
Applied to files:
crates/biome_lsp/src/session.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/src/context.rs : Define `<Language>FormatContext` struct in a `context.rs` file containing `comments` and `source_map` fields, implementing `FormatContext` and `CstFormatContext` traits
Applied to files:
crates/biome_lsp/src/handlers/formatting.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : When formatting AST nodes, use mandatory tokens from the AST instead of hardcoding token strings (e.g., use `node.l_paren_token().format()` instead of `token("(")`)
Applied to files:
crates/biome_lsp/src/handlers/formatting.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : For tokens that are not mandatory, use helper functions instead of hardcoding
Applied to files:
crates/biome_lsp/src/handlers/formatting.rs
📚 Learning: 2025-11-24T18:05:20.371Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:20.371Z
Learning: Applies to crates/biome_formatter/**/biome_*_formatter/tests/language.rs : Implement `TestFormatLanguage` trait in `tests/language.rs` for the formatter's test language
Applied to files:
crates/biome_lsp/src/handlers/formatting.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 `deny_unknown_fields` in serde derive macro for rule options
Applied to files:
crates/biome_lsp/src/handlers/formatting.rs
📚 Learning: 2025-11-24T18:06:03.545Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_parser/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:06:03.545Z
Learning: Applies to crates/biome_parser/**/src/**/*.rs : Use `ConditionalParsedSyntax` for syntax that is only valid in specific contexts (e.g., strict mode, file types, language versions) and call `or_invalid_to_bogus()` to convert to a bogus node if not supported
Applied to files:
crates/biome_lsp/src/handlers/formatting.rs
📚 Learning: 2025-11-24T18:05:27.810Z
Learnt from: CR
Repo: biomejs/biome PR: 0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-11-24T18:05:27.810Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Do not attempt to 'fix' the code; if a token/node is known to be mandatory but is missing, return `None` instead
Applied to files:
crates/biome_lsp/src/handlers/formatting.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_lsp/src/handlers/formatting.rscrates/biome_service/src/projects.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_lsp/src/handlers/formatting.rscrates/biome_service/src/projects.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 : Use `file=<path>` property for multi-file rule documentation examples
Applied to files:
crates/biome_service/src/projects.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 : Use `options` code block property for rule-specific configuration snippets in documentation
Applied to files:
crates/biome_service/src/projects.rs
🧬 Code graph analysis (1)
crates/biome_service/src/projects.rs (2)
crates/biome_service/src/workspace.rs (4)
is_ignored(327-329)is_ignored(543-545)fs(1529-1529)file_features(1453-1456)crates/biome_service/src/workspace/server.rs (4)
is_ignored(2236-2244)fs(2133-2135)fs(2221-2223)file_features(1173-1196)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
- GitHub Check: Test Node.js API
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Check Dependencies
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: End-to-end tests
- GitHub Check: Documentation
- GitHub Check: autofix
- GitHub Check: Check JS Files
🔇 Additional comments (4)
crates/biome_lsp/src/session.rs (1)
421-426: LGTM! Straightforward parameter addition.The addition of
skip_ignore_check: falsemaintains existing behaviour whilst supporting the new virtual stdin path feature.crates/biome_lsp/src/handlers/formatting.rs (1)
37-42: LGTM! Consistent parameter additions across formatting handlers.All three formatting functions correctly add
skip_ignore_check: false, ensuring LSP formatting continues to respect ignore rules whilst enabling the new CLI virtual path feature.Also applies to: 107-112, 200-205
crates/biome_service/src/projects.rs (2)
212-223: LGTM! Clean parameter consolidation.The refactored signature using
GetFileFeaturesParamsimproves maintainability. Destructuring in the parameter position is idiomatic and keeps the function body clean.
248-283: LGTM! Ignore logic correctly implements virtual path handling.The refactored ignore logic properly distinguishes between:
skip_ignore_check=true: VCS-only (for virtual stdin paths)skip_ignore_check=false: Full checks includingfiles.includesand ancestors (existing behaviour)Both paths correctly preserve feature-specific ignore checks. The nested conditional is complex but correct.
💡 Optional: Consider adding an inline comment
For future maintainers, a brief comment at line 249 could clarify the purpose:
let is_ignored = { // When skip_ignore_check is true (e.g., for --stdin-file-path with virtual paths), // skip files.includes and ancestor traversal, but still respect VCS ignores. let is_ignored_by_top_level_config = if skip_ignore_check {This is entirely optional—the code is clear from context.
Address reviewer feedback: use a more generic name since the check involves both files.includes and VCS-ignore files, not just includes. Also updated changeset wording per maintainer suggestion.
5dbf37a to
bc1ac0a
Compare
The files.includes check is skipped for non-existent stdin paths, but VCS ignore rules still apply (as documented in CLI help).
Add nursery group info message to diagnostics.
crates/biome_cli/src/commands/mod.rs
Outdated
| /// The provided path may also affect whether the input is treated as | ||
| /// ignored. If the path doesn't exist on disk (virtual path), Biome | ||
| /// won't require it to be part of the project file set, but ignore rules | ||
| /// may still apply (e.g. VCS ignore files). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| /// The provided path may also affect whether the input is treated as | |
| /// ignored. If the path doesn't exist on disk (virtual path), Biome | |
| /// won't require it to be part of the project file set, but ignore rules | |
| /// may still apply (e.g. VCS ignore files). | |
| /// If the provided path doesn't exist in the project, Biome doesn't check if | |
| /// it's ignored (VCS, `files.includes`, etc.). |
crates/biome_cli/src/commands/mod.rs
Outdated
| /// The provided path may also affect whether the input is treated as | ||
| /// ignored. If the path doesn't exist on disk (virtual path), Biome | ||
| /// won't require it to be part of the project file set, but ignore rules | ||
| /// may still apply (e.g. VCS ignore files). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| /// The provided path may also affect whether the input is treated as | |
| /// ignored. If the path doesn't exist on disk (virtual path), Biome | |
| /// won't require it to be part of the project file set, but ignore rules | |
| /// may still apply (e.g. VCS ignore files). | |
| /// If the provided path doesn't exist in the project, Biome doesn't check if | |
| /// it's ignored (VCS, `files.includes`, etc.). |
crates/biome_cli/src/commands/mod.rs
Outdated
| /// The provided path may also affect whether the input is treated as | ||
| /// ignored. If the path doesn't exist on disk (virtual path), Biome | ||
| /// won't require it to be part of the project file set, but ignore rules | ||
| /// may still apply (e.g. VCS ignore files). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| /// The provided path may also affect whether the input is treated as | |
| /// ignored. If the path doesn't exist on disk (virtual path), Biome | |
| /// won't require it to be part of the project file set, but ignore rules | |
| /// may still apply (e.g. VCS ignore files). | |
| /// If the provided path doesn't exist in the project, Biome doesn't check if | |
| /// it's ignored (VCS, `files.includes`, etc.). |
crates/biome_service/src/projects.rs
Outdated
| let is_ignored_by_top_level_config = if skip_ignore_check { | ||
| project_data | ||
| .root_settings | ||
| .vcs_settings | ||
| .is_ignored(path, Some(project_data.path.as_path())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did we change the initial proposed logic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did we change the initial proposed logic?
Right now, when --stdin-file-path points to a path that doesn’t exist on disk, we only bypass
the files.includes “file set” check — we still apply VCS ignore (and per-feature ignore) so
--stdin-file-path can’t be used to bypass ignore rules.
That’s why I didn’t take the doc suggestion as-is: “doesn’t check if it’s ignored (VCS,
includes, etc.)” would be inaccurate with the current behavior.
We changed from the initial “skip ignore entirely” idea because the goal of #6783 was “don’t
let files.includes block virtual stdin paths”, not “ignore .gitignore”.
If you’d rather have the stronger behavior (skip VCS/feature ignores too for virtual paths), I
can adjust the implementation + tests + changeset — just want to confirm the intended
semantics first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be very hard to justify to the users why we skip files.includes but we don't skip VCS ignore files. Just because a user used one way to ignore files, doesn't exclude the use of VCS ignore files. Both tools achieve the same objective - ignoring files.
So yes, we should skip both checks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be very hard to justify to the users why we skip
files.includesbut we don't skip VCS ignore files. Just because a user used one way to ignore files, doesn't exclude the use of VCS ignore files. Both tools achieve the same objective - ignoring files.So yes, we should skip both checks.
Makes sense — updated. When skip_ignore_check is true we now skip the whole ignore block (both
files.includes and VCS ignore). Also updated the CLI help text + changeset to match.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
crates/biome_service/src/projects.rs (1)
248-278: Consider extracting the per-feature ignore logic.Lines 255-260 duplicate logic from the
is_ignoredmethod (lines 201-206). Extracting this into a helper function (similar tois_ignored_by_top_level_config) would reduce duplication and make future maintenance easier.💡 Example helper function
#[inline] fn is_ignored_by_features( project_data: &ProjectData, path: &Utf8Path, features: FeatureName, ) -> bool { !features.is_empty() && features.iter().all(|feature| { project_data .root_settings .is_path_ignored_for_feature(path, feature) }) }Then use it in both
is_ignoredandget_file_features:let is_ignored_by_features = is_ignored_by_features(project_data, path, features);
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (4)
crates/biome_cli/tests/snapshots/main_commands_check/check_help.snapis excluded by!**/*.snapand included by**crates/biome_cli/tests/snapshots/main_commands_format/format_help.snapis excluded by!**/*.snapand included by**crates/biome_cli/tests/snapshots/main_commands_lint/lint_help.snapis excluded by!**/*.snapand included by**crates/biome_js_analyze/tests/specs/nursery/noUndeclaredEnvVars/invalid.js.snapis excluded by!**/*.snapand included by**
📒 Files selected for processing (3)
.changeset/warm-houses-switch.mdcrates/biome_cli/src/commands/mod.rscrates/biome_service/src/projects.rs
✅ Files skipped from review due to trivial changes (1)
- .changeset/warm-houses-switch.md
🚧 Files skipped from review as they are similar to previous changes (1)
- crates/biome_cli/src/commands/mod.rs
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rs
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.rs: Use inline rustdoc documentation for rules, assists, and their options
Use thedbg!()macro for debugging output in Rust tests and code
Use doc tests (doctest) format with code blocks in rustdoc comments; ensure assertions pass in tests
Files:
crates/biome_service/src/projects.rs
🧠 Learnings (1)
📚 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/projects.rs
🧬 Code graph analysis (1)
crates/biome_service/src/projects.rs (6)
packages/@biomejs/js-api/src/wasm.ts (1)
ProjectKey(2-2)crates/biome_service/src/workspace.rs (4)
is_ignored(327-329)is_ignored(543-545)fs(1538-1538)file_features(1462-1465)crates/biome_service/src/workspace/server.rs (4)
is_ignored(2285-2293)fs(2182-2184)fs(2270-2272)file_features(1220-1243)crates/biome_service/src/settings.rs (2)
is_ignored(769-774)is_ignored(852-889)crates/biome_service/src/scanner/workspace_bridges.rs (6)
is_ignored(27-33)is_ignored(120-125)is_ignored(224-236)fs(15-15)fs(107-107)fs(200-202)crates/biome_service/src/workspace/client.rs (2)
fs(210-212)file_features(138-143)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
- GitHub Check: Check JS Files
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Check Dependencies
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Documentation
- GitHub Check: autofix
- GitHub Check: Test Node.js API
🔇 Additional comments (1)
crates/biome_service/src/projects.rs (1)
212-222: Nice refactoring to a parameter struct.The destructuring in the function signature is idiomatic and makes the API more maintainable.
| pub struct GetFileFeaturesParams<'a> { | ||
| pub fs: &'a dyn FileSystem, | ||
| pub project_key: ProjectKey, | ||
| pub path: &'a Utf8Path, | ||
| pub features: FeatureName, | ||
| pub language: DocumentFileSource, | ||
| pub capabilities: &'a Capabilities, | ||
| pub skip_ignore_check: bool, | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major
Add rustdoc documentation for the public struct.
GetFileFeaturesParams is part of the public API and should have documentation explaining its purpose and fields, particularly the new skip_ignore_check flag and when it should be used.
📝 Suggested documentation
+/// Parameters for retrieving file features.
+///
+/// This struct encapsulates all the information needed to determine which
+/// features are supported for a given file path.
+///
+/// # Fields
+///
+/// * `skip_ignore_check` - When `true`, bypasses all ignore checks (VCS,
+/// `files.includes`, and per-feature ignores). This is used for virtual
+/// paths provided via `--stdin-file-path` that don't exist on disk.
pub struct GetFileFeaturesParams<'a> {
pub fs: &'a dyn FileSystem,📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| pub struct GetFileFeaturesParams<'a> { | |
| pub fs: &'a dyn FileSystem, | |
| pub project_key: ProjectKey, | |
| pub path: &'a Utf8Path, | |
| pub features: FeatureName, | |
| pub language: DocumentFileSource, | |
| pub capabilities: &'a Capabilities, | |
| pub skip_ignore_check: bool, | |
| } | |
| /// Parameters for retrieving file features. | |
| /// | |
| /// This struct encapsulates all the information needed to determine which | |
| /// features are supported for a given file path. | |
| /// | |
| /// # Fields | |
| /// | |
| /// * `skip_ignore_check` - When `true`, bypasses all ignore checks (VCS, | |
| /// `files.includes`, and per-feature ignores). This is used for virtual | |
| /// paths provided via `--stdin-file-path` that don't exist on disk. | |
| pub struct GetFileFeaturesParams<'a> { | |
| pub fs: &'a dyn FileSystem, | |
| pub project_key: ProjectKey, | |
| pub path: &'a Utf8Path, | |
| pub features: FeatureName, | |
| pub language: DocumentFileSource, | |
| pub capabilities: &'a Capabilities, | |
| pub skip_ignore_check: bool, | |
| } |
🤖 Prompt for AI Agents
In crates/biome_service/src/projects.rs around lines 18 to 26, the public struct
GetFileFeaturesParams lacks rustdoc. Add a /// doc comment above the struct
describing its purpose (parameters used to compute features for a single project
file) and add /// comments for each public field explaining what it is and
expected usage; be sure to document the skip_ignore_check boolean (what ignoring
checks it bypasses, typical scenarios to set it true, and any safety or
performance implications), and keep wording concise and consistent with existing
crate docs.
Summary
Fixes #6783.
When running
biome format,biome check, orbiome lintwith--stdin-file-pathand the provided path doesn't exist on disk (i.e. it’s a virtual path),files.includesno longer causes the stdin content to be treated as ignored.This keeps the existing behavior for real files (paths that exist on disk), and still respects VCS ignores / feature-specific ignores.
Test Plan
format_stdin_formats_virtual_path_outside_includescargo test -p biome_cli --test mainAI Assistance Disclosure
This PR was written with assistance from OpenAI Codex CLI (used for review and iterative debugging).