-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Golang compilation errors still result in golangci-lint success result (0 exit) #276
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
issue still exist in version 1.18.0 |
@tpounds full example here:
|
according to this issue (fatih/vim-go#2533) vim-go was previously using the typecheck linter to prevent this behavior but that workaround is no longer working, since 95ec0cf |
@dcu Thanks for providing an example! I think there are a couple of areas where we could improve things.
Thoughts? /cc @jirfag |
I actually can't imagine that a compilation error isn't a lint error. My experience is that I use golangci-lint as a git pre-push hook. Sadly, I might push something that doesn't compile. When that happens, golangci-lint fails with non-zero exit code and the push happens anyway. |
I agree that a compilation error must result in error by default |
@rfay, @dcu Agreed, however, this is a breaking change in current behavior so it's likely we would want to bump major versions to introduce this change. Regardless I think it makes sense to expose this as a configurable option to allow current users to opt-in to the behavior now (1.x) and opt-out in the future (2.x). Thoughts? |
I know this is a relatively fresh issue, but Is there any approximate timeline for when such a feature would be available on 2.X? This bug makes it very difficult to use golangci-lint as an editor integration. |
This should be already fixed when we switched from warnings to errors for this. Feel free to reopen. |
golanci-lint v1.11.3 can run into a compilation failure and still return a 0 exit code, which is clearly the opposite of what we want.
golangci-lint run --out-format=line-number --disable-all --enable=gofmt --enable=govet --enable=errcheck --enable=staticcheck --enable=ineffassign --enable=varcheck --enable=deadcode ./junk/...
WARN [runner/staticcheck] Can't run megacheck because of compilation errors in packages [github.com/drud/junk.test]: -: junk/auth-ssh_test.go:15:2: cannot find package "github.com/stretchr/testify/assert" in any of: /usr/local/Cellar/go/1.11.2/libexec/src/github.com/stretchr/testify/assert (from $GOROOT) /Users/rfay/go/src/github.com/stretchr/testify/assert (from $GOPATH)
go version && go env
:golangci-lint run -v
(actuallygolangci-lint run -v --out-format=line-number --disable-all --enable=gofmt --enable=govet --enable=errcheck --enable=staticcheck --enable=ineffassign --enable=varcheck --enable=deadcode ./junk/...
(Exit value is 0 even though compilation failed)
The text was updated successfully, but these errors were encountered: