From 9ab955d0d89b22edcac0a9a225c8ae6630d0db82 Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Tue, 3 Nov 2026 14:46:00 +0200 Subject: [PATCH] Give every server in the matrix a short name and a version Some profile names carried a version or a language ("Clojure (nrepl/nrepl 1.8.0)", "dialtone (Erlang)"), so their columns came out much wider than the rest and their headers looked different from the ones with a version snippet. The names are short now, nREPL, ClojureCLR and jank get version snippets, and each name links to the server's homepage, which also says what dialtone and repartee are. The server columns are all the same width, and a long name wraps instead of widening its column. ClojureCLR's version is the one of ClojureCLR, as clr.tools.nrepl reports a stale version of its own (0.1.0-alpha1 for 0.1.2-alpha2). --- CHANGELOG.md | 4 ++++ cmd/proof/main.go | 4 ++-- doc/profiles.md | 4 ++-- doc/usage.md | 2 +- internal/report/matrix.go | 6 +++++- internal/report/matrix.html | 9 ++++++--- internal/report/report.go | 1 + internal/report/report_test.go | 4 +++- internal/serve/matrix_test.go | 5 ++--- profiles/clojure-clr.toml | 8 +++++++- profiles/clojure.toml | 6 +++++- profiles/dialtone.toml | 2 +- profiles/jank.toml | 4 ++++ profiles/repartee.toml | 2 +- 14 files changed, 44 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 78c0d31..e08e44d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## main (unreleased) +### Changes + +- [#22](https://github.com/nrepl/proof/pull/22): The bundled profiles have short names, with versions from their `version` snippets, so the servers in the compatibility matrix get columns of the same width. + ## 0.2.0 (2026-11-03) ### Features diff --git a/cmd/proof/main.go b/cmd/proof/main.go index 22b3e07..ae00dd3 100644 --- a/cmd/proof/main.go +++ b/cmd/proof/main.go @@ -219,8 +219,8 @@ func run(args []string) int { results := check.Run(env, selected, checks.WireRules()) outcome := check.Apply(results, p.ExpectedFailures, opts.only == "") - r := report.Run{Proof: proofVersion(), Server: p.Name, ServerVersion: ver, Address: addr, Started: started, - Results: results} + r := report.Run{Proof: proofVersion(), Server: p.Name, ServerVersion: ver, Homepage: p.Homepage, + Address: addr, Started: started, Results: results} report.Text(os.Stdout, r, opts.verbose) for _, id := range outcome.Stale { fmt.Printf("%s is listed in expected-failures but didn't fail; remove it from the profile\n", id) diff --git a/doc/profiles.md b/doc/profiles.md index 265e68b..fbc7351 100644 --- a/doc/profiles.md +++ b/doc/profiles.md @@ -87,8 +87,8 @@ code = "fizz.core/version" | Option | Required | Description | |---|---|---| -| `name` | yes | The name of the server in reports and in the compatibility matrix. If the profile always starts the same version of the server, it's a good idea to include it here (otherwise see the `version` snippet). | -| `homepage` | no | The homepage of the server. | +| `name` | yes | The name of the server in reports and in the compatibility matrix, where it heads a column, so keep it short. The `version` snippet takes care of the version. | +| `homepage` | no | The homepage of the server, which the name links to in the compatibility matrix. | | `address` | no | The `host:port` of a server that's already running. When it's set proof connects to the server instead of starting it, and `[launch]` is ignored. The `-address` command-line option does the same. | | `timeout` | no | How long proof waits for each request to finish (i.e. for its `done`). It's a duration like `"10s"` (which is also the default). | diff --git a/doc/usage.md b/doc/usage.md index a34d440..d98ef3b 100644 --- a/doc/usage.md +++ b/doc/usage.md @@ -250,7 +250,7 @@ recording every message on the way: ```shell $ proof proxy -listen 127.0.0.1:7888 clojure -Starting Clojure (nrepl/nrepl 1.8.0)... +Starting nREPL... Forwarding 127.0.0.1:7888 to localhost:53613. Connect your client to 127.0.0.1:7888 and press Ctrl-C when it's done. ``` diff --git a/internal/report/matrix.go b/internal/report/matrix.go index 5a443da..754a59f 100644 --- a/internal/report/matrix.go +++ b/internal/report/matrix.go @@ -144,7 +144,11 @@ func HTML(w io.Writer, reports []Report) error { var b strings.Builder b.WriteString("\nCheck") for _, r := range reports { - fmt.Fprintf(&b, "%s", esc(r.Server)) + name := esc(r.Server) + if r.Homepage != "" { + name = fmt.Sprintf(`%s`, esc(r.Homepage), name) + } + fmt.Fprintf(&b, "%s", name) if r.ServerVersion != "" { fmt.Fprintf(&b, `%s`, esc(r.ServerVersion)) } diff --git a/internal/report/matrix.html b/internal/report/matrix.html index 2cac63f..72f5e3f 100644 --- a/internal/report/matrix.html +++ b/internal/report/matrix.html @@ -59,12 +59,15 @@ position: sticky; top: 0; background: var(--head); - vertical-align: bottom; - min-width: 6rem; + vertical-align: top; z-index: 1; } thead th:first-child { left: 0; z-index: 2; } -thead th + th { text-align: center; } +/* Every server gets a column of the same width, and a long name or + version wraps rather than widening its column. */ +thead th + th { width: 7rem; min-width: 7rem; text-align: center; overflow-wrap: anywhere; } +thead a { text-decoration: none; } +thead a:hover { text-decoration: underline; } .version { display: block; color: var(--muted); font-weight: normal; font-size: 0.85em; } tbody th, tfoot th { position: sticky; diff --git a/internal/report/report.go b/internal/report/report.go index 829eb01..e24f460 100644 --- a/internal/report/report.go +++ b/internal/report/report.go @@ -19,6 +19,7 @@ type Run struct { // ServerVersion is what the version snippet of the server's profile // evaluated to, if it has one. ServerVersion string `json:"server-version,omitempty"` + Homepage string `json:"homepage,omitempty"` Address string `json:"address"` Started time.Time `json:"started"` Results []check.Result `json:"-"` diff --git a/internal/report/report_test.go b/internal/report/report_test.go index fc57c22..7454024 100644 --- a/internal/report/report_test.go +++ b/internal/report/report_test.go @@ -28,6 +28,7 @@ func sampleReports(t *testing.T) []Report { t.Helper() beta := sampleRun("Beta | Two", check.Pass, check.Failed, check.Skipped) beta.ServerVersion = "2.0" + beta.Homepage = "https://example.com/beta?a&b" beta.Started = time.Date(2026, 11, 3, 5, 0, 0, 0, time.UTC) beta.Results[1].Details = []string{"gave no value"} dir := t.TempDir() @@ -74,7 +75,8 @@ func TestMatrixAsAPage(t *testing.T) { } got := buf.String() for _, want := range []string{ - `Beta | Two2.0`, + `Alpha`, + `Beta | Two2.0`, `eval`, `eval.valuetitle eval.value`, `passfail`, diff --git a/internal/serve/matrix_test.go b/internal/serve/matrix_test.go index d6dcc00..77e04f3 100644 --- a/internal/serve/matrix_test.go +++ b/internal/serve/matrix_test.go @@ -205,9 +205,8 @@ func TestPresetsMatchTheScenarios(t *testing.T) { t.Errorf("%s isn't the name of a profile: %v", p.Name, err) continue } - // e.g. "ClojureCLR (clr.tools.nrepl 0.1.2-alpha2)" says ClojureCLR, - // but the profile of nREPL itself is named after Clojure. - server, _, _ := strings.Cut(prof.Name, " (") + // nREPL's scenarios say which version does them. + server := prof.Name if p.Name == "clojure" { server = "nREPL 1.8.0" } diff --git a/profiles/clojure-clr.toml b/profiles/clojure-clr.toml index 6754836..a569587 100644 --- a/profiles/clojure-clr.toml +++ b/profiles/clojure-clr.toml @@ -6,7 +6,7 @@ # # With .NET from Homebrew, also export # DOTNET_ROOT=/opt/homebrew/opt/dotnet/libexec or cljr can't find the runtime. -name = "ClojureCLR (clr.tools.nrepl 0.1.2-alpha2)" +name = "ClojureCLR" homepage = "https://github.com/clojure/clr.tools.nrepl" [launch] @@ -64,3 +64,9 @@ value = "println" # A function to look up. [snippets.lookup] code = "println" + +# The version of ClojureCLR, for the report. clr.tools.nrepl doesn't know +# its own (describe says 0.1.0-alpha1), and it's the tag in the command +# anyway. +[snippets.version] +code = "(clojure-version)" diff --git a/profiles/clojure.toml b/profiles/clojure.toml index 7137bf8..4f78304 100644 --- a/profiles/clojure.toml +++ b/profiles/clojure.toml @@ -1,5 +1,5 @@ # The reference implementation, nrepl/nrepl, on the Clojure CLI. -name = "Clojure (nrepl/nrepl 1.8.0)" +name = "nREPL" homepage = "https://github.com/nrepl/nrepl" [launch] @@ -61,3 +61,7 @@ value = "println" # A function to look up. [snippets.lookup] code = "println" + +# The version of nREPL, for the report. +[snippets.version] +code = "(:version-string nrepl.core/version)" diff --git a/profiles/dialtone.toml b/profiles/dialtone.toml index a9b82f8..116971c 100644 --- a/profiles/dialtone.toml +++ b/profiles/dialtone.toml @@ -1,6 +1,6 @@ # dialtone, the Erlang nREPL server from nrepl/nrepl-beam. Expects the # dialtone launcher (dialtone/bin/dialtone) on PATH. -name = "dialtone (Erlang)" +name = "dialtone" homepage = "https://github.com/nrepl/nrepl-beam" [launch] diff --git a/profiles/jank.toml b/profiles/jank.toml index 36bd534..b8c5e1f 100644 --- a/profiles/jank.toml +++ b/profiles/jank.toml @@ -56,3 +56,7 @@ value = "println" # A function to look up. [snippets.lookup] code = "println" + +# The version of jank, for the report. clojure-version says jank-0.1-alpha. +[snippets.version] +code = '(clojure.string/replace (clojure-version) "jank-" "")' diff --git a/profiles/repartee.toml b/profiles/repartee.toml index f232d30..c72af20 100644 --- a/profiles/repartee.toml +++ b/profiles/repartee.toml @@ -1,6 +1,6 @@ # repartee, the Elixir nREPL server from nrepl/nrepl-beam. Expects the # repartee launcher (repartee/bin/repartee) on PATH. -name = "repartee (Elixir)" +name = "repartee" homepage = "https://github.com/nrepl/nrepl-beam" [launch]