Skip to content

docs: add note about golangci-lint v2 integration in VS Code #5768

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 26, 2025

Conversation

lvlcn-t
Copy link
Contributor

@lvlcn-t lvlcn-t commented Apr 26, 2025

Motivation

#5706 removed the link to vscode-go#3732 because it is resolved in the v0.47.2 pre-release of the extension.
However, the fix is not yet available for stable users — the next stable release (v0.48.0) is still pending.

This causes confusion for stable users of the extension who still encounter the issue with golangci-lint v2 integration, as they need to search for a fix.

Changes

Added a short note under the VS Code section of the integrations page to inform users that they may need to switch to the pre-release version of the vscode-go extension if they want golangci-lint v2 integration to work properly.

Commits

docs: add note about golangci-lint v2 integration in Visual Studio Code

This commit adds a note to the docs about how to integrate
golangci-lint v2 with VS Code since the Go extension's stable
version does not support it yet.

For more information on this, you can refer to the linked
vscode-go#3732 issue comment.

Signed-off-by: lvlcn-t [email protected]

Tests done

With the new note, the integration site looks like this:

image

This commit adds a note to the docs about how to integrate
golangci-lint v2 with VS Code since the Go extension's stable
version does not support it yet.

For more information on this, you can refer to the linked
[vscode-go#3732](golang/vscode-go#3732 (comment))
issue comment.

Signed-off-by: lvlcn-t <[email protected]>
Copy link

boring-cyborg bot commented Apr 26, 2025

Hey, thank you for opening your first Pull Request !

@CLAassistant
Copy link

CLAassistant commented Apr 26, 2025

CLA assistant check
All committers have signed the CLA.

@ldez ldez self-requested a review April 26, 2025 12:51
@ldez ldez added area: docs area: integrations Related to integrations and IDEs labels Apr 26, 2025
@ldez ldez added this to the v2-unreleased milestone Apr 26, 2025
Copy link
Member

@ldez ldez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ldez ldez merged commit 46b086a into golangci:main Apr 26, 2025
18 checks passed
@lvlcn-t lvlcn-t deleted the chore/vscode-integration-note branch April 27, 2025 19:48
@ldez ldez modified the milestones: v2-unreleased, v2.1 May 4, 2025
@shashankram
Copy link

@lvlcn-t Unfortunately the instructions in https://golangci-lint.run/welcome/integrations/#visual-studio-code do not work for golangci-lint v2 (github.com/golangci/golangci-lint/v2/cmd/[email protected]). Could you please document the min vscode version and exact config required?

    "go.lintTool": "golangci-lint",
    "go.lintFlags": [
        "--fast-only",
        "--path-mode=abs",
    ],

@ldez
Copy link
Member

ldez commented May 20, 2025

The instructions work for golangci-lint v2 (only), and the documentation also includes the minimum version of the VSCode extension (0.47.2).

@shashankram
Copy link

shashankram commented May 20, 2025

The instructions work for golangci-lint v2 (only), and the documentation also includes the minimum version of the VSCode extension (0.47.2).

I am using v0.47.2 (pre-release) and self installed golangci-lint

golangci-lint has version v2.1.6 built with go1.24.3 from (unknown, modified: ?, mod sum: "h1:LXqShFfAGM5BDzEOWD2SL1IzJAgUOqES/HRBsfKjI+w=") on (unknown)

Vscode still does not show the lint errors in the Problems tab that golangci-lint run does.

@ldez
Copy link
Member

ldez commented May 27, 2025

If you still have the problem, can you open a dedicated discussion?

And provide the following information:

Your settings.json.

code --version 
code --list-extensions --show-versions | grep 'golang.go@'
# OR if you don't have grep
code --list-extensions --show-versions
golangci-lint --version
go version

https://github.com/golangci/golangci-lint/discussions/categories/q-a

@golangci golangci locked as resolved and limited conversation to collaborators May 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: docs area: integrations Related to integrations and IDEs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants