-
Notifications
You must be signed in to change notification settings - Fork 178
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
Add a staticcheck verify script and fix errors #242
Conversation
If we think this might cause conflicts with #241, let's wait on it until after that goes in. Also, do we even think this is a good idea? |
I think the "unused" stuff could be quite useful in helping remove dead/unreferenced code. The "should omit comparison to bool constant" is nit but meh. I think the benefits of dead code removal is worth it. |
/hold |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dvonthenen The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This patch adds a hack/verify-staticcheck.sh script, adds a Makefile target for "make staticcheck", and fixes the errors found. A couple of the other check scripts (format, lint) or modified to no longer use `GO111MODULE=off` when they "go get" the needed tools. That was there before to avoid having `go.mod` change when running the scripts, but instead this patch just allows in the needed changes to go.mod and the correct version should be installed every time. no need to fight the tool. The `go get` commands are still needed in the scripts, however, even if a `go mod download` has been done, because the download won't install the tool, but `go get` will.
a432f0b
to
10c24ea
Compare
/hold cancel |
/lgtm |
What this PR does / why we need it:
I figured since k/k now has support for running
staticcheck
, we should do it on our projects.This patch adds a hack/verify-staticcheck.sh script, adds a Makefile
target for "make staticcheck", and fixes the errors found.
A couple of the other check scripts (format, lint) or modified to no
longer use
GO111MODULE=off
when they "go get" the needed tools. Thatwas there before to avoid having
go.mod
change when running thescripts, but instead this patch just allows in the needed changes to
go.mod and the correct version should be installed every time. no need
to fight the tool. The
go get
commands are still needed in thescripts, however, even if a
go mod download
has been done, because thedownload won't install the tool, but
go get
will.Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #Special notes for your reviewer:
The initial list of errors found were:
Release note:
/assign @andrewsykim
/assign @dvonthenen