Skip to content

style: extract jetbrains goconst literals to constants - #1042

Merged
skevetter merged 2 commits into
mainfrom
lint-fixer/jetbrains-goconst
Aug 18, 2026
Merged

style: extract jetbrains goconst literals to constants#1042
skevetter merged 2 commits into
mainfrom
lint-fixer/jetbrains-goconst

Conversation

@devsy-app

@devsy-app devsy-app Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Linter: golangci-lintgoconst 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:

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:ci0 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.

## 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.
@netlify

netlify Bot commented Aug 14, 2026

Copy link
Copy Markdown

Deploy Preview for images-devsy-sh canceled.

Name Link
🔨 Latest commit 61f4289
🔍 Latest deploy log https://app.netlify.com/projects/images-devsy-sh/deploys/6a83dac4a1617e0008edf1cc

@netlify

netlify Bot commented Aug 14, 2026

Copy link
Copy Markdown

Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit 61f4289
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6a83dac453a4af0008a1ad33

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

AI Reviewer: run a review on demand. To trigger the first review automatically, go to your organization or repository integration settings. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@skevetter
skevetter marked this pull request as ready for review August 18, 2026 04:08
@mergify

mergify Bot commented Aug 18, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@skevetter
skevetter merged commit 6be2724 into main Aug 18, 2026
78 checks passed
@skevetter
skevetter deleted the lint-fixer/jetbrains-goconst branch August 18, 2026 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant