spicedb icon indicating copy to clipboard operation
spicedb copied to clipboard

Enable `go vet`'s linters

Open tstirrat15 opened this issue 9 months ago • 4 comments

The golangci-lint configuration doesn't currently include go vet's lint rules. There's a set of problems that can be caught by static analysis that won't be caught by the compiler, such as errors.As invocations where errors.As takes an any as its second arg.

We ran go vet ./... on the repo as a test, and it seems like most of the work here will be either reordering fields or adding names to structs whose order of instantiated fields don't match their order of declared fields, mostly in tests.

tstirrat15 avatar May 08 '25 17:05 tstirrat15

1. go vet No Output

I am running go vet ./... but no output is shown

Image

2. .golangci.yaml file has go vet commented out

Image

subrajeet-maharana avatar May 09 '25 14:05 subrajeet-maharana

@subrajeet-maharana we, the maintainers, added the - "govet" TODO: fix issues line 😄 If you want to contribute you can help us by uncommenting that line and then fixing all reported. Thanks!

miparnisari avatar May 23 '25 17:05 miparnisari

Someone is working on this?

rkgarcia avatar Jun 03 '25 17:06 rkgarcia

@rkgarcia / @miparnisari I'm picking this one up today, enabling all TODO'd modules and working through them here. Should be finished by EOD.

Edit: https://github.com/authzed/spicedb/pull/2455 is out for review.

James9074 avatar Jun 17 '25 14:06 James9074