-
Notifications
You must be signed in to change notification settings - Fork 48
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
Re-add go-lint to pre-commit #302
Re-add go-lint to pre-commit #302
Conversation
The go-lint was accidentally dropped form pre-commit by ff52881. This patch adds it back and fixes the issue found by it.
After this lands we can drop @openshift-ci's ci/prow/golint job as pre-commit will cover it. |
@gibizer: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
go-lint now run in the pre-commit job https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/origin-ci-test/pr-logs/pull/openstack-k8s-operators_nova-operator/302/pull-ci-openstack-k8s-operators-nova-operator-master-precommit-check/1638819821648875520/artifacts/test/build-log.txt
|
@gibizer: Do we want to add a deprecated checker to our code analysis (https://github.com/golang/lint)? We could use golint, which includes a deprecated checker, but it has been removed from the official Go tools and is no longer actively maintained. Alternatively, we could use other linters like staticcheck (plus already used golangci-lint) |
This is a good question. We had a golint job from the start so we did enforced the rules in golint on the code. As far as I see golint has rules that are not covered by other lints today, hence the fixes needed in the commit. I'm OK either ways:
Btw, feel free to try out staticcheck and add it to pre-commit if make sense. |
I don't have a really strong opinion on that, but personally, I prefer to remove deprecated libraries from our codebase.
Sure, I will check it out and let you know what I find. |
oh i tought that was still there since i have it locally. |
@mrkisaolamb +1, golint is depricated, so instead of using golint most of the rpos[1][2] are added with golangci-lint. [1] openstack-k8s-operators/ovn-operator#25 |
we had this conversation a few month ago. golangci-lint. does not actually test the same set of lining rules. at the time i wanted to remove ti but since all the other repos were not using pre-commit and were using a dedicated golint job we kept it. what we agreed was if we remove golint form pre-commit we need to remove it form prow/github action and do so on all the repos we currently still have a ci/prow/golint check job and its required so either we read golint or we need to remove that. |
Yepp I agree with Sean |
Okay, to me it sounds like the best option is to merge this PR and then remove golint from all repositories and from prow, and replace it with staticcheck. Based on the results from staticcheck, I think this is a promising alternative for golint
|
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 run precommit all is good. lgtm!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bogdando, gibizer, mrKisaoLamb 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 |
The go-lint was accidentally dropped form pre-commit by ff52881. This patch adds it back and fixes the issue found by it.