-
Notifications
You must be signed in to change notification settings - Fork 3k
Switch to golangci-lint #2742
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
Switch to golangci-lint #2742
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: saschagrunert If they are not already assigned, you can assign the PR to them by writing The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @saschagrunert. Thanks for your PR. I'm waiting for a containers or openshift member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
Can one of the admins verify this patch?
|
|
bot, add author to whitelist |
6a68ce5 to
6c60a3e
Compare
|
To make the CI happy we would have to update the |
Calling @cevich for help 👨🚒 |
|
/ok-to-test |
|
@saschagrunert @vrothberg Quick background: The container that runs the linter is defined in For this PR, building the container image will happen automatically once it merges. So, in order to validate this process will work, a few temporary manual steps are needed to validate the new linter against this PR:
To make sure this PR doesn't accidentally merge with a test commit, I'll stick on a: Assuming there are no problems, and the output looks clean:
Make sense? |
cevich
left a comment
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.
Only looked at Makefile changes: They all LGTM
cmd/podman/search.go
Outdated
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.
OK, these seem like they ought to be used - did we start hardcoding them when we have constants?
6c60a3e to
547fc57
Compare
@cevich sure, thanks for the explanation. I update the test image as suggested. I guess the machines running |
|
I want to do a quick look at some of the constants we're removing here and see if we've just hardcoded them (instead of using the actual constant), but I love the actual linter change. |
I believe that's the |
|
@saschagrunert Nice, looks great thanks! You can strip the testing commit...unless you need to play more. |
547fc57 to
5e40c72
Compare
Alright, I reverted the test change. |
|
/hold cancel |
|
@mheon this will have to be manually merged. Tests won't pass without image...image won't build until after merge. They were all green though, with the test-commit. |
5e40c72 to
c8fd54e
Compare
golangci-lint already vendors its linters, so there should be no difference on different platforms. We could lock golangci-lint to a dedicated version. |
|
Version-locking would be appreciated - we did that with Metalinter, though results seemed... mixed (rarely got the same results on bare metal as CI did) |
c8fd54e to
7715fb6
Compare
Alright, pinned it to v1.15.0 |
|
Suggestion: There are a bunch of linters disabled by default, which we were probably previously using. It might be worthwhile reviewing that list and see if there are any which should be re-enabled in golangci-lint. |
I verified that every additional linter I would now enable via the config will report issues. To keep the PRs small my usual approach would be to follow up on enabling the linters and fixing the issues in dedicated PRs. WDYT? |
|
SGTM |
|
☔ The latest upstream changes (presumably #2839) made this pull request unmergeable. Please resolve the merge conflicts. |
7715fb6 to
e69462d
Compare
Signed-off-by: Sascha Grunert <[email protected]>
Signed-off-by: Sascha Grunert <[email protected]>
Signed-off-by: Sascha Grunert <[email protected]>
e69462d to
023eba2
Compare
|
Rebase on top of the latest master branch. |
|
@saschagrunert: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions 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. |
|
rhatdan prays this works. |
|
@cevich @saschagrunert Manually merged. Thanks. |
|
@rhatdan praying is fine here, it's not practical to setup automated testing for these kinds of changes. We did manually test and it was green. Post-merge it's not, but no worries, I'm here. I'll work on mitigating the fallout...which seems relatively minor. |
|
FWIW "manually merge even though tests are clearly broken" is not really a great approach -- also surprising @cevich that you have added another parallel set of tests and lints to those provided by Prow? How were the latter lacking? |
|
@cevich Said we had a Catch 22 where we could not fix one without force merging the other. Is there a way to clear this up in the OpenShift testers without reverting? |
|
what needs to be done is we need to edit the openshift stuff to have both linters ... then do the testing and swap on our ci ... then clean up openshift. |
This PR switches from the deprecated gometalinter to golangci-lint. Beside this, two other commits enable the
deadcodeandvarchecklinters as well as fix the first issues.// nolinton these tooSTOPPEDstate here?