From efe85ff4f56c270b3ca70ae4e863d7c7a3d0df9f Mon Sep 17 00:00:00 2001 From: Evan Simkowitz Date: Wed, 28 Aug 2024 10:59:08 -0700 Subject: [PATCH] enforce go fmt usage in vscode --- .vscode/settings.json | 5 ++- pkg/waveobj/metaconsts.go | 73 +++++++++++++++---------------- pkg/wconfig/metaconsts.go | 59 ++++++++++++------------- pkg/wshrpc/wshclient/wshclient.go | 6 +-- 4 files changed, 71 insertions(+), 72 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 410b262cc..17dd10412 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -32,6 +32,9 @@ "[yaml]": { "editor.defaultFormatter": "esbenp.prettier-vscode", "editor.insertSpaces": true, - "editor.autoIndent": "keep", + "editor.autoIndent": "keep" + }, + "[go]": { + "editor.defaultFormatter": "golang.go" } } diff --git a/pkg/waveobj/metaconsts.go b/pkg/waveobj/metaconsts.go index a9d23d7ae..f6b4d60ef 100644 --- a/pkg/waveobj/metaconsts.go +++ b/pkg/waveobj/metaconsts.go @@ -6,54 +6,53 @@ package waveobj const ( - MetaKey_View = "view" + MetaKey_View = "view" - MetaKey_Controller = "controller" + MetaKey_Controller = "controller" - MetaKey_Title = "title" + MetaKey_Title = "title" - MetaKey_File = "file" + MetaKey_File = "file" - MetaKey_Url = "url" + MetaKey_Url = "url" - MetaKey_Connection = "connection" + MetaKey_Connection = "connection" - MetaKey_History = "history" - MetaKey_HistoryForward = "history:forward" + MetaKey_History = "history" + MetaKey_HistoryForward = "history:forward" - MetaKey_DisplayName = "display:name" - MetaKey_DisplayOrder = "display:order" + MetaKey_DisplayName = "display:name" + MetaKey_DisplayOrder = "display:order" - MetaKey_Icon = "icon" - MetaKey_IconColor = "icon:color" + MetaKey_Icon = "icon" + MetaKey_IconColor = "icon:color" - MetaKey_Frame = "frame" - MetaKey_FrameClear = "frame:*" - MetaKey_FrameBorderColor = "frame:bordercolor" - MetaKey_FrameBorderColor_Focused = "frame:bordercolor:focused" + MetaKey_Frame = "frame" + MetaKey_FrameClear = "frame:*" + MetaKey_FrameBorderColor = "frame:bordercolor" + MetaKey_FrameBorderColor_Focused = "frame:bordercolor:focused" - MetaKey_Cmd = "cmd" - MetaKey_CmdClear = "cmd:*" - MetaKey_CmdInteractive = "cmd:interactive" - MetaKey_CmdLogin = "cmd:login" - MetaKey_CmdRunOnStart = "cmd:runonstart" - MetaKey_CmdClearOnStart = "cmd:clearonstart" - MetaKey_CmdClearOnRestart = "cmd:clearonrestart" - MetaKey_CmdEnv = "cmd:env" - MetaKey_CmdCwd = "cmd:cwd" - MetaKey_CmdNoWsh = "cmd:nowsh" + MetaKey_Cmd = "cmd" + MetaKey_CmdClear = "cmd:*" + MetaKey_CmdInteractive = "cmd:interactive" + MetaKey_CmdLogin = "cmd:login" + MetaKey_CmdRunOnStart = "cmd:runonstart" + MetaKey_CmdClearOnStart = "cmd:clearonstart" + MetaKey_CmdClearOnRestart = "cmd:clearonrestart" + MetaKey_CmdEnv = "cmd:env" + MetaKey_CmdCwd = "cmd:cwd" + MetaKey_CmdNoWsh = "cmd:nowsh" - MetaKey_Bg = "bg" - MetaKey_BgClear = "bg:*" - MetaKey_BgOpacity = "bg:opacity" - MetaKey_BgBlendMode = "bg:blendmode" + MetaKey_Bg = "bg" + MetaKey_BgClear = "bg:*" + MetaKey_BgOpacity = "bg:opacity" + MetaKey_BgBlendMode = "bg:blendmode" - MetaKey_TermClear = "term:*" - MetaKey_TermFontSize = "term:fontsize" - MetaKey_TermFontFamily = "term:fontfamily" - MetaKey_TermMode = "term:mode" - MetaKey_TermTheme = "term:theme" + MetaKey_TermClear = "term:*" + MetaKey_TermFontSize = "term:fontsize" + MetaKey_TermFontFamily = "term:fontfamily" + MetaKey_TermMode = "term:mode" + MetaKey_TermTheme = "term:theme" - MetaKey_Count = "count" + MetaKey_Count = "count" ) - diff --git a/pkg/wconfig/metaconsts.go b/pkg/wconfig/metaconsts.go index 688f5f347..2d8cb05d3 100644 --- a/pkg/wconfig/metaconsts.go +++ b/pkg/wconfig/metaconsts.go @@ -6,41 +6,40 @@ package wconfig const ( - ConfigKey_AiClear = "ai:*" - ConfigKey_AiBaseURL = "ai:baseurl" - ConfigKey_AiApiToken = "ai:apitoken" - ConfigKey_AiName = "ai:name" - ConfigKey_AiModel = "ai:model" - ConfigKey_AiMaxTokens = "ai:maxtokens" - ConfigKey_AiTimeoutMs = "ai:timeoutms" + ConfigKey_AiClear = "ai:*" + ConfigKey_AiBaseURL = "ai:baseurl" + ConfigKey_AiApiToken = "ai:apitoken" + ConfigKey_AiName = "ai:name" + ConfigKey_AiModel = "ai:model" + ConfigKey_AiMaxTokens = "ai:maxtokens" + ConfigKey_AiTimeoutMs = "ai:timeoutms" - ConfigKey_TermClear = "term:*" - ConfigKey_TermFontSize = "term:fontsize" - ConfigKey_TermFontFamily = "term:fontfamily" - ConfigKey_TermDisableWebGl = "term:disablewebgl" + ConfigKey_TermClear = "term:*" + ConfigKey_TermFontSize = "term:fontsize" + ConfigKey_TermFontFamily = "term:fontfamily" + ConfigKey_TermDisableWebGl = "term:disablewebgl" - ConfigKey_WebClear = "web:*" - ConfigKey_WebOpenLinksInternally = "web:openlinksinternally" + ConfigKey_WebClear = "web:*" + ConfigKey_WebOpenLinksInternally = "web:openlinksinternally" - ConfigKey_BlockHeaderClear = "blockheader:*" - ConfigKey_BlockHeaderShowBlockIds = "blockheader:showblockids" + ConfigKey_BlockHeaderClear = "blockheader:*" + ConfigKey_BlockHeaderShowBlockIds = "blockheader:showblockids" - ConfigKey_AutoUpdateClear = "autoupdate:*" - ConfigKey_AutoUpdateEnabled = "autoupdate:enabled" - ConfigKey_AutoUpdateIntervalMs = "autoupdate:intervalms" - ConfigKey_AutoUpdateInstallOnQuit = "autoupdate:installonquit" + ConfigKey_AutoUpdateClear = "autoupdate:*" + ConfigKey_AutoUpdateEnabled = "autoupdate:enabled" + ConfigKey_AutoUpdateIntervalMs = "autoupdate:intervalms" + ConfigKey_AutoUpdateInstallOnQuit = "autoupdate:installonquit" - ConfigKey_WidgetClear = "widget:*" - ConfigKey_WidgetShowHelp = "widget:showhelp" + ConfigKey_WidgetClear = "widget:*" + ConfigKey_WidgetShowHelp = "widget:showhelp" - ConfigKey_WindowClear = "window:*" - ConfigKey_WindowTransparent = "window:transparent" - ConfigKey_WindowBlur = "window:blur" - ConfigKey_WindowOpacity = "window:opacity" - ConfigKey_WindowBgColor = "window:bgcolor" - ConfigKey_WindowReducedMotion = "window:reducedmotion" + ConfigKey_WindowClear = "window:*" + ConfigKey_WindowTransparent = "window:transparent" + ConfigKey_WindowBlur = "window:blur" + ConfigKey_WindowOpacity = "window:opacity" + ConfigKey_WindowBgColor = "window:bgcolor" + ConfigKey_WindowReducedMotion = "window:reducedmotion" - ConfigKey_TelemetryClear = "telemetry:*" - ConfigKey_TelemetryEnabled = "telemetry:enabled" + ConfigKey_TelemetryClear = "telemetry:*" + ConfigKey_TelemetryEnabled = "telemetry:enabled" ) - diff --git a/pkg/wshrpc/wshclient/wshclient.go b/pkg/wshrpc/wshclient/wshclient.go index 3aef251d8..023d4f23d 100644 --- a/pkg/wshrpc/wshclient/wshclient.go +++ b/pkg/wshrpc/wshclient/wshclient.go @@ -6,9 +6,9 @@ package wshclient import ( - "github.com/wavetermdev/thenextwave/pkg/wshutil" - "github.com/wavetermdev/thenextwave/pkg/wshrpc" "github.com/wavetermdev/thenextwave/pkg/waveobj" + "github.com/wavetermdev/thenextwave/pkg/wshrpc" + "github.com/wavetermdev/thenextwave/pkg/wshutil" ) // command "announce", wshserver.AnnounceCommand @@ -185,5 +185,3 @@ func TestCommand(w *wshutil.WshRpc, data string, opts *wshrpc.RpcOpts) error { _, err := sendRpcRequestCallHelper[any](w, "test", data, opts) return err } - -