-
-
Notifications
You must be signed in to change notification settings - Fork 792
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: 0d56a71 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
| "@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.
|
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. |
WalkthroughThis PR fixes stdin formatting when using Possibly related PRs
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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.
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).