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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
targets: wasm32-wasip2
# Component loading is host behaviour, so it is tested once, natively,
# rather than on every target the matrix above cross-compiles for.
- run: cargo test --features wasm-plugin-tests --test wasm
- run: cargo xtask test-plugins

test_mime_db:
name: Test with MIME database
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ __pycache__/

# WASM plugin builds: scripts/build-wasm-plugins.sh
plugin.wasm
# The bundled WASM summarizer ships ready to embed without a WASM toolchain.
!/plugins/summarize/plugin.wasm
/crates/*/target

# Generated data left behind by the retired review web viewer.
Expand Down
131 changes: 117 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ diffr-plugin-hide-files = { path = "plugins/hide-files" }
diffr-plugin-removed-runs = { path = "plugins/removed-runs" }
diffr-plugin-summarize = { path = "plugins/summarize" }
diffr-plugin-test-bodies = { path = "plugins/test-bodies" }
wasmtime-wasi-http = { version = "34.0.2", default-features = false }


[target.'cfg(not(any(windows, target_os = "illumos", target_os = "freebsd")))'.dependencies]
Expand Down Expand Up @@ -199,9 +200,8 @@ default-members = [
"examples/plugins/fixtures",
]

# Test-only exception: the summarizer's HTTP client is native-only today.
[workspace.metadata.diffr]
wasm-test-exclude = ["diffr-plugin-summarize"]
wasm-test-exclude = []

[profile.release]
lto = "thin"
Expand Down
12 changes: 7 additions & 5 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ name = "default-dark" # a bundled terminal theme
path = "/path/to/theme.toml" # or a Helix-style theme file

[plugins] # see "Plugins" below
order = ["bundled.context", "bundled.hide-files", "bundled.deleted-bodies", "bundled.test-bodies", "bundled.removed-runs", "bundled.summarize", "bundled.group"]
order = ["bundled.context", "bundled.hide-files", "bundled.deleted-bodies", "bundled.summarize", "bundled.test-bodies", "bundled.removed-runs", "bundled.group"]
```

When a file exceeds a `[diff]` limit it falls back to a line diff: the file's
Expand All @@ -92,7 +92,7 @@ produce on the wire.

```toml
[plugins]
order = ["bundled.context", "bundled.hide-files", "bundled.deleted-bodies", "bundled.test-bodies", "bundled.removed-runs", "bundled.summarize", "bundled.group"]
order = ["bundled.context", "bundled.hide-files", "bundled.deleted-bodies", "bundled.summarize", "bundled.test-bodies", "bundled.removed-runs", "bundled.group"]

[plugins.bundled.context] # unchanged lines far from any change collapse
enabled = true
Expand All @@ -115,15 +115,17 @@ min_lines = 3
enabled = true
min_lines = 5

[plugins.bundled.summarize] # pseudocode for large new function bodies
[plugins.bundled.summarize] # pseudocode for large new function bodies and right-side tests
enabled = false # off by default: it needs an API key
provider = "gemini"
model = "gemini-3.8-flash"
min_lines = 20
tests = true # include right-side tests even when not newly added
test_min_lines = 20
api_key = "…" # or GEMINI_API_KEY / GOOGLE_API_KEY
endpoint = "https://…" # optional base URL override
request_timeout_ms = 60000
max_concurrency = 16
max_concurrency = 16 # legacy option; ignored by the WASM summarizer
retries = 3
system_prompt = """…""" # the model's system instruction; defaults to diffr's own

Expand Down Expand Up @@ -156,7 +158,7 @@ key.

```toml
[plugins]
order = ["bundled.context", "bundled.hide-files", "bundled.deleted-bodies", "bundled.test-bodies", "bundled.removed-runs", "bundled.summarize", "bundled.group", "external.fixtures"]
order = ["bundled.context", "bundled.hide-files", "bundled.deleted-bodies", "bundled.summarize", "bundled.test-bodies", "bundled.removed-runs", "bundled.group", "external.fixtures"]

[plugins.external.fixtures]
path = "plugins/fixtures"
Expand Down
Loading
Loading