From c527d438889656372374ba6280f4eb6c4495e270 Mon Sep 17 00:00:00 2001 From: "devsy-app[bot]" <277138668+devsy-app[bot]@users.noreply.github.com> Date: Fri, 14 Aug 2026 10:07:19 +0000 Subject: [PATCH] style: extract jetbrains goconst literals to constants MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Linter: `golangci-lint` → `goconst` category. Fix method: mechanical (extract shared string literals into named constants). ## Findings fixed The JetBrains IDE package (`pkg/ide/jetbrains/`) had `goconst` findings for four string literals repeated identically across all 10 IDE definition files (goland, intellij, phpstorm, clion, dataspell, pycharm, rider, rubymine, rustrover, webstorm), plus the version-default comparison in `generic.go`: - `"The version for the binary"` — 10 occurrences - `"latest"` (VersionOption default) — 11 occurrences - `"The download url for the arm64 server binary"` — 10 occurrences - `"The download url for the amd64 server binary"` — 10 occurrences ## Change Introduced four unexported constants in `pkg/ide/jetbrains/generic.go` and referenced them everywhere the literals previously appeared: ```go versionOptionDescription = "The version for the binary" versionOptionDefault = "latest" downloadArm64OptionDescription = "The download url for the arm64 server binary" downloadAmd64OptionDescription = "The download url for the amd64 server binary" ``` No behavioral change — the option descriptions and default values are byte-for-byte identical to before. 41 occurrences replaced across 11 files. ## Verification - `task cli:format` — clean (gci/gofumpt/golines re-aligned the const block). - `task cli:lint:ci` — **0 issues** (no new findings introduced by the patch). - `task cli:lint` (full) — confirmed the jetbrains `goconst` findings are cleared; no `goconst`/`lll` findings remain in any `pkg/ide/jetbrains/*.go` file. - `task cli:test` — passes (the only failures are the pre-existing `pkg/git` `TestRepoClone*` stale-assertion failures on `origin/main`, unrelated to this change; verified they fail identically on a clean checkout). - `go build ./pkg/ide/jetbrains/` — builds cleanly. This PR was created by an AI agent as part of an automated daily lint fix job. --- pkg/ide/jetbrains/clion.go | 8 ++++---- pkg/ide/jetbrains/dataspell.go | 8 ++++---- pkg/ide/jetbrains/generic.go | 7 ++++++- pkg/ide/jetbrains/goland.go | 8 ++++---- pkg/ide/jetbrains/intellij.go | 8 ++++---- pkg/ide/jetbrains/phpstorm.go | 8 ++++---- pkg/ide/jetbrains/pycharm.go | 8 ++++---- pkg/ide/jetbrains/rider.go | 8 ++++---- pkg/ide/jetbrains/rubymine.go | 8 ++++---- pkg/ide/jetbrains/rustrover.go | 8 ++++---- pkg/ide/jetbrains/webstorm.go | 8 ++++---- 11 files changed, 46 insertions(+), 41 deletions(-) diff --git a/pkg/ide/jetbrains/clion.go b/pkg/ide/jetbrains/clion.go index bb330ffb9..ae7b950fa 100644 --- a/pkg/ide/jetbrains/clion.go +++ b/pkg/ide/jetbrains/clion.go @@ -14,16 +14,16 @@ const ( var CLionOptions = ide.Options{ VersionOption: { Name: VersionOption, - Description: "The version for the binary", - Default: "latest", + Description: versionOptionDescription, + Default: versionOptionDefault, }, DownloadArm64Option: { Name: DownloadArm64Option, - Description: "The download url for the arm64 server binary", + Description: downloadArm64OptionDescription, }, DownloadAmd64Option: { Name: DownloadAmd64Option, - Description: "The download url for the amd64 server binary", + Description: downloadAmd64OptionDescription, }, } diff --git a/pkg/ide/jetbrains/dataspell.go b/pkg/ide/jetbrains/dataspell.go index 713a4c55f..2e1a85e10 100644 --- a/pkg/ide/jetbrains/dataspell.go +++ b/pkg/ide/jetbrains/dataspell.go @@ -14,16 +14,16 @@ const ( var DataSpellOptions = ide.Options{ VersionOption: { Name: VersionOption, - Description: "The version for the binary", - Default: "latest", + Description: versionOptionDescription, + Default: versionOptionDefault, }, DownloadArm64Option: { Name: DownloadArm64Option, - Description: "The download url for the arm64 server binary", + Description: downloadArm64OptionDescription, }, DownloadAmd64Option: { Name: DownloadAmd64Option, - Description: "The download url for the amd64 server binary", + Description: downloadAmd64OptionDescription, }, } diff --git a/pkg/ide/jetbrains/generic.go b/pkg/ide/jetbrains/generic.go index 3912137f8..e027f7a82 100644 --- a/pkg/ide/jetbrains/generic.go +++ b/pkg/ide/jetbrains/generic.go @@ -27,6 +27,11 @@ const ( VersionOption = "VERSION" DownloadAmd64Option = "DOWNLOAD_AMD64" DownloadArm64Option = "DOWNLOAD_ARM64" + + versionOptionDescription = "The version for the binary" + versionOptionDefault = "latest" + downloadArm64OptionDescription = "The download url for the arm64 server binary" + downloadAmd64OptionDescription = "The download url for the amd64 server binary" ) func getLatestDownloadURL(code string, platform string) string { @@ -42,7 +47,7 @@ func getDownloadURLs( ) (string, string) { version := options.GetValue(values, VersionOption) var amd64Download, arm64Download string - if version == "latest" { + if version == versionOptionDefault { amd64Download = getLatestDownloadURL(productCode, "linux") arm64Download = getLatestDownloadURL(productCode, "linuxARM64") } else { diff --git a/pkg/ide/jetbrains/goland.go b/pkg/ide/jetbrains/goland.go index be961ff24..27ed2e4a0 100644 --- a/pkg/ide/jetbrains/goland.go +++ b/pkg/ide/jetbrains/goland.go @@ -14,16 +14,16 @@ const ( var GolandOptions = ide.Options{ VersionOption: { Name: VersionOption, - Description: "The version for the binary", - Default: "latest", + Description: versionOptionDescription, + Default: versionOptionDefault, }, DownloadArm64Option: { Name: DownloadArm64Option, - Description: "The download url for the arm64 server binary", + Description: downloadArm64OptionDescription, }, DownloadAmd64Option: { Name: DownloadAmd64Option, - Description: "The download url for the amd64 server binary", + Description: downloadAmd64OptionDescription, }, } diff --git a/pkg/ide/jetbrains/intellij.go b/pkg/ide/jetbrains/intellij.go index 6e889b9c8..11c83793e 100644 --- a/pkg/ide/jetbrains/intellij.go +++ b/pkg/ide/jetbrains/intellij.go @@ -14,16 +14,16 @@ const ( var IntellijOptions = ide.Options{ VersionOption: { Name: VersionOption, - Description: "The version for the binary", - Default: "latest", + Description: versionOptionDescription, + Default: versionOptionDefault, }, DownloadArm64Option: { Name: DownloadArm64Option, - Description: "The download url for the arm64 server binary", + Description: downloadArm64OptionDescription, }, DownloadAmd64Option: { Name: DownloadAmd64Option, - Description: "The download url for the amd64 server binary", + Description: downloadAmd64OptionDescription, }, } diff --git a/pkg/ide/jetbrains/phpstorm.go b/pkg/ide/jetbrains/phpstorm.go index f7437df06..aeb59faa3 100644 --- a/pkg/ide/jetbrains/phpstorm.go +++ b/pkg/ide/jetbrains/phpstorm.go @@ -14,16 +14,16 @@ const ( var PhpStormOptions = ide.Options{ VersionOption: { Name: VersionOption, - Description: "The version for the binary", - Default: "latest", + Description: versionOptionDescription, + Default: versionOptionDefault, }, DownloadArm64Option: { Name: DownloadArm64Option, - Description: "The download url for the arm64 server binary", + Description: downloadArm64OptionDescription, }, DownloadAmd64Option: { Name: DownloadAmd64Option, - Description: "The download url for the amd64 server binary", + Description: downloadAmd64OptionDescription, }, } diff --git a/pkg/ide/jetbrains/pycharm.go b/pkg/ide/jetbrains/pycharm.go index b9ef4b710..99aec3b6f 100644 --- a/pkg/ide/jetbrains/pycharm.go +++ b/pkg/ide/jetbrains/pycharm.go @@ -14,16 +14,16 @@ const ( var PyCharmOptions = ide.Options{ VersionOption: { Name: VersionOption, - Description: "The version for the binary", - Default: "latest", + Description: versionOptionDescription, + Default: versionOptionDefault, }, DownloadArm64Option: { Name: DownloadArm64Option, - Description: "The download url for the arm64 server binary", + Description: downloadArm64OptionDescription, }, DownloadAmd64Option: { Name: DownloadAmd64Option, - Description: "The download url for the amd64 server binary", + Description: downloadAmd64OptionDescription, }, } diff --git a/pkg/ide/jetbrains/rider.go b/pkg/ide/jetbrains/rider.go index 9b052c3de..7fa6117cb 100644 --- a/pkg/ide/jetbrains/rider.go +++ b/pkg/ide/jetbrains/rider.go @@ -14,16 +14,16 @@ const ( var RiderOptions = ide.Options{ VersionOption: { Name: VersionOption, - Description: "The version for the binary", - Default: "latest", + Description: versionOptionDescription, + Default: versionOptionDefault, }, DownloadArm64Option: { Name: DownloadArm64Option, - Description: "The download url for the arm64 server binary", + Description: downloadArm64OptionDescription, }, DownloadAmd64Option: { Name: DownloadAmd64Option, - Description: "The download url for the amd64 server binary", + Description: downloadAmd64OptionDescription, }, } diff --git a/pkg/ide/jetbrains/rubymine.go b/pkg/ide/jetbrains/rubymine.go index 13fdfe5d4..c3f825750 100644 --- a/pkg/ide/jetbrains/rubymine.go +++ b/pkg/ide/jetbrains/rubymine.go @@ -14,16 +14,16 @@ const ( var RubyMineOptions = ide.Options{ VersionOption: { Name: VersionOption, - Description: "The version for the binary", - Default: "latest", + Description: versionOptionDescription, + Default: versionOptionDefault, }, DownloadArm64Option: { Name: DownloadArm64Option, - Description: "The download url for the arm64 server binary", + Description: downloadArm64OptionDescription, }, DownloadAmd64Option: { Name: DownloadAmd64Option, - Description: "The download url for the amd64 server binary", + Description: downloadAmd64OptionDescription, }, } diff --git a/pkg/ide/jetbrains/rustrover.go b/pkg/ide/jetbrains/rustrover.go index 295617145..798fffe63 100644 --- a/pkg/ide/jetbrains/rustrover.go +++ b/pkg/ide/jetbrains/rustrover.go @@ -14,16 +14,16 @@ const ( var RustRoverOptions = ide.Options{ VersionOption: { Name: VersionOption, - Description: "The version for the binary", - Default: "latest", + Description: versionOptionDescription, + Default: versionOptionDefault, }, DownloadArm64Option: { Name: DownloadArm64Option, - Description: "The download url for the arm64 server binary", + Description: downloadArm64OptionDescription, }, DownloadAmd64Option: { Name: DownloadAmd64Option, - Description: "The download url for the amd64 server binary", + Description: downloadAmd64OptionDescription, }, } diff --git a/pkg/ide/jetbrains/webstorm.go b/pkg/ide/jetbrains/webstorm.go index f4d481bdf..dfce6cce0 100644 --- a/pkg/ide/jetbrains/webstorm.go +++ b/pkg/ide/jetbrains/webstorm.go @@ -14,16 +14,16 @@ const ( var WebStormOptions = ide.Options{ VersionOption: { Name: VersionOption, - Description: "The version for the binary", - Default: "latest", + Description: versionOptionDescription, + Default: versionOptionDefault, }, DownloadArm64Option: { Name: DownloadArm64Option, - Description: "The download url for the arm64 server binary", + Description: downloadArm64OptionDescription, }, DownloadAmd64Option: { Name: DownloadAmd64Option, - Description: "The download url for the amd64 server binary", + Description: downloadAmd64OptionDescription, }, }