Skip to content
This repository has been archived by the owner on Mar 3, 2021. It is now read-only.

golangci-lint does not depend on SDK libs #51

Closed
terinjokes opened this issue Mar 12, 2019 · 2 comments
Closed

golangci-lint does not depend on SDK libs #51

terinjokes opened this issue Mar 12, 2019 · 2 comments
Assignees

Comments

@terinjokes
Copy link

The golangci-lint rule does not depend on the SDK libraries. This results in a warning from govet (and possibly other linters):

WARN [runner] Can't run linter govet: can't typecheck package: can't init std types: import of type fmt.Stringer failed: can't find import: fmt

By adding depset(sdk.libs) to the transitive dependencies list the compiled libraries are added to execution directory and everything is happy.

transitive_depsets = [
depset(sdk.srcs),
depset(sdk.tools),
]

terinjokes added a commit to terinjokes/bazel-tools that referenced this issue Mar 12, 2019
This changeset adds two transitive dependencies to the golangci-lint rules:

1. The compiled libraries from the Go SDK, to allow the `govet` linter
   to run without a warning that it can't initialize the standard
   library.
2. The `go` binary from the configured SDK, to ensure the linter always
   uses the same Go binary as the rest of the Bazel build. This also
   allows this rule to execute in environments (or sandboxes) that
   otherwise don't have Go installed.

Bug: atlassian#50
Bug: atlassian#51
@ash2k
Copy link
Contributor

ash2k commented Mar 21, 2019

@terinjokes if you send a PR I'll happily merge it. Also, sign the CLA please if you do so.

@terinjokes
Copy link
Author

terinjokes commented Mar 21, 2019 via email

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

2 participants