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

Update go vet with latest analyzers #3902

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sluongng
Copy link
Contributor

Upgrade golang.org/x/tools to v0.18.0.
Note that the latest v0.19.0 has a bug that we should avoid using.

Update the analyzers (passes) in TOOLS_NOGO and the ones automatically
included when vet = True is configured.
The vet analyzers are taken from go tool vet help documentation.

@sluongng sluongng force-pushed the sluongng/update-govet branch 2 times, most recently from f592a57 to 4662b36 Compare March 26, 2024 13:25
@fmeum
Copy link
Member

fmeum commented Mar 26, 2024

The nogo failure looks like it's easier to fix than ignore.

@sluongng
Copy link
Contributor Author

@fmeum is it though?

The fieldalignment analyzer is quite noisy and is triggered on proto-generated code? 🤔

Im in favor of disabling it with a TODO.

go/private/rules/nogo.bzl Show resolved Hide resolved
go/private/rules/nogo.bzl Show resolved Hide resolved
@fmeum
Copy link
Member

fmeum commented Mar 26, 2024

@fmeum is it though?

The fieldalignment analyzer is quite noisy and is triggered on proto-generated code? 🤔

Im in favor of disabling it with a TODO.

True, I missed that this was the generated code, not the test. In that case I agree that disabling it by default is the right move.

@sluongng
Copy link
Contributor Author

Yeah. The other option is to add a relevant nogo_config.json file to exclude proto-generated files for that analyzer.

I don't think it's worth the noise it gonna generate for downstream users though.

@sluongng sluongng force-pushed the sluongng/update-govet branch 7 times, most recently from 989e850 to 690aa4b Compare March 27, 2024 09:50
@sluongng
Copy link
Contributor Author

Hmm, these dependencies upgrades turn out to be a huge PITA.

Especially, for the popular_repo test, I think we should consider dropping x/tools testing entirely. The repo is where gopls is being actively developed and the recent code quality is not that high. v0.19.0 contains a nil pointer bug and a bunch of build/test targets in that repo are not gazelle/rules_go compatible.

I also had to patch Gazelle temporarily to avoid analyzer duplication. It should be a temp workaround until (a) we remove that in Gazelle, then (b) release a new Gazelle version, and then (c) upgrade the Gazelle version in rules_go.

Upgrade golang.org/x/tools to v0.18.0.
Note that the latest v0.19.0 has a bug that we should avoid using.

Update the analyzers (passes) in TOOLS_NOGO and the ones automatically
included when `vet = True` is configured.
The vet analyzers are taken from `go tool vet help` documentation.
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