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
*: use latest release of staticcheck #5057
*: use latest release of staticcheck #5057
Conversation
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.
LGTM except the federation warning vs error
It also fixes a couple of things in the code flagged by the additional checks. Signed-off-by: Simon Pasquier <spasquie@redhat.com>
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.
LGTM
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.
LGTM
63807a9
to
afc3734
Compare
Also run 'go list' before staticcheck to avoid failures when downloading packages. Signed-off-by: Simon Pasquier <spasquie@redhat.com>
afc3734
to
d7501c7
Compare
The latest commit gets the I've also added a hack to avoid the spurious errors (as reported in prometheus/node_exporter#1214 and prometheus/statsd_exporter#173): before running staticcheck, we run |
@simonpasquier Thanks, I was going to propose doing the same thing. 😁 |
ifdef GO111MODULE | ||
GO111MODULE=$(GO111MODULE) $(STATICCHECK) -ignore "$(STATICCHECK_IGNORE)" -checks "SA*" $(pkgs) | ||
# 'go list' needs to be executed before staticcheck to prepopulate the modules cache. |
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.
Can you indent these comments to match the lines below?
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 can but they show in the output then.
Update to new staticcheck method[0]. [0]: prometheus/prometheus#5057 Signed-off-by: Ben Kochie <superq@gmail.com>
* Update Makefile.common Update to new staticcheck method[0]. [0]: prometheus/prometheus#5057 Signed-off-by: Ben Kochie <superq@gmail.com> * Fix staticcheck errors. Signed-off-by: Ben Kochie <superq@gmail.com>
* Update Makefile.common Update to new staticcheck method[0]. [0]: prometheus/prometheus#5057 Signed-off-by: Ben Kochie <superq@gmail.com> * Fix staticcheck errors. Signed-off-by: Ben Kochie <superq@gmail.com>
* Update Makefile.common Update to new staticcheck method[0]. [0]: prometheus/prometheus#5057 Signed-off-by: Ben Kochie <superq@gmail.com> * Fix staticcheck errors. Signed-off-by: Ben Kochie <superq@gmail.com>
The latest release of staticcheck (2019.1) now supports Go modules so we don't have to rely on the
next
branch anymore. Note that this version introduces more checks as staticcheck also includes the gosimple, unused, and megacheck programs (see changelog). It is also possible to tune the configuration with a localstaticcheck.conf
file as well as defining exceptions directly in the code (using//lint:ignore ...
comments).The PR also fixes a couple of things in the code flagged by the additional checks.