From fa0d8761ae8bd3180c4bd874541fb9881dbf2333 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Mon, 30 Dec 2019 17:26:50 -0500 Subject: [PATCH] A few minor changes made while updating documentation Signed-off-by: Chris Cummer --- Makefile | 8 ++++---- modules/azuredevops/settings.go | 8 ++++---- modules/resourceusage/settings.go | 6 +++--- modules/todoist/keyboard.go | 6 +++--- modules/trello/settings.go | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 8d5a0bc7..013c6f34 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ THIS_FILE := $(lastword $(MAKEFILE_LIST)) APP=wtfutil -# -------------------- Actions -------------------- # +# -------------------- Actions -------------------- # ## build: builds a local version build: @@ -72,7 +72,7 @@ install: ## lint: runs a number of code quality checks against the source code lint: - # https://github.com/kisielk/errcheck + @echo "\033[35mhttps://github.com/kisielk/errcheck\033[0m" errcheck ./app errcheck ./cfg errcheck ./flags @@ -84,7 +84,7 @@ lint: errcheck ./wtf errcheck ./main.go - # https://golang.org/cmd/vet/ + @echo "\033[35mhttps://golang.org/cmd/vet/k\033[0m" go vet ./app go vet ./cfg go vet ./flags @@ -96,7 +96,7 @@ lint: go vet ./wtf go vet ./main.go - # https://staticcheck.io/docs/ + @echo "\033[35m# https://staticcheck.io/docs/k\033[0m" staticcheck ./app staticcheck ./cfg staticcheck ./flags diff --git a/modules/azuredevops/settings.go b/modules/azuredevops/settings.go index 0a4f8e3b..5fdca9c7 100644 --- a/modules/azuredevops/settings.go +++ b/modules/azuredevops/settings.go @@ -16,11 +16,11 @@ const ( type Settings struct { common *cfg.Common - labelColor string apiToken string `help:"Your Azure DevOps Access Token."` + labelColor string + maxRows int orgURL string `help:"Your Azure DevOps organization URL."` projectName string - maxRows int } // NewSettingsFromYAML creates and returns an instance of Settings with configuration options populated @@ -28,11 +28,11 @@ func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *co settings := Settings{ common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocus, ymlConfig, globalConfig), + apiToken: ymlConfig.UString("apiToken", os.Getenv("WTF_AZURE_DEVOPS_API_TOKEN")), labelColor: ymlConfig.UString("labelColor", "white"), - apiToken: ymlConfig.UString("apiToken", os.Getenv("WTF_AZURE DEVOPS_API_TOKEN")), + maxRows: ymlConfig.UInt("maxRows", 3), orgURL: ymlConfig.UString("orgURL", os.Getenv("WTF_AZURE_DEVOPS_ORG_URL")), projectName: ymlConfig.UString("projectName", os.Getenv("WTF_AZURE_DEVOPS_PROJECT_NAME")), - maxRows: ymlConfig.UInt("maxRows", 3), } return &settings diff --git a/modules/resourceusage/settings.go b/modules/resourceusage/settings.go index 7e0ebae2..e4af68d8 100644 --- a/modules/resourceusage/settings.go +++ b/modules/resourceusage/settings.go @@ -11,14 +11,14 @@ const ( ) type Settings struct { - common *cfg.Common + common *cfg.Common cpuCombined bool } func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings { settings := Settings{ - common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig), - cpuCombined: ymlConfig.UBool("cpuCombined"), + common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig), + cpuCombined: ymlConfig.UBool("cpuCombined", false), } return &settings diff --git a/modules/todoist/keyboard.go b/modules/todoist/keyboard.go index b6cc2134..05ccd93b 100644 --- a/modules/todoist/keyboard.go +++ b/modules/todoist/keyboard.go @@ -5,17 +5,17 @@ import "github.com/gdamore/tcell" func (widget *Widget) initializeKeyboardControls() { widget.InitializeCommonControls(widget.Refresh) + widget.SetKeyboardChar("c", widget.Close, "Close item") widget.SetKeyboardChar("d", widget.Delete, "Delete item") + widget.SetKeyboardChar("h", widget.PrevSource, "Select previous project") widget.SetKeyboardChar("j", widget.Prev, "Select previous item") widget.SetKeyboardChar("k", widget.Next, "Select next item") - widget.SetKeyboardChar("h", widget.PrevSource, "Select previous project") - widget.SetKeyboardChar("c", widget.Close, "Close item") widget.SetKeyboardChar("l", widget.NextSource, "Select next project") widget.SetKeyboardChar("u", widget.Unselect, "Clear selection") widget.SetKeyboardKey(tcell.KeyDown, widget.Next, "Select next item") - widget.SetKeyboardKey(tcell.KeyUp, widget.Prev, "Select previous item") widget.SetKeyboardKey(tcell.KeyEsc, widget.Unselect, "Clear selection") widget.SetKeyboardKey(tcell.KeyLeft, widget.PrevSource, "Select previous project") widget.SetKeyboardKey(tcell.KeyRight, widget.NextSource, "Select next project") + widget.SetKeyboardKey(tcell.KeyUp, widget.Prev, "Select previous item") } diff --git a/modules/trello/settings.go b/modules/trello/settings.go index aa36a7dc..ab9d4381 100644 --- a/modules/trello/settings.go +++ b/modules/trello/settings.go @@ -27,7 +27,7 @@ func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *co common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig), accessToken: ymlConfig.UString("accessToken", ymlConfig.UString("apikey", os.Getenv("WTF_TRELLO_ACCESS_TOKEN"))), - apiKey: ymlConfig.UString("apiKey", os.Getenv("WTF_TRELLO_APP_KEY")), + apiKey: ymlConfig.UString("apiKey", os.Getenv("WTF_TRELLO_API_KEY")), board: ymlConfig.UString("board"), username: ymlConfig.UString("username"), }