1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-03 00:57:52 +02:00

Update VS Code settings to enable staticcheck linter

... and configure it to run the same checks as golangci-lint.

It may seem redundant to have two linter checks enabled; however, there are
reasons to have both. golangci-lint is what we are running on CI, and it has a
lot more linters than gopls, so we want to run it locally too to get the same
coverage. The linter that is built into gopls is only staticcheck, so that's
redundant; but it has the advantage that the warnings appear a bit faster
(golangci-lint runs only on save, and with a bit of delay), and in particular it
provides quick fixes for some of the checks, which is quite convenient.
This commit is contained in:
Stefan Haller
2025-06-30 10:12:18 +02:00
parent 9b54dc0b28
commit d9e299c1df

20
.vscode/settings.json vendored
View File

@ -1,6 +1,26 @@
{ {
"gopls": { "gopls": {
"formatting.gofumpt": true, "formatting.gofumpt": true,
"ui.diagnostic.staticcheck": true,
"ui.diagnostic.analyses": {
// This list must match the one in .golangci.yml
"SA1019": false,
"ST1003": false,
"ST1005": false,
"ST1006": false,
"QF1001": false,
"QF1003": false,
"QF1008": false,
"ST1000": false,
"ST1020": false,
"ST1021": false,
"ST1022": false,
// Dot imports; this warning is enabled in .golangci.yml, but with an
// extra dot-import-whitelist config. Because I couldn't figure out how to
// specify that extra config for gopls, I'm disabling the check altogether
// here.
"ST1001": false,
},
}, },
"go.alternateTools": { "go.alternateTools": {
"golangci-lint-v2": "${workspaceFolder}/.bin/golangci-lint", "golangci-lint-v2": "${workspaceFolder}/.bin/golangci-lint",