google-cloud-go icon indicating copy to clipboard operation
google-cloud-go copied to clipboard

vet.sh: linting ineffective in CI

Open egonelbre opened this issue 1 year ago • 4 comments

While looking at the https://github.com/googleapis/google-cloud-go/pull/9758 it seems that linting is actually not working for modules. For example, copying locks should have definitely triggered a CI failure, which it did not.

Most go tools work in a single module boundary and should be executed at every root of go.mod. So, either the script or workflow needs fixing. From github actions output it would probably nice if every single module ended up as a separate result to make the distinction clearer. This probably can even be scoped, such that only changes in a particular module are linted.

Similarly, golang.org/x/lint/golint is deprecated and should be replaced with go vet. See the notice on https://pkg.go.dev/golang.org/x/lint.

The fix for making linting work again is trivial, but it needs a coordinated effort to get all the submodules passing the checks.

egonelbre avatar Apr 16 '24 07:04 egonelbre

I created an proof-of-concept alternative script in https://github.com/egonelbre/google-cloud-go/pull/1 -- you probably would need to adjust it to fit Google's needs, but it shows how to run go vet, staticcheck modules in parallel and get a nice output in github.

egonelbre avatar Apr 16 '24 12:04 egonelbre

I should probably mention that issues such as https://github.com/googleapis/google-cloud-go/pull/10067 go unnoticed as a result. These can be easily caught by static linting tools.

egonelbre avatar May 03 '24 12:05 egonelbre