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

nogo: nilness: exclude files regex doesn't match multiple repositories #2686

Closed
jmeekhof opened this issue Oct 23, 2020 · 1 comment
Closed

Comments

@jmeekhof
Copy link

What version of rules_go are you using?

v0.24.4

http_archive(
    name = "io_bazel_rules_go",
    sha256 = "ac03931e56c3b229c145f1a8b2a2ad3e8d8f1af57e43ef28a26123362a1e3c7e",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.24.4/rules_go-v0.24.4.tar.gz",
        "https://github.com/bazelbuild/rules_go/releases/download/v0.24.4/rules_go-v0.24.4.tar.gz",
    ],
)

What version of gazelle are you using?

v0.22.2

http_archive(
   name = "bazel_gazelle",
   sha256 = "b85f48fa105c4403326e9525ad2b2cc437babaa6e15a3fc0b1dbab0ab064bc7c",
   urls = [
       "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.2/bazel-gazelle-v0.22.2.tar.gz",
       "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.2/bazel-gazelle-v0.22.2.tar.gz",
   ],
)

What version of Bazel are you using?

3.7.0

Does this issue reproduce with the latest releases of all the above?

Yes

What operating system and processor architecture are you using?

Mac

Any other potentially useful information about your toolchain?

What did you do?

I'm attempting to use the exclude_files directive to skip the analysis of a couple of external packages. What I'm finding is that I can only exclude one but not two paths. I want to exclude both com_github_ugorji_go_codec and in_gopkg_yaml_v2.

I'm attempting to skip nilness for both of these packages. I ran across the issue with the codec first so,

{
  "nilness": {
    "exclude_files": {
      "/com_github_ugorji_go_codec/": "Lots of nilness here"
    }
  }
}

This allows me to skip the nilness check for codec, but now I get a nilness error for my yaml package.

 {
 "nilness": {
    "exclude_files": {
      "/com_github_ugorji_go_codec/": "Lots of nilness here",
      "/in_gopkg_yaml_v2/": "Some here too"
    }
  }
}

What did you expect to see?

Here I was expecting to see a successful build.

What did you see instead?

Instead I saw the com_github_ugorji_go_codec error come back.

@jayconrod
Copy link
Contributor

The root cause of this is golang/go#31008. The nilness check doesn't include position information with its errors, so nogo doesn't know the filename and can't apply exclude_files.

I don't think there's anything to be done in rules_go. If that issue is fixed, this will start working.

@jayconrod jayconrod changed the title nogo exclude files regex doesn't match multiple repositories nogo: nilness: exclude files regex doesn't match multiple repositories Oct 23, 2020
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

No branches or pull requests

2 participants