golangci-lint-lsp doesn't report anything #14078
-
Summarygolangci-lint w/ golangci-lint-langserver fail to report any linter errors in Helix. Reproduction StepsVersions:
Helix Go language config: [[language]]
name = "go"
auto-format = true
formatter = { command = "goimports" }
language-servers = ["gopls", "golangci-lint-lsp", "typos"]
[language-server.golangci-lint-lsp.config]
command = ["golangci-lint", "run", "--output.json.path", "stdout", "--show-stats=false", "--issues-exit-code=1"] Golangci-lint config: version = "2"
[linters]
default = "standard"
enable = [ "unparam" ]
[linters.settings.unparam]
check-exported = true Go program with linter error (should report errcheck on Close line): package main
import "os"
func main() {
fp, err := os.Open("no-lint.go")
if err != nil {
panic(err)
}
fp.Close() // should report errcheck linter error
} Helix log~/.cache/helix/helix.log
PlatformLinux Terminal Emulatoralacritty 0.11.0 Installation Methodflox (nixpkg wrapper, similar to devenv) Helix VersionHelix 25.07.01 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
TLDR; ~/.golangci.toml was a sym-link and its was using the linked-to file's path in the output. Eliminating the sym-link fixes the issue. I noticed something odd when poking at this today. I have my default golangci-lint config at ~/.golangci.toml, but it is a sym-link to the file in my local dotfiles repo. When I run golangci-lint on the command line, with the above example in ~/tmp, I get the output... $ golangci-lint run no-lint.go
../../../tmp/no-lint.go:10:10: Error return value of `fp.Close` is not checked (errcheck)
fp.Close()
^
1 issues:
* errcheck: 1 The So I've resolved this issue by changing my setup to not have that link. |
Beta Was this translation helpful? Give feedback.
TLDR; ~/.golangci.toml was a sym-link and its was using the linked-to file's path in the output. Eliminating the sym-link fixes the issue.
I noticed something odd when poking at this today. I have my default golangci-lint config at ~/.golangci.toml, but it is a sym-link to the file in my local dotfiles repo. When I run golangci-lint on the command line, with the above example in ~/tmp, I get the output...
The
../../../tmp/
part of the path was odd and I figured out that it was using the path of the linked-to .golangci.toml …