Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

allow specifying go vet flags #286

Closed
wants to merge 2 commits into from
Closed

allow specifying go vet flags #286

wants to merge 2 commits into from

Conversation

galargh
Copy link
Contributor

@galargh galargh commented Jan 17, 2022

This PR will make it possible to provide flags for go vet command via go-check-config.json object.

Why?

One of the reasons why ipld/go-ipld-prime-proto#24 cannot be merged is because go vet fails with composite literal uses unkeyed fields (see https://github.com/ipld/go-ipld-prime-proto/runs/4483048466?check_suite_focus=true). Unfortunately, the solution of changing the code to avoid this error doesn't work here because ipldsch_satisfaction.go is an autogenerated file. That's why I think allowing to provide -composites=false to go vet would be desirable in this case.

I also tried to see if there is a way to add some magic comment to ignore this file during go vet but it seems it does not exist - golang/go#18432 (comment)

go-check-config.json example:

{
  "govet": { 
    "flags": "-composites=false"
  }
}
Testing

@marten-seemann
Copy link
Contributor

I think @mvdan has been working on fixing these go vet warnings. What's the status there?

@marten-seemann marten-seemann requested a review from mvdan January 17, 2022 11:32
@mvdan
Copy link
Contributor

mvdan commented Jan 17, 2022

Yep, the newer go-ipld-prime codegen should generate code with absolutely zero vet warnings. If any are left, they must be fixed. I fixed (hopefully) all of them half a year ago.

The reason go-ipld-prime-proto still has warnings is that it's out of date. It's been deprecated for a while (ipld/go-ipld-prime-proto#23), and at this point we should archive it. It should have already been archived, so my apologies for wasting a little of your time on it :)

I'll go ahead and figure out how we can archive it.

@mvdan
Copy link
Contributor

mvdan commented Jan 17, 2022

In other words, I don't think we need to support disabling any vet checkers at all.

@galargh
Copy link
Contributor Author

galargh commented Jan 17, 2022

Oh nice! I have missed this issue. That's great news :)

It should have already been archived, so my apologies for wasting a little of your time on it :)

No worries at all, it finally gave me an opportunity to look at how go-check-config.json is being used in the workflow so I wouldn't count it as a waste of time.

Closing this PR then.

@galargh galargh closed this Jan 17, 2022
@galargh galargh deleted the govetflags branch January 17, 2022 12:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants