Open julieqiu opened 2 weeks ago
@julieqiu We do actually run staticcheck, but we ignore some warnings from it today. See: https://github.com/googleapis/google-cloud-go/blob/1e21bcf262bca9781fd42e357cdddf0ed9ad9f1e/.github/workflows/vet.sh#L82-L90
@codyoss Do you think any of the current ignores could be addressed and removed at this time?
@julieqiu: #10780 removes some of these SA1019 failures. Did you run into trouble trying to remove the remaining SA1019 failures?
I honestly don't know without looking. Some things could likely be cleaned up but I think some of these that we skip would take a breaking change to actually fix the issue -- at least I vaguely recall this being the case from a couple of years back when I had looked at this.
There's an existing related issue https://github.com/googleapis/google-cloud-go/issues/9784
Most linting tooling works in a module boundary. So if you run go vet ./...
or staticcheck ./...
it only verifies the current module, and in this repo most folders are separate modules.
Or in other words neither go vet
or staticcheck
are running for the submodules.
I created a proof of concept script in https://github.com/egonelbre/google-cloud-go/pull/1/files#diff-25b8fc8d894e1d2f71768a6e38f68cecaad5d7d861ba6b16f1ad40f9f94516fb -- but it probably would need to be adjusted to fit Google's needs better. More of a starting point.
And I've been fixing linting issues for spanner https://github.com/googleapis/google-cloud-go/pulls/egonelbre
@egonelbre Thank you (again!) for your help with these issues. Appreciate your comments and POC!
staticcheck is a common linter for Go projects. We should consider adding it as a presubmit check for PRs. See https://github.com/googleapis/gapic-generator-go/issues/1404 and https://github.com/googleapis/gapic-showcase/issues/1529 for related issues.
This first requires fixing these issues in this repository: