Skip to content
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

chore: demonstrate golangci-lint not working with deps #145

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

srabraham
Copy link
Contributor

@srabraham srabraham commented Feb 9, 2024

Steps to reproduce:

  1. Check out this repo/branch
  2. cd example
  3. bazel lint src:hello_go

Expected result would be successful linting. Actual is below. This seems to come about because the go_binary depends on a go_library

this is a demo of #129

INFO: Analyzed target //src:hello_go (0 packages loaded, 0 targets configured).
INFO: From golangcilint src/golangcilint.hello_go.aspect_rules_lint.report:
level=warning msg="[runner] Can't run linter goanalysis_metalinter: buildir: failed to load package : could not load export data: no export data for "gopher""
level=error msg="Running error: 1 error occurred:\n\t* can't run linter goanalysis_metalinter: buildir: failed to load package : could not load export data: no export data for "gopher"\n\n"

I get an error like below when I run
bazel lint src:hello_go
as a result of the go_binary depending on another go target

this is a demo of aspect-build#129

INFO: Analyzed target //src:hello_go (0 packages loaded, 0 targets configured).
INFO: From golangcilint src/golangcilint.hello_go.aspect_rules_lint.report:
level=warning msg="[runner] Can't run linter goanalysis_metalinter: buildir: failed to load package : could not load export data: no export data for \"gopher\""
level=error msg="Running error: 1 error occurred:\n\t* can't run linter goanalysis_metalinter: buildir: failed to load package : could not load export data: no export data for \"gopher\"\n\n"
@alexeagle alexeagle force-pushed the 2024-02-09-golangci_lint-demo-bug branch from ecacb26 to 6c633ef Compare April 7, 2024 17:23
However this isn't sufficient yet for the Go tool to locate these files
@alexeagle
Copy link
Member

note, #207 killed golangci-lint for now, happy to keep this PR open for the repro when it's time to try again

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

Successfully merging this pull request may close these issues.

2 participants