Closed milosgajdos closed 8 months ago
Same here. ale
seems to do this: golangci-lint run file.go
Fixed that by adding let g:ale_go_golangci_lint_package=1
to my vimrc. This should be the default, honestly.
Fixed that by adding
let g:ale_go_golangci_lint_package=1
to my vimrc. This should be the default, honestly.
Ah, thanks, I did the same thing but forgot to come here to update this issue 😅
g:ale_go_golangci_lint_package is now enabled by default: https://github.com/dense-analysis/ale/pull/4730
Information
VIM version
Operating System:
What went wrong
ALE incorrectly marks
golangci-lint
typecheck
errors in the source file which otherwise pass the linter when linter is run manually.This happens when there is a
Go
package that contains more than one source file and thetypes
defined in each of the source files are shared between them.Reproducing the bug
Here are the
Go
source files whereALE
incorrectly reportstypecheck
issues:Create a new package
These are the contents of
foo/foo.go
andfoo/bar.go
open
foo/foo.go
and you get thisgolangci-lint
error:Running the linter manually on the cli works like charm
:ALEInfo