Skip to content
This repository has been archived by the owner on Apr 10, 2019. It is now read-only.

gometalinter fails for single file #119

Closed
sijad opened this issue Apr 15, 2016 · 7 comments
Closed

gometalinter fails for single file #119

sijad opened this issue Apr 15, 2016 · 7 comments

Comments

@sijad
Copy link
Contributor

sijad commented Apr 15, 2016

when I try to run gometalinter /paht/to/myfile.go I get something like this:

WARNING: failed to execute linter varcheck .: fork/exec /home/gopath/bin/varcheck: not a directory
WARNING: failed to execute linter gotype -e  .: fork/exec /home/gopath/bin/gotype: not a directory
WARNING: failed to execute linter unconvert .: fork/exec /home/gopath/bin/unconvert: not a directory
WARNING: failed to execute linter structcheck  .: fork/exec /home/gopath/bin/structcheck: not a directory
WARNING: failed to execute linter goconst -min-occurrences 3 .: fork/exec /home/gopath/bin/goconst: not a directory
WARNING: failed to execute linter go tool vet ./*.go: fork/exec /usr/local/bin/go: not a directory
WARNING: failed to execute linter gocyclo -over 10 .: fork/exec /home/gopath/bin/gocyclo: not a directory
WARNING: failed to execute linter dupl -plumbing -threshold 50 ./*.go: fork/exec /home/gopath/bin/dupl: not a directory
WARNING: failed to execute linter ineffassign -n .: fork/exec /home/gopath/bin/ineffassign: not a directory
WARNING: failed to execute linter go tool vet --shadow ./*.go: fork/exec /usr/local/bin/go: not a directory
WARNING: failed to execute linter golint -min_confidence 0.800000 .: fork/exec /home/gopath/bin/golint: not a directory
WARNING: failed to execute linter aligncheck .: fork/exec /home/gopath/bin/aligncheck: not a directory
WARNING: failed to execute linter deadcode .: fork/exec /home/gopath/bin/deadcode: not a directory
WARNING: failed to execute linter interfacer ./: fork/exec /home/gopath/bin/interfacer: not a directory
WARNING: failed to execute linter errcheck -abspath .: fork/exec /home/gopath/bin/errcheck: not a directory
@alecthomas
Copy link
Owner

gometalinter doesn't support linting individual files. You can see this in the command line help:

Args:
  [<path>]  Directory to lint. Defaults to ".". <path>/... will recurse.

@alecthomas
Copy link
Owner

That is an odd error though...

@sijad
Copy link
Contributor Author

sijad commented Apr 15, 2016

Most linters can be run over a single file, sometimes it can help to have this option to check only one file

@sijad
Copy link
Contributor Author

sijad commented Apr 15, 2016

can I PR?

@lukehoban
Copy link

Agreed that it would be great to support running over just a single file. For integration with tools that run linters on saving a file, it would be really wasteful to always have to compute lint results for the entire package. As @sijad mentions, most of the common linters for Go support running on a single file - would be great to be able to do the same with gometalinter.

@alecthomas
Copy link
Owner

I don't really mind one way or the other, so if the change is minimal I'm happy for a PR.

@alecthomas
Copy link
Owner

BTW, I think there's some exaggeration or misunderstanding here. vim-go and SublimeLinter-contrib-gometalinter both do lint on save. In the latter case, it also supports live linting and is very reponsive. So practically speaking it's not an issue. Also, I think you'll find that the slower linters perform type resolution, which is necessarily cross-package and quite slow regardless.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants