-
Notifications
You must be signed in to change notification settings - Fork 38
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
staticcheck #69
staticcheck #69
Conversation
Thank you for submitting this PR!
Getting other community members to do a review would be great help too on complex PRs (you can ask in the chats/forums). If you are unsure about something, just leave us a comment.
We currently aim to provide initial feedback/triaging within two business days. Please keep an eye on any labelling actions, as these will indicate priorities and status of your contribution. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't want to re-generate that protobuf code on purpose, to prevent changing CIDs.
@mvdan This will fail on CI though. Any suggestion how to proceed here? |
Right. I think we have two options:
Option 2 is probably the easiest, assuming that none of the warnings point at real bugs. |
According to https://staticcheck.io/docs, we could create a config file. Not sure if that allows us to exclude files though. |
There are comment directives to disable a check for the entire file: https://staticcheck.io/docs#file-based-linter-directives |
Apparently it's not possible to disable a rule for a specific file (but it might be possible to do it for an entire directory, which would work here): dominikh/go-tools#429. Fun fact: @mvdan participated in that discussion 1.5 years ago. |
What about that |
Doesn't seem to be valid TOML. |
That goes in the Go source file, not a TOML config. |
That might work, but I'd like to avoid editing generated files. We have a lot of protobuf files across our code base. |
I would hope that this kind of thing is only necessary for go-merkledag's ancient gogo-protobuf generated code though. Most other repos should be using a recent protoc-gen-go version, which I hope does not generate any vet or staticcheck warnings. |
We've already intentionally edited this file to ensure that we'll fail a test if we try to regenerate it. Essentially, I don't consider it to be an "autogenerated" file at this point. I'll file a new PR to remove that comment.... |
This file has evolved beyond its codegen status and has been manually edited a few times already. It's unlikely to change and is slowly being deprecated in favour of https://github.com/ipld/go-codec-dagpb Ref: #69
…aticcheck staticcheck This commit was moved from ipfs/go-merkledag@1c3bc18
This file has evolved beyond its codegen status and has been manually edited a few times already. It's unlikely to change and is slowly being deprecated in favour of https://github.com/ipld/go-codec-dagpb Ref: ipfs/go-merkledag#69 This commit was moved from ipfs/go-merkledag@40f5034
This fixes small problems picked up by staticcheck.
The ones that remain are for the generated protobuf file, which I haven't regenerated.
For context: protocol/.github#41