bazelbuild / rules_go

Go rules for Bazel
Apache License 2.0
1.36k stars 645 forks source link

TOOLS_NOGO is not up to date #3181

Open uhthomas opened 2 years ago

uhthomas commented 2 years ago

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.

sluongng commented 2 years ago

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.

uhthomas commented 2 years ago

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

sluongng commented 2 years ago

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? 🤔

albertocavalcante commented 1 month ago

@sluongng any ideas on how this could be automated?