-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
x/tools/cmd/goimports: more feature-rich ignore file support #16417
Comments
Is it plausible for somebody to have *.go files under node_modules? If not, maybe we can just blacklist that name entirely, without configuration. We already blacklist some names (".git", ".hg", etc). Otherwise more configuration seems fine. |
Not in my case nope! Unless someone is trying to be clever using NPM to install Go code I can't see anyone doing it, should be fine to blacklist. |
CL https://golang.org/cl/25044 mentions this issue. |
Updates golang/go#16417 Change-Id: Ia4a5f997036274d09cca2ff10e500e403c1725ba Reviewed-on: https://go-review.googlesource.com/25044 Reviewed-by: Andrew Gerrand <[email protected]>
I think wildcards will solve problems of this kind in the future. |
@pi, indeed. But I was hoping to defer implementing that until there's enough evidence that it's really needed. It's more work for users and more complexity to document, and matching globs takes more time. If we can get 90% of the way there automatically by hard-coding all the common cases, it's easier and faster for everyone. So let's wait and see. The "node_modules" thing has been committed. |
Oh man, ~300ms now even with my .goimportsremoved removed, I guess that was the source of all pain for me haha thanks! |
300ms is still noticeable. Where is the time going? What OS and filesystem type? SSD? Under 200ms would be nicer. |
Given the lack of activity here, closing. |
Any chance of reopening this, we really want to have a way to exclude bazel-*. #35914 is more or less blocked on this. |
#35914 is blocked on someone coming up with a well-thought-out design for how the feature should work, not this bug. |
Yes,
I think the solution there, though, is that |
Please answer these questions before submitting your issue. Thanks!
go version
)?go version go1.6.2 darwin/amd64
go env
)?OSX
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
I use
go get
for non-Go packages as well, however this leads to many Node/client-side projects which have node_modules, and thus hundreds of thousands of directories.I'd love to add
node_modules
or similar into .goimportsignore and bypass all of those easily.for days. Arguably not really a goimports problem since I'm mis-using GOPATH, but I know quite a few people who do similar.
The text was updated successfully, but these errors were encountered: