You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
extension/src: remove default setting for "go.lintTool"
The "lintTool" will be the source of truth indicating which tool
will be run as linter. vscode-go will now execute the exactly
tool based on this setting without any hidden yield logic.
Previously, the default value for "go.lintTool" is "staticcheck",
vscode-go have special logic that yield the linter functionality
to gopls if the lint tool is staticcheck and gopls staticheck is
enabled. It confuses the user which tool will be executed.
This CL removes this default option from "go.lintTool", consider
the new default as "". An empty lintTool indicates the user does
not want any linter to run from the extension.
This CL also change the description of "go.lintTool" to the lint
tool in addition to gopls, also mention in the description that
the linting functionality provided by gopls (the language server)
can be configured in a seprate setting.
To eliminate further confusions, a validation logic will be
triggered when gopls or go configuration changed: if "staticcheck"
is chosen as lintTool and gopls staticcheck is enabled. Warning
will be sent to user to disable one of them to avoid duplicate
diagnostics.
Alternative considered: introduce "gopls" as default lintTool.
For #3862
Change-Id: Ia00ca115ca7ec34315043ad61517b5cdfb9ca1ed
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/709035
Reviewed-by: Madeline Kalil <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Specifies an additional client-side linting tool that should be run by the Go extension. By default (unset), no additional linter is run. This feature is additional to diagnostics reported by the language server, gopls. Since Gopls incorporates the entire staticcheck analyzer suite, it is typically unnecessary to run the staticcheck tool as well. To configure gopls's linting, see the 'gopls.ui.diagnostic' settings.<br/>
383
+
Allowed Options:
384
+
385
+
*`staticcheck`: Run `staticcheck`.
386
+
*`golint`: Run `golint`.
387
+
*`golangci-lint`: Run `golangci-lint` v1.
388
+
*`golangci-lint-v2`: Run `golangci-lint` v2.
389
+
*`revive`: Run `revive`.
384
390
385
-
Default: `"staticcheck"`
386
391
### `go.logging.level (deprecated)`
387
392
388
393
This setting is deprecated. Use 'Developer: Set Log Level...' command to control logging level instead.
Copy file name to clipboardExpand all lines: extension/package.json
+8-2Lines changed: 8 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1182,15 +1182,21 @@
1182
1182
},
1183
1183
"go.lintTool": {
1184
1184
"type": "string",
1185
-
"default": "staticcheck",
1186
-
"description": "Specifies Lint tool name.",
1185
+
"description": "Specifies an additional client-side linting tool that should be run by the Go extension. By default (unset), no additional linter is run. This feature is additional to diagnostics reported by the language server, gopls. Since Gopls incorporates the entire staticcheck analyzer suite, it is typically unnecessary to run the staticcheck tool as well. To configure gopls's linting, see the 'gopls.ui.diagnostic' settings.",
constmessage=`Warning: staticcheck is configured to run both client side (go.lintTool=staticcheck) and server side (gopls.ui.diagnostic.staticcheck=true).
0 commit comments