Conversation
🦋 Changeset detectedLatest commit: 6898165 The changes in this PR will be included in the next version bump. This PR includes changesets to release 14 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 |
WalkthroughAdds a new Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
crates/biome_cli/tests/cases/reporter_concise.rs (1)
29-170: Optional tidy-up: factor shared test scaffolding into a helper.The setup/run/assert pattern is repeated four times; a tiny helper would trim noise and make future reporter cases easier to add.
♻️ Possible refactor sketch
+fn run_concise(command: &str, snapshot_name: &str) { + let fs = MemoryFileSystem::default(); + let mut console = BufferConsole::default(); + + let file_path1 = Utf8Path::new("main.ts"); + fs.insert(file_path1.into(), MAIN_1.as_bytes()); + let file_path2 = Utf8Path::new("index.ts"); + fs.insert(file_path2.into(), MAIN_2.as_bytes()); + + let (fs, result) = run_cli( + fs, + &mut console, + Args::from([command, "--reporter=concise", file_path1.as_str(), file_path2.as_str()].as_slice()), + ); + + assert!(result.is_err(), "run_cli returned {result:?}"); + assert_cli_snapshot(SnapshotPayload::new(module_path!(), snapshot_name, fs, console, result)); +}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@crates/biome_cli/tests/cases/reporter_concise.rs` around lines 29 - 170, Extract the repeated test scaffolding in reports_diagnostics_concise_check_command, reports_diagnostics_concise_ci_command, reports_diagnostics_concise_lint_command, and reports_diagnostics_concise_format_command into a small helper (e.g., a function like run_concise_report_test) that takes the command name ("check"/"ci"/"lint"/"format") and snapshot name, creates MemoryFileSystem and BufferConsole, inserts MAIN_1/MAIN_2, calls run_cli with Args::from([... "--reporter=concise", file_path1, file_path2]), asserts result is Err, and calls assert_cli_snapshot(SnapshotPayload::new(...)); then replace each test body with a single call to that helper to reduce duplication while keeping run_cli, Args::from, and assert_cli_snapshot usage intact.
🤖 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_diagnostics/src/display.rs`:
- Around line 195-197: The code adds a header space based on has_file (let
has_file = diagnostic.location().resource.is_some()) but print_file_location
only prints when the resource is Resource::File, causing a stray space for
non-file resources; change the condition used before writing the leading space
to explicitly check for a file resource (e.g., match or matches! on
diagnostic.location().resource being Resource::File) so the space is only
written when print_file_location will actually print; update the logic around
has_file/print_file_location accordingly.
- Around line 282-287: The fixed code should stop unconditionally writing ": "
separators in concise mode; instead, only emit the colon+space when the adjacent
piece actually printed something. Update the display logic around the
fmt.write_str calls and print_category(diagnostic) so you check whether a
location or category exists (e.g., use diagnostic.location.is_some() and
diagnostic.category.is_some()) or change print_category to return a bool
indicating it printed, and conditionally call fmt.write_str(": ") based on that
boolean (or the presence checks) to avoid printing "✖ : ..." when either side is
empty.
---
Nitpick comments:
In `@crates/biome_cli/tests/cases/reporter_concise.rs`:
- Around line 29-170: Extract the repeated test scaffolding in
reports_diagnostics_concise_check_command,
reports_diagnostics_concise_ci_command,
reports_diagnostics_concise_lint_command, and
reports_diagnostics_concise_format_command into a small helper (e.g., a function
like run_concise_report_test) that takes the command name
("check"/"ci"/"lint"/"format") and snapshot name, creates MemoryFileSystem and
BufferConsole, inserts MAIN_1/MAIN_2, calls run_cli with Args::from([...
"--reporter=concise", file_path1, file_path2]), asserts result is Err, and calls
assert_cli_snapshot(SnapshotPayload::new(...)); then replace each test body with
a single call to that helper to reduce duplication while keeping run_cli,
Args::from, and assert_cli_snapshot usage intact.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: c79f09da-0962-4587-bb67-ed72d39134f5
⛔ Files ignored due to path filters (10)
crates/biome_cli/tests/snapshots/main_cases_help/check_help.snapis excluded by!**/*.snapand included by**crates/biome_cli/tests/snapshots/main_cases_help/ci_help.snapis excluded by!**/*.snapand included by**crates/biome_cli/tests/snapshots/main_cases_help/format_help.snapis excluded by!**/*.snapand included by**crates/biome_cli/tests/snapshots/main_cases_help/lint_help.snapis excluded by!**/*.snapand included by**crates/biome_cli/tests/snapshots/main_cases_help/migrate_help.snapis excluded by!**/*.snapand included by**crates/biome_cli/tests/snapshots/main_cases_help/rage_help.snapis excluded by!**/*.snapand included by**crates/biome_cli/tests/snapshots/main_cases_reporter_concise/reports_diagnostics_concise_check_command.snapis excluded by!**/*.snapand included by**crates/biome_cli/tests/snapshots/main_cases_reporter_concise/reports_diagnostics_concise_ci_command.snapis excluded by!**/*.snapand included by**crates/biome_cli/tests/snapshots/main_cases_reporter_concise/reports_diagnostics_concise_format_command.snapis excluded by!**/*.snapand included by**crates/biome_cli/tests/snapshots/main_cases_reporter_concise/reports_diagnostics_concise_lint_command.snapis excluded by!**/*.snapand included by**
📒 Files selected for processing (7)
.changeset/add-concise-reporter.mdcrates/biome_cli/src/cli_options.rscrates/biome_cli/src/reporter/terminal.rscrates/biome_cli/src/runner/impls/finalizers/default.rscrates/biome_cli/tests/cases/mod.rscrates/biome_cli/tests/cases/reporter_concise.rscrates/biome_diagnostics/src/display.rs
a610336 to
3a725e3
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (2)
crates/biome_diagnostics/src/display.rs (2)
282-287:⚠️ Potential issue | 🟡 MinorAvoid unconditional
": "separators in concise output.Line 282 and Line 287 always print delimiters, so diagnostics without location/category render as awkward placeholders (for example
✖ : ...).💡 Proposed fix
- // Print file location with hyperlink - print_file_location(fmt, diagnostic)?; - - fmt.write_str(": ")?; - - // Print category with hyperlink - print_category(fmt, diagnostic)?; - - fmt.write_str(": ")?; + let has_file = matches!(diagnostic.location().resource, Some(Resource::File(_))); + if has_file { + print_file_location(fmt, diagnostic)?; + fmt.write_str(": ")?; + } + + if diagnostic.category().is_some() { + print_category(fmt, diagnostic)?; + fmt.write_str(": ")?; + }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@crates/biome_diagnostics/src/display.rs` around lines 282 - 287, The code unconditionally emits the ": " separators around the category which causes stray delimiters when location or category are missing; change the printing flow so separators are only written when the adjacent component actually produced output — for example modify print_location(...) and print_category(...) to return a bool (or provide a helper like wrote_something()) and then wrap fmt.write_str(": ")? calls in if checks (e.g. if print_location(fmt, diagnostic) { if print_category(fmt, diagnostic) { fmt.write_str(": ")? } } or more simply track a local wrote_any flag and only write ": " when the previous component returned true); update calls around print_category(fmt, diagnostic) and any fmt.write_str(": ")? uses to use this conditional logic.
195-197:⚠️ Potential issue | 🟡 MinorGate header spacing on actual file resources.
On Line 195,
resource.is_some()is broader than what Line 193 prints. For non-file resources, this leaves a stray leading space.💡 Proposed fix
- let has_file = diagnostic.location().resource.is_some(); + let has_file = matches!(diagnostic.location().resource, Some(Resource::File(_))); if has_file { fmt.write_str(" ")?; }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@crates/biome_diagnostics/src/display.rs` around lines 195 - 197, The code currently sets has_file using diagnostic.location().resource.is_some(), which adds a space for any resource type and causes a stray space for non-file resources; change the condition to detect actual file resources (e.g., use diagnostic.location().resource.as_ref().map_or(false, |r| r.is_file()) or match on Resource::File) so the leading space (the fmt.write_str call) is only emitted when the resource is a file; update the has_file binding and keep the fmt.write_str(" ") call tied to that refined check.
🤖 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/add-concise-reporter.md:
- Line 5: Update the sentence in .changeset/add-concise-reporter.md to read
exactly: “When `--reporter=concise` is passed to the commands `format`, `lint`,
`check`, and `ci`, the diagnostics are printed in a compact manner:” — replace
the existing line (which currently omits “to”) with this wording, keeping the
reporter name `concise` and the command list `format`, `lint`, `check`, and `ci`
unchanged to preserve clarity and brevity.
---
Duplicate comments:
In `@crates/biome_diagnostics/src/display.rs`:
- Around line 282-287: The code unconditionally emits the ": " separators around
the category which causes stray delimiters when location or category are
missing; change the printing flow so separators are only written when the
adjacent component actually produced output — for example modify
print_location(...) and print_category(...) to return a bool (or provide a
helper like wrote_something()) and then wrap fmt.write_str(": ")? calls in if
checks (e.g. if print_location(fmt, diagnostic) { if print_category(fmt,
diagnostic) { fmt.write_str(": ")? } } or more simply track a local wrote_any
flag and only write ": " when the previous component returned true); update
calls around print_category(fmt, diagnostic) and any fmt.write_str(": ")? uses
to use this conditional logic.
- Around line 195-197: The code currently sets has_file using
diagnostic.location().resource.is_some(), which adds a space for any resource
type and causes a stray space for non-file resources; change the condition to
detect actual file resources (e.g., use
diagnostic.location().resource.as_ref().map_or(false, |r| r.is_file()) or match
on Resource::File) so the leading space (the fmt.write_str call) is only emitted
when the resource is a file; update the has_file binding and keep the
fmt.write_str(" ") call tied to that refined check.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: ca067eb8-50d2-43a1-8904-6fe7922d7b50
⛔ Files ignored due to path filters (10)
crates/biome_cli/tests/snapshots/main_cases_help/check_help.snapis excluded by!**/*.snapand included by**crates/biome_cli/tests/snapshots/main_cases_help/ci_help.snapis excluded by!**/*.snapand included by**crates/biome_cli/tests/snapshots/main_cases_help/format_help.snapis excluded by!**/*.snapand included by**crates/biome_cli/tests/snapshots/main_cases_help/lint_help.snapis excluded by!**/*.snapand included by**crates/biome_cli/tests/snapshots/main_cases_help/migrate_help.snapis excluded by!**/*.snapand included by**crates/biome_cli/tests/snapshots/main_cases_help/rage_help.snapis excluded by!**/*.snapand included by**crates/biome_cli/tests/snapshots/main_cases_reporter_concise/reports_diagnostics_concise_check_command.snapis excluded by!**/*.snapand included by**crates/biome_cli/tests/snapshots/main_cases_reporter_concise/reports_diagnostics_concise_ci_command.snapis excluded by!**/*.snapand included by**crates/biome_cli/tests/snapshots/main_cases_reporter_concise/reports_diagnostics_concise_format_command.snapis excluded by!**/*.snapand included by**crates/biome_cli/tests/snapshots/main_cases_reporter_concise/reports_diagnostics_concise_lint_command.snapis excluded by!**/*.snapand included by**
📒 Files selected for processing (7)
.changeset/add-concise-reporter.mdcrates/biome_cli/src/cli_options.rscrates/biome_cli/src/reporter/terminal.rscrates/biome_cli/src/runner/impls/finalizers/default.rscrates/biome_cli/tests/cases/mod.rscrates/biome_cli/tests/cases/reporter_concise.rscrates/biome_diagnostics/src/display.rs
🚧 Files skipped from review as they are similar to previous changes (3)
- crates/biome_cli/src/reporter/terminal.rs
- crates/biome_cli/tests/cases/reporter_concise.rs
- crates/biome_cli/src/cli_options.rs
| "@biomejs/biome": minor | ||
| --- | ||
|
|
||
| Added a new reporter called `concise`. When `--reporter=concise` is passed the commands `format`, `lint`, `check` and `ci`, the diagnostics are printed in a compact manner: |
There was a problem hiding this comment.
Tiny wording tweak for clarity (and fewer raised eyebrows).
Please adjust the sentence to: “When --reporter=concise is passed to the commands format, lint, check, and ci…”.
Based on learnings: "Changeset descriptions should be concise (1-3 sentences), user-facing".
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.changeset/add-concise-reporter.md at line 5, Update the sentence in
.changeset/add-concise-reporter.md to read exactly: “When `--reporter=concise`
is passed to the commands `format`, `lint`, `check`, and `ci`, the diagnostics
are printed in a compact manner:” — replace the existing line (which currently
omits “to”) with this wording, keeping the reporter name `concise` and the
command list `format`, `lint`, `check`, and `ci` unchanged to preserve clarity
and brevity.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
crates/biome_diagnostics/src/display.rs (1)
127-144: Minor cosmetic issue: double space for JetBrains terminals in concise mode.
print_concisewrites a space after the icon (line 278), then callsprint_file_location. The JetBrains branch adds another leading space via" at {name}", resulting in✖ at path:1:1.This only affects JetBrains IDE terminal users, but worth a quick fix if you're in there anyway.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@crates/biome_diagnostics/src/display.rs` around lines 127 - 144, The JetBrains branch in print_file_location/Display code adds a leading space via format!(" at {name}") which, combined with print_concise's already-added space after the icon, yields a double space; remove the extra leading space by changing the JetBrains branch to print "at {name}" (no leading space) or otherwise emit "at " + name so the caller's spacing remains correct; update the branch that checks is_jetbrains (the code that currently does fmt.write_str(&format!(" at {name}"))?) to emit without the leading space.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@crates/biome_diagnostics/src/display.rs`:
- Around line 127-144: The JetBrains branch in print_file_location/Display code
adds a leading space via format!(" at {name}") which, combined with
print_concise's already-added space after the icon, yields a double space;
remove the extra leading space by changing the JetBrains branch to print "at
{name}" (no leading space) or otherwise emit "at " + name so the caller's
spacing remains correct; update the branch that checks is_jetbrains (the code
that currently does fmt.write_str(&format!(" at {name}"))?) to emit without the
leading space.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 5fad53e1-900d-4231-83ec-dff736ced3ee
📒 Files selected for processing (1)
crates/biome_diagnostics/src/display.rs
Summary
Closes #6970
This reporter is a bit different from the others because it affects how diagnostics are printed on console, which means we use the default reporter to terminal, but we print the diagnostics differently.
The
PrintDiagnostic::concisefunction was implemented with AI, and I fixed a little bit. I also used it to create tests. I implemented the rest.Test Plan
Added new tests
Docs
I'll need to create one