feat(cli): output files information via biome rage by default#6886
feat(cli): output files information via biome rage by default#6886christymcgrory wants to merge 8 commits intobiomejs:mainfrom
Conversation
🦋 Changeset detectedLatest commit: d3dffb3 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 |
|
The I like the proposal, and maybe we can print the information without the |
Thanks for the feedback. Like the idea of it being default without a new flag, I'll make some changes over the weekend. |
|
@christymcgrory any updates? |
0cb4622 to
60d1b39
Compare
60d1b39 to
1527f27
Compare
WalkthroughAdds a new "Files" section to the Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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.
Actionable comments posted: 3
🧹 Nitpick comments (1)
.changeset/ripe-dryers-tell.md (1)
12-12: Tighten the changeset blurb to user-facing wording.Line 12 reads like an internal note; a polished sentence will be clearer in release notes.
Suggested wording
-adds new --files flag to the biome rage command to output an array of includes, and the ignoreUnknown option +Added a `--files` option to `biome rage` to print the resolved `files.includes` globs and `files.ignoreUnknown` setting, making merged config debugging easier in monorepos.Based on learnings: Changeset descriptions should be concise (1-3 sentences), user-facing, and use past tense for actions.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.changeset/ripe-dryers-tell.md at line 12, Rewrite the changeset blurb on line 12 to a concise, user-facing sentence (1–3 sentences) in past tense describing the change: e.g., state that the "biome rage" command added a new --files flag to output an array of includes and added an ignoreUnknown option; replace the internal wording with that polished release-note style sentence.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.changeset/ripe-dryers-tell.md:
- Around line 2-9: The changeset currently marks multiple CLI packages with
"minor" but this PR targets main and is non-breaking; update the change type
from "minor" to "patch" for the listed packages (e.g.
"@biomejs/cli-darwin-arm64", "@biomejs/cli-darwin-x64",
"@biomejs/cli-linux-arm64", "@biomejs/cli-linux-arm64-musl",
"@biomejs/cli-linux-x64", "@biomejs/cli-linux-x64-musl",
"@biomejs/cli-win32-arm64", "@biomejs/cli-win32-x64") so the release uses patch
instead of minor.
In `@crates/biome_cli/src/commands/rage.rs`:
- Around line 373-374: The displayed label "Ignore hidden" is incorrect for the
value being shown; update the KeyValuePair that renders
DisplayOption(files_configuration.ignore_unknown) so the label matches the field
(e.g., change "Ignore hidden" to "Ignore unknown" or "Ignore unknown files") in
the KeyValuePair call used in the rage output (the line using KeyValuePair and
DisplayOption with files_configuration.ignore_unknown).
- Around line 363-376: The match arm for BiomeCommand::Rage is omitting the
sixth field (the --files boolean) and not passing it into rage(), so update the
pattern in the match that constructs the Rage variant to destructure all six
fields (including files) and pass that boolean into the call to rage(files, ...)
to match the existing rage(...) signature; then add a test that invokes the Rage
command with the --files flag set (or directly calls rage(...) with files=true)
and capture a snapshot that includes the "Files" section output to validate the
new behavior. Ensure the test uses the same function names (BiomeCommand::Rage,
rage()) and asserts the snapshot contains the Files section shown in the
existing UI formatting.
---
Nitpick comments:
In @.changeset/ripe-dryers-tell.md:
- Line 12: Rewrite the changeset blurb on line 12 to a concise, user-facing
sentence (1–3 sentences) in past tense describing the change: e.g., state that
the "biome rage" command added a new --files flag to output an array of includes
and added an ignoreUnknown option; replace the internal wording with that
polished release-note style sentence.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 1ebcfef7-88ca-40ba-9e66-a5d89f0a97bd
⛔ Files ignored due to path filters (1)
crates/biome_cli/tests/snapshots/main_commands_rage/rage_help.snapis excluded by!**/*.snapand included by**
📒 Files selected for processing (5)
.changeset/ripe-dryers-tell.mdcrates/biome_cli/src/commands/mod.rscrates/biome_cli/src/commands/rage.rscrates/biome_cli/src/lib.rscrates/biome_configuration/src/lib.rs
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@crates/biome_cli/src/commands/mod.rs`:
- Around line 80-82: The BiomeCommand::Rage variant gained a new bool field
named files but the destructuring in the match arm for BiomeCommand::Rage (in
lib.rs at the match around line 68) still expects five fields; update that
pattern to include the new files identifier and ensure it is forwarded to the
Rage handling code where the other fields are passed. Specifically, adjust the
match arm that matches BiomeCommand::Rage(...) to destructure six items
including files and add the files variable into the call/site that constructs or
processes the Rage command so arity matches the updated enum variant.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 9ff07d46-7584-4a57-b0e3-e86078b56002
📒 Files selected for processing (3)
.changeset/ripe-dryers-tell.mdcrates/biome_cli/src/commands/mod.rscrates/biome_cli/src/commands/rage.rs
✅ Files skipped from review due to trivial changes (1)
- .changeset/ripe-dryers-tell.md
🚧 Files skipped from review as they are similar to previous changes (1)
- crates/biome_cli/src/commands/rage.rs
|
Hey @ematipico, I think this is ready for a review proper now -- apologies for the massive delay on responding to you! |
There was a problem hiding this comment.
♻️ Duplicate comments (1)
crates/biome_cli/src/commands/rage.rs (1)
367-378:⚠️ Potential issue | 🟠 MajorPlease add a CLI snapshot test for the new “Files” section output.
This change alters
biome rageoutput, but there’s no accompanying test update in the submitted changes. A snapshot coveringIgnore Unknown+ mergedIncludeswould lock behaviour and prevent regressions.As per coding guidelines: “All code changes MUST include appropriate tests … and bug fixes require tests that reproduce and validate the fix.”
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 8122370b-67bd-4870-bcab-aafa164df6f9
⛔ Files ignored due to path filters (5)
crates/biome_cli/tests/snapshots/main_commands_rage/with_configuration.snapis excluded by!**/*.snapand included by**crates/biome_cli/tests/snapshots/main_commands_rage/with_formatter_configuration.snapis excluded by!**/*.snapand included by**crates/biome_cli/tests/snapshots/main_commands_rage/with_jsonc_configuration.snapis excluded by!**/*.snapand included by**crates/biome_cli/tests/snapshots/main_commands_rage/with_linter_configuration.snapis excluded by!**/*.snapand included by**crates/biome_cli/tests/snapshots/main_commands_rage/with_malformed_configuration.snapis excluded by!**/*.snapand included by**
📒 Files selected for processing (2)
.changeset/chatty-meals-train.mdcrates/biome_cli/src/commands/rage.rs
✅ Files skipped from review due to trivial changes (1)
- .changeset/chatty-meals-train.md
I don't think it's ready yet, though. The aren't any tests that show any files? There's only some snapshots that show "unset", but the objective of the PR is to show proper data if the configuration has them. Also review the changeset. Our contribution guidelines should help |
Summary
This PR enables the ability to view the
includesarray from the config file, as well asignoreUnknown. The primary motivation for this was validating the ordering of glob patterns after biome resolves anextendsfield and merges with another configuration.Eventually the goal is to be able to print the merged
extendsconfiguration and output it to a file for inspection (debugging in a large monorepo can be painful).Test Plan
cargo build --bin biomeextendsscenario in a monorepo:# biome.json { "root": true, "files": { "includes": ["**"] } } # packages/test/biome.json { "root": false, "files": { "includes": ["!**/_generated_/**"] } }packages/test:biome rage --files