rules_go icon indicating copy to clipboard operation
rules_go copied to clipboard

TOOLS_NOGO is not up to date

Open uhthomas opened this issue 2 years ago • 3 comments

What version of rules_go are you using?

Latest

What version of gazelle are you using?

Latest

What version of Bazel are you using?

Latest

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

Yes.

What operating system and processor architecture are you using?

N/A

Any other potentially useful information about your toolchain?

N/A

What did you do?

The TOOLS_NOGO variable claims to be ...a list of all analysis passes in https://pkg.go.dev/golang.org/x/tools/go/analysis/passes.

What did you expect to see?

There are analysers missing.

What did you see instead?

I haven't checked all of them, but reflectvaluecompare is missing, for instance.

uhthomas avatar Jun 06 '22 16:06 uhthomas

I think this is expected. Not all analyzers are included by default. We are trying to mirror the behavior of go vet and it only supports a subset of analyzers https://pkg.go.dev/cmd/vet

I think these new analyzers have been added recently to be opt-in basis by go vet? I know gopls is also consuming some via opt-in configs. Not sure whats the plan to add them into go vet be default.

sluongng avatar Jul 11 '22 11:07 sluongng

There is a difference between vet = True and the TOOLS_NOGO variable. TOOLS_NOGO should include all analysers as I understand.

uhthomas avatar Jul 11 '22 11:07 uhthomas

Yup, on second reading I think you are right...

https://github.com/bazelbuild/rules_go/blob/df02d01fb37701ff826697271220f043b364d1c1/go/def.bzl#L78-L82

So yeah... we need to update this... manually? 🤔

sluongng avatar Jul 11 '22 11:07 sluongng