-
Notifications
You must be signed in to change notification settings - Fork 252
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 golangci-lint for static checks #559
Conversation
Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
The golint repository is unfortunately no longer maintained. The golangci-lint project offers many static check tools that implement checks that we had enabled via various tools. Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
All the static checks that were performed by these tools are covered by golangci-lint with the given config (and more). Therefore, remove now obsolete make targets and update the `check` target to run golangci-lint instead. Note that as it is not recommended to instsall golangci-lint via source, the target runs the binary when the expected version is found and via a docker container otherwise. Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
|
||
vet: | ||
go vet $$(go list ./...) | ||
ifneq (,$(findstring $(GOLANGCILINT_WANT_VERSION),$(GOLANGCILINT_VERSION))) |
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.
should we use some sort of semver comp here, i.e. 1.40.2
should be ok too, right? Or do we specifically want the exact match
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.
Sure, I can drop PATCH
from the version check although that would make the code a bit more complicated.
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.
Nice!
See commits for details. These changes are loosely based on the changes made to cilium-cli via #229.