-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
golangci-lint
builds skipped packages even when they aren't being analyzed
#489
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
Comments
Correction: this issue is not restricted to When I run
It appears that I've also checked |
It would also be helpful if the |
Any updates on this issue? We're running in the same issue, |
Hi, thank you for the issue!
|
I'm getting a long error like:
|
Now I got a total failure to lint anything with the newest version. Using v1.8.1 works fine. Seems to fail on our tools/ -directory with several script-like .go -files that I run using go run. tools/ cannot be built as a package, but do I really need to put each file in their own directory since tools/ cannot be skipped? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
adding stale label is good and prudent, but closing unfixed issues feels wrong |
@jirfag could you clarify what you meant by this? I've tried a few times to find out what you meant here and to look at that library to see if there's a way to build individual packages, but I can't find anything about a module named |
Not sure if this is an issue with
megacheck
orgolangci-lint
. Hoping to get some clarity on where to look!Please include the following information:
golangci-lint --version
(or git commit if you don't use binary distribution)git commit
de1d1ad903cdfdfc577ecb08d5027576e70ed2f0
cat .golangci.yml
go version && go env
golangci-lint run -v
Here's the situation for reproducing: I have a (
.gitignored
) foldertmp/
in my repository, where I keep a number of sample go programs. There are many files in the same directory withpackage main
andfunc main()
. You can see early in the verbose output a message that:INFO [loader] Packages that do not compile: [github.com/GetTerminus/ads-ttd/tmp]
meaning that
golangci-lint
is attempting and failing to compile thetmp
folder even though it's been ignored. Later,megacheck
panics. All other linters I've tried work fine regardless of the contents of mytmp
folder (although they do all print thedoes not compile
message.If I change the contents of
tmp
to be a valid compilable go package, the linter runs fine. If I change the contents to contain invalid go code, but for a reason other than multiple declarations offunc main()
, I still see the "does not compile" message, butmegacheck
does not panic. Only when one of my folders contains a redeclared function does themegacheck
panic occur, but it occurs even when the problem package is ignored.I have not been able to reproduce any of this behavior using
megacheck
directly, although the verbose logging doesn't tell me whatmegacheck
command is actually be executed, so that's hardly surprising. I also noticed after writing this issue report thatmegacheck
is currently deprecated, but it remains among the default linters forgolangci-lint
. Since it's officially deprecated, shouldn't it be disabled by default?The text was updated successfully, but these errors were encountered: