Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Go lint started to pick up vendor folder. #1119

Closed
novembrea opened this issue Jul 27, 2017 · 14 comments
Closed

Go lint started to pick up vendor folder. #1119

novembrea opened this issue Jul 27, 2017 · 14 comments

Comments

@novembrea
Copy link

I can't pinpoint what is the reason for this because I didn't update vscode or gotools since the last time I've worked (this morning). And now my PROBLEMS tab is filled with thousands upon thousands of warnings from vendor folder.
Would you be so kind to direct me how I could go about solving this issue? Thanks.

Finished running tool: /home/nvma/.gvm/pkgsets/go1.7.3/nvma/bin/golint ./...
/home/nvma/work/go/src/github.com/nvma/project/vendor/github.com/corpix/uarand/uarand.go:1: package comment should be of the form "Package uarand ..."
/home/nvma/work/go/src/github.com/nvma/project/vendor/github.com/corpix/uarand/uarand.go:60: exported function New should have comment or be unexported
@hyacinthus
Copy link

same issues +1
can't find option to ignore this

@ramya-rao-a
Copy link
Contributor

@nvma @hyacinthus

Based on the logs it looks like you have go.lintOnSave set to workspace which is why it runs go lint ./... which picks up vendor folder.

As a workaround, you can set go.lintOnSave to package

I will look into skipping vendor folders when linting workspace

@novembrea
Copy link
Author

@ramya-rao-a What's puzzling is that it's been working like this ever since I've switched to vscode and discovered this wonderful plugin. I've been using glide to handle dependencies and vscode-go been working fine with go lint ./... and vendor folder since the first day I started to use it.
So I naturally assumed that something had to happen before things stopped working.

@ramya-rao-a
Copy link
Contributor

@nvma That's puzzling to me too. Because this change to use ./... was in the previous update that was early June and not in the latest update that was released a few days ago :)

@novembrea
Copy link
Author

@ramya-rao-a is it possible that I didn't update the gotools and vscode-go extension since early June while sticking to the latest versions of vscode every time it was released?

@ramya-rao-a
Copy link
Contributor

that can be the case

@novembrea
Copy link
Author

novembrea commented Jul 28, 2017

I see, thanks for your time, @ramya-rao-a I will have to stick to a half-measure of scoping linter to a package level keeping the hope that optional ignoreDirectory could be introduced to linting options in the near future. Cheers and thank you for your work on this stellar extension, I didn't realise I relied on it so much :)

@ramya-rao-a
Copy link
Contributor

When you say ignoreDirectory do you mean that's flag on the linter or you are just referring to the fix I would be making?

@ramya-rao-a
Copy link
Contributor

I have pushed the fix to master.

Until I release an update, here is what you can do

screen shot 2017-07-28 at 2 24 48 pm

@atomi
Copy link

atomi commented Aug 30, 2017

Just a heads up. It looks like you added a PR to prevent workspace symbols from picking up vendor/ #700 but the version from Go-latest.vsix is including all symbols, including those in vendor/.

@ramya-rao-a
Copy link
Contributor

@atomi You need to set "go.gotoSymbol.ignoreFolders": ["vendor"] to exclude vendor folder from the symbol search

@ramya-rao-a
Copy link
Contributor

The fix for linting picking up vendor folder is now out in the latest update to the Go extension (0.6.64)

@douglarek
Copy link

douglarek commented Nov 18, 2017

@ramya-rao-a this issue will occur after debugging vendor codes without removing breakpoints when reopen vscode again.

@ramya-rao-a
Copy link
Contributor

@douglarek Please log a new issue with clear repro steps.

@microsoft microsoft locked and limited conversation to collaborators Nov 19, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants