Skip to content

feat(cli): output files information via biome rage by default#6886

Open
christymcgrory wants to merge 8 commits intobiomejs:mainfrom
christymcgrory:feat/biome-rage-files-output
Open

feat(cli): output files information via biome rage by default#6886
christymcgrory wants to merge 8 commits intobiomejs:mainfrom
christymcgrory:feat/biome-rage-files-output

Conversation

@christymcgrory
Copy link
Copy Markdown

@christymcgrory christymcgrory commented Jul 14, 2025

Summary

This PR enables the ability to view the includes array from the config file, as well as ignoreUnknown. The primary motivation for this was validating the ordering of glob patterns after biome resolves an extends field and merges with another configuration.

Eventually the goal is to be able to print the merged extends configuration and output it to a file for inspection (debugging in a large monorepo can be painful).

Test Plan

  1. cargo build --bin biome
  2. Generate a minimal extends scenario in a monorepo:
# biome.json
{
	"root": true,
	"files":  {
		"includes": ["**"]
	}
}

# packages/test/biome.json
{
	"root": false,
	"files":  {
		"includes": ["!**/_generated_/**"]
	}
}
  1. Run the compiled biome binary against packages/test: biome rage --files
  2. Confirm the output is as expected.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jul 14, 2025

🦋 Changeset detected

Latest commit: d3dffb3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@biomejs/cli-darwin-arm64 Patch
@biomejs/cli-darwin-x64 Patch
@biomejs/cli-linux-arm64 Patch
@biomejs/cli-linux-arm64-musl Patch
@biomejs/cli-linux-x64 Patch
@biomejs/cli-linux-x64-musl Patch
@biomejs/cli-win32-arm64 Patch
@biomejs/cli-win32-x64 Patch
@biomejs/backend-jsonrpc Patch
@biomejs/biome Patch
@biomejs/wasm-web Patch
@biomejs/wasm-bundler Patch
@biomejs/wasm-nodejs Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot added A-CLI Area: CLI A-Project Area: project labels Jul 14, 2025
@ematipico
Copy link
Copy Markdown
Member

The --verbose outputs the "handled" files when you run format/lint/check. Isn't that information enough?

I like the proposal, and maybe we can print the information without the --files flag. On the other hand, we also have formatter.includes, etc., and I believe we should print them too.

@christymcgrory
Copy link
Copy Markdown
Author

The --verbose outputs the "handled" files when you run format/lint/check. Isn't that information enough?

I like the proposal, and maybe we can print the information without the --files flag. On the other hand, we also have formatter.includes, etc., and I believe we should print them too.

Thanks for the feedback. Like the idea of it being default without a new flag, I'll make some changes over the weekend.

@ematipico
Copy link
Copy Markdown
Member

@christymcgrory any updates?

@christymcgrory christymcgrory force-pushed the feat/biome-rage-files-output branch from 0cb4622 to 60d1b39 Compare March 24, 2026 11:23
@christymcgrory christymcgrory force-pushed the feat/biome-rage-files-output branch from 60d1b39 to 1527f27 Compare March 24, 2026 11:28
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 24, 2026

Walkthrough

Adds a new "Files" section to the biome rage command output that renders Ignore Unknown and Includes from the configuration when loading succeeds. Introduces Configuration::get_files_configuration(&self) -> FilesConfiguration which returns the cloned files configuration or a default. Also adds a changeset that bumps several Biome CLI package versions with the message “Add files section to biome rage output”.

Possibly related PRs

Suggested labels

A-Core

Suggested reviewers

  • ematipico
  • dyc3
  • siketyan
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding files information output to the biome rage command by default.
Description check ✅ Passed The description clearly explains the motivation, implementation approach, and test plan for viewing includes and ignoreUnknown from config via biome rage.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 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

📥 Commits

Reviewing files that changed from the base of the PR and between e168494 and 60d1b39.

⛔ Files ignored due to path filters (1)
  • crates/biome_cli/tests/snapshots/main_commands_rage/rage_help.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (5)
  • .changeset/ripe-dryers-tell.md
  • crates/biome_cli/src/commands/mod.rs
  • crates/biome_cli/src/commands/rage.rs
  • crates/biome_cli/src/lib.rs
  • crates/biome_configuration/src/lib.rs

Comment thread .changeset/chatty-meals-train.md Outdated
Comment thread crates/biome_cli/src/commands/rage.rs Outdated
Comment thread crates/biome_cli/src/commands/rage.rs Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 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

📥 Commits

Reviewing files that changed from the base of the PR and between 60d1b39 and 1527f27.

📒 Files selected for processing (3)
  • .changeset/ripe-dryers-tell.md
  • crates/biome_cli/src/commands/mod.rs
  • crates/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

Comment thread crates/biome_cli/src/commands/mod.rs Outdated
@christymcgrory
Copy link
Copy Markdown
Author

Hey @ematipico, I think this is ready for a review proper now -- apologies for the massive delay on responding to you!

@christymcgrory christymcgrory changed the title feat(cli): add new --files option to biome rage to output includes feat(cli): output files information via biome rage by default Mar 24, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
crates/biome_cli/src/commands/rage.rs (1)

367-378: ⚠️ Potential issue | 🟠 Major

Please add a CLI snapshot test for the new “Files” section output.

This change alters biome rage output, but there’s no accompanying test update in the submitted changes. A snapshot covering Ignore Unknown + merged Includes would 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

📥 Commits

Reviewing files that changed from the base of the PR and between 9db63b6 and 9864fcb.

⛔ Files ignored due to path filters (5)
  • crates/biome_cli/tests/snapshots/main_commands_rage/with_configuration.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_commands_rage/with_formatter_configuration.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_commands_rage/with_jsonc_configuration.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_commands_rage/with_linter_configuration.snap is excluded by !**/*.snap and included by **
  • crates/biome_cli/tests/snapshots/main_commands_rage/with_malformed_configuration.snap is excluded by !**/*.snap and included by **
📒 Files selected for processing (2)
  • .changeset/chatty-meals-train.md
  • crates/biome_cli/src/commands/rage.rs
✅ Files skipped from review due to trivial changes (1)
  • .changeset/chatty-meals-train.md

@ematipico
Copy link
Copy Markdown
Member

Hey @ematipico, I think this is ready for a review proper now -- apologies for the massive delay on responding to you!

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

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

Labels

A-CLI Area: CLI A-Project Area: project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants