Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/warm-shrimps-wait.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@biomejs/biome": patch
---

Fixed [#7580](https://github.com/biomejs/biome/issues/7580): Include plugin in summary report
3 changes: 2 additions & 1 deletion crates/biome_cli/src/reporter/summary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ impl ReporterVisitor for SummaryReporterVisitor<'_> {
&& let Some(category) = category
&& (category.name().starts_with("lint/")
|| category.name().starts_with("suppressions/")
|| category.name().starts_with("assist/"))
|| category.name().starts_with("assist/")
|| category.name().starts_with("plugin"))
{
files_to_diagnostics.insert_rule_for_file(category.name(), severity, location);
}
Expand Down
37 changes: 34 additions & 3 deletions crates/biome_cli/tests/cases/reporter_summary.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
use crate::run_cli;
use crate::snap_test::{SnapshotPayload, assert_cli_snapshot};
use crate::{run_cli, run_cli_with_server_workspace};
use biome_console::BufferConsole;
use biome_fs::MemoryFileSystem;
use bpaf::Args;
use camino::Utf8Path;

const PLUGIN: &str = r#"
`debugger` as $dbg where {
register_diagnostic(
message = "Found debugger statement",
span = $dbg
)
}
"#;

const MAIN_1: &str = r#"import { z} from "z"
import { z, b , a} from "lodash"

Expand Down Expand Up @@ -60,6 +69,17 @@ fn reports_diagnostics_summary_check_command() {
let fs = MemoryFileSystem::default();
let mut console = BufferConsole::default();

let plugin_path = Utf8Path::new("plugin.grit");
fs.insert(plugin_path.into(), PLUGIN.as_bytes());

let file_path = Utf8Path::new("biome.json");
fs.insert(
file_path.into(),
br#"{
"plugins": ["plugin.grit"]
}"#,
);

let file_path1 = Utf8Path::new("main.ts");
fs.insert(file_path1.into(), MAIN_1.as_bytes());

Expand All @@ -69,7 +89,7 @@ fn reports_diagnostics_summary_check_command() {
let file_path3 = Utf8Path::new("index.css");
fs.insert(file_path3.into(), MAIN_3.as_bytes());

let (fs, result) = run_cli(
let (fs, result) = run_cli_with_server_workspace(
fs,
&mut console,
Args::from(
Expand Down Expand Up @@ -140,6 +160,17 @@ fn reports_diagnostics_summary_lint_command() {
let fs = MemoryFileSystem::default();
let mut console = BufferConsole::default();

let plugin_path = Utf8Path::new("plugin.grit");
fs.insert(plugin_path.into(), PLUGIN.as_bytes());

let file_path = Utf8Path::new("biome.json");
fs.insert(
file_path.into(),
br#"{
"plugins": ["plugin.grit"]
}"#,
);

let file_path1 = Utf8Path::new("main.ts");
fs.insert(file_path1.into(), MAIN_1.as_bytes());

Expand All @@ -149,7 +180,7 @@ fn reports_diagnostics_summary_lint_command() {
let file_path3 = Utf8Path::new("index.css");
fs.insert(file_path3.into(), MAIN_3.as_bytes());

let (fs, result) = run_cli(
let (fs, result) = run_cli_with_server_workspace(
fs,
&mut console,
Args::from(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
source: crates/biome_cli/tests/snap_test.rs
expression: redactor(content)
---
## `biome.json`

```json
{
"plugins": ["plugin.grit"]
}
```

## `index.css`

```css
Expand Down Expand Up @@ -64,6 +72,19 @@ let f;
let f;
```

## `plugin.grit`

```grit

`debugger` as $dbg where {
register_diagnostic(
message = "Found debugger statement",
span = $dbg
)
}

```

# Termination Message

```block
Expand Down Expand Up @@ -99,8 +120,8 @@ reporter/violations ━━━━━━━━━━━━━━━━━━━━
i The following files have violations:

- index.css (2 errors)
- index.ts (21 errors, 8 warnings)
- main.ts (21 errors, 8 warnings)
- index.ts (25 errors, 8 warnings)
- main.ts (25 errors, 8 warnings)

i The following lint rules have violations:

Expand All @@ -112,11 +133,12 @@ reporter/violations ━━━━━━━━━━━━━━━━━━━━
assist/source/organizeImports 2 (2 errors)
lint/suspicious/noRedeclare 12 (12 errors)
lint/suspicious/noDebugger 8 (8 errors)
plugin 8 (8 errors)

```

```block
Checked 3 files in <TIME>. No fixes applied.
Found 49 errors.
Found 57 errors.
Found 16 warnings.
```
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
source: crates/biome_cli/tests/snap_test.rs
expression: redactor(content)
---
## `biome.json`

```json
{
"plugins": ["plugin.grit"]
}
```

## `index.css`

```css
Expand Down Expand Up @@ -64,6 +72,19 @@ let f;
let f;
```

## `plugin.grit`

```grit

`debugger` as $dbg where {
register_diagnostic(
message = "Found debugger statement",
span = $dbg
)
}

```

# Termination Message

```block
Expand Down Expand Up @@ -91,8 +112,8 @@ reporter/violations ━━━━━━━━━━━━━━━━━━━━
i The following files have violations:

- index.css (2 errors)
- index.ts (20 errors, 8 warnings)
- main.ts (20 errors, 8 warnings)
- index.ts (24 errors, 8 warnings)
- main.ts (24 errors, 8 warnings)

i The following lint rules have violations:

Expand All @@ -103,11 +124,12 @@ reporter/violations ━━━━━━━━━━━━━━━━━━━━
lint/suspicious/noDoubleEquals 8 (8 errors)
lint/suspicious/noRedeclare 12 (12 errors)
lint/suspicious/noDebugger 8 (8 errors)
plugin 8 (8 errors)

```

```block
Checked 3 files in <TIME>. No fixes applied.
Found 43 errors.
Found 51 errors.
Found 16 warnings.
```