From 76993fc2863cd16aaf0135f1b2d34be2d342de83 Mon Sep 17 00:00:00 2001 From: Mat Ryer Date: Fri, 2 Apr 2021 09:28:46 +0100 Subject: [PATCH 1/2] a few lint tweaks --- pkg/plugins/action.go | 3 +-- pkg/plugins/install_test.go | 7 +++---- pkg/plugins/parse_test.go | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/pkg/plugins/action.go b/pkg/plugins/action.go index 6334aefcf..cba2678f3 100644 --- a/pkg/plugins/action.go +++ b/pkg/plugins/action.go @@ -42,7 +42,7 @@ func (i *Item) Action() ActionFunc { if i.Params.Shell != "" { actions = append(actions, actionShell(debugf, i, i.Params.Shell, i.Params.ShellParams)) } - if i.Params.Refresh == true { + if i.Params.Refresh { shouldDelayBeforeRefresh := false if len(actions) > 0 { // there are actions other than refresh, so let's introduce a @@ -157,6 +157,5 @@ func actionRefresh(debugf DebugFunc, refreshFunc func(ctx context.Context)) Acti return func(ctx context.Context) { debugf("action refresh") refreshFunc(ctx) - return } } diff --git a/pkg/plugins/install_test.go b/pkg/plugins/install_test.go index 0d96e0f5d..65ef84a53 100644 --- a/pkg/plugins/install_test.go +++ b/pkg/plugins/install_test.go @@ -176,7 +176,6 @@ func TestGetInstalledPluginName(t *testing.T) { // is.True(err != nil) // }) // } - -const simplePlugin = `#!/bin/bash -echo "Hello, xbar." -` +// const simplePlugin = `#!/bin/bash +// echo "Hello, xbar." +// ` diff --git a/pkg/plugins/parse_test.go b/pkg/plugins/parse_test.go index 71d069e90..406906da4 100644 --- a/pkg/plugins/parse_test.go +++ b/pkg/plugins/parse_test.go @@ -39,7 +39,7 @@ func TestParseParams(t *testing.T) { s, params, err = parseParams(`no params`) is.NoErr(err) is.Equal(s, "no params") - is.Equal(params.Terminal, false) // Terminal + is.Equal(params.Terminal, "false") // Terminal is.Equal(params.Refresh, false) // Refresh is.Equal(params.Dropdown, true) // Dropdown is.Equal(params.Length, 0) // Length From 61544851a43ccfd4fdeedd958db8cec6b5abf9c6 Mon Sep 17 00:00:00 2001 From: Mat Ryer Date: Fri, 2 Apr 2021 09:29:09 +0100 Subject: [PATCH 2/2] clearer filename --- pkg/plugins/{items.go => item_params.go} | 0 pkg/plugins/{items_test.go => item_params_test.go} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename pkg/plugins/{items.go => item_params.go} (100%) rename pkg/plugins/{items_test.go => item_params_test.go} (100%) diff --git a/pkg/plugins/items.go b/pkg/plugins/item_params.go similarity index 100% rename from pkg/plugins/items.go rename to pkg/plugins/item_params.go diff --git a/pkg/plugins/items_test.go b/pkg/plugins/item_params_test.go similarity index 100% rename from pkg/plugins/items_test.go rename to pkg/plugins/item_params_test.go