From 70ed5301c62b2d918e3a4e178f0ed3bf6b1d0b3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20SZKIBA?= Date: Tue, 30 Jul 2024 18:33:33 +0200 Subject: [PATCH] feat: fix MQTT abbrevation in xk6-mqtt description --- cmd/legacy.go | 8 ++++++++ docs/legacy.yaml | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cmd/legacy.go b/cmd/legacy.go index cb0ee68..0803591 100644 --- a/cmd/legacy.go +++ b/cmd/legacy.go @@ -116,6 +116,10 @@ func legacyPatch(ext *k6registry.Extension) { if len(override.module) != 0 { ext.Module = override.module } + + for from, to := range phrases { + ext.Description = strings.ReplaceAll(ext.Description, from, to) + } } type extOverride struct { @@ -202,3 +206,7 @@ var extOverrides = map[string]extOverride{ //nolint:gochecknoglobals "go.k6.io/k6": {}, "github.com/wosp-io/xk6-playwright": {module: "github.com/nicholasvuono/xk6-playwright"}, } + +var phrases = map[string]string{ //nolint:gochecknoglobals + "mqtt": "MQTT", +} diff --git a/docs/legacy.yaml b/docs/legacy.yaml index bf25f79..5577f3e 100644 --- a/docs/legacy.yaml +++ b/docs/legacy.yaml @@ -221,7 +221,7 @@ imports: - k6/x/sse - module: github.com/pmalhaire/xk6-mqtt - description: mqtt extension + description: MQTT extension imports: - k6/x/mqtt - module: github.com/skibum55/xk6-git