-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Migrate to golangci-lint #1443
Migrate to golangci-lint #1443
Conversation
a8a63f3
to
33a79b6
Compare
@errordeveloper sure, I will rebase later |
ee7f8a7
to
bba8b38
Compare
682bde0
to
6baf011
Compare
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.
Hi @sayboras , thank you so much for this PR! This is great! I added some feedback :)
5db8b9b
to
1c982ef
Compare
38adfb5
to
9c9c1e4
Compare
Hi @sayboras , thanks again for this PR. Since it introduces some risks in the build pipeline I would like to hold it until the end of kubecon next week. By the way if you happen to go come and say hi at the Weaveworks booth :) |
No hurry, I can leave it as it is now :). I wish I could have come for kube con 😢 , hopefully next year |
77782ea
to
fdbe851
Compare
fdbe851
to
38425f4
Compare
Let me know if you have any other comments, happy to address. |
Thank you for being so patient and keeping this up to date! :) We will try to merge it next week! |
317c921
to
daaaa2c
Compare
a6e56de
to
f752740
Compare
@sayboras it seems I can't push to your branch. Can you run this command locally and push the changes? |
I tried to push the new image before, but got the below error
So it might need your help on this last step, I updated the manifest as well. |
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 have now pushed the docker image with the tool installed so the build should not fail because of that.
If you check, there are some failures from the generated aws sdk mocks. We should probably make the linter ignore those.
@@ -62,7 +71,7 @@ linters-settings: | |||
check-blank: false | |||
govet: | |||
# report about shadowed variables | |||
check-shadowing: true | |||
check-shadowing: false |
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.
Why was this one changed?
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.
this lint is to check shadow declaration of variable. Lot of times we re-declare err
by using :=
operator.
Let me know if you want to fix it, I can make the changes.
time "/Users/tammach/go/bin/golangci-lint" run
pkg/gitops/flux/installer.go:166:5 govet shadow: declaration of "err" shadows declaration at line 133
pkg/gitops/flux/installer.go:172:6 govet shadow: declaration of "err" shadows declaration at line 133
pkg/gitops/flux/installer.go:182:5 govet shadow: declaration of "err" shadows declaration at line 133
pkg/gitops/profile.go:52:5 govet shadow: declaration of "err" shadows declaration at line 46
pkg/addons/vpc_controller.go:98:7 govet shadow: declaration of "err" shadows declaration at line 87
pkg/nodebootstrap/userdata.go:104:5 govet shadow: declaration of "err" shadows declaration at line 96
pkg/kubernetes/client.go:313:6 govet shadow: declaration of "err" shadows declaration at line 308
pkg/kubernetes/client.go:357:6 govet shadow: declaration of "err" shadows declaration at line 351
pkg/kubernetes/client.go:395:6 govet shadow: declaration of "err" shadows declaration at line 351
pkg/eks/api.go:206:5 govet shadow: declaration of "err" shadows declaration at line 196
pkg/ctl/create/cluster.go:112:5 govet shadow: declaration of "err" shadows declaration at line 94
pkg/ctl/create/cluster.go:116:5 govet shadow: declaration of "err" shadows declaration at line 94
pkg/ctl/create/cluster.go:134:7 govet shadow: declaration of "err" shadows declaration at line 94
pkg/ctl/create/cluster.go:375:7 govet shadow: declaration of "err" shadows declaration at line 346
pkg/ctl/create/cluster.go:381:7 govet shadow: declaration of "err" shadows declaration at line 346
pkg/ctl/create/cluster.go:384:7 govet shadow: declaration of "err" shadows declaration at line 346
pkg/ctl/create/fargate.go:65:5 govet shadow: declaration of "err" shadows declaration at line 61
pkg/ctl/create/fargate.go:69:9 govet shadow: declaration of "err" shadows declaration at line 61
pkg/ctl/create/fargate.go:81:5 govet shadow: declaration of "err" shadows declaration at line 61
pkg/ctl/create/iamidentitymapping.go:56:5 govet shadow: declaration of "err" shadows declaration at line 51
pkg/ctl/create/iamidentitymapping.go:68:5 govet shadow: declaration of "err" shadows declaration at line 51
pkg/ctl/create/iamidentitymapping.go:76:9 govet shadow: declaration of "err" shadows declaration at line 51
pkg/ctl/create/iamserviceaccount.go:71:5 govet shadow: declaration of "err" shadows declaration at line 65
pkg/ctl/create/iamserviceaccount.go:75:9 govet shadow: declaration of "err" shadows declaration at line 65
pkg/ctl/create/nodegroup.go:86:5 govet shadow: declaration of "err" shadows declaration at line 80
pkg/ctl/create/nodegroup.go:90:9 govet shadow: declaration of "err" shadows declaration at line 80
pkg/ctl/create/nodegroup.go:94:5 govet shadow: declaration of "err" shadows declaration at line 80
pkg/ctl/delete/cluster.go:92:5 govet shadow: declaration of "err" shadows declaration at line 86
pkg/ctl/delete/cluster.go:97:5 govet shadow: declaration of "err" shadows declaration at line 86
pkg/ctl/delete/cluster.go:101:9 govet shadow: declaration of "err" shadows declaration at line 86
pkg/ctl/delete/fargate.go:58:5 govet shadow: declaration of "err" shadows declaration at line 54
pkg/ctl/delete/iamidentitymapping.go:53:5 govet shadow: declaration of "err" shadows declaration at line 47
pkg/ctl/delete/iamidentitymapping.go:64:9 govet shadow: declaration of "err" shadows declaration at line 47
pkg/ctl/delete/iamidentitymapping.go:76:5 govet shadow: declaration of "err" shadows declaration at line 47
pkg/ctl/delete/iamserviceaccount.go:71:5 govet shadow: declaration of "err" shadows declaration at line 65
pkg/ctl/delete/nodegroup.go:62:5 govet shadow: declaration of "err" shadows declaration at line 56
pkg/ctl/delete/nodegroup.go:66:9 govet shadow: declaration of "err" shadows declaration at line 56
pkg/ctl/drain/nodegroup.go:58:5 govet shadow: declaration of "err" shadows declaration at line 52
pkg/ctl/drain/nodegroup.go:62:9 govet shadow: declaration of "err" shadows declaration at line 52
pkg/ctl/enable/profile.go:87:5 govet shadow: declaration of "err" shadows declaration at line 83
pkg/ctl/enable/repo.go:54:5 govet shadow: declaration of "err" shadows declaration at line 50
pkg/ctl/enable/utils.go:18:5 govet shadow: declaration of "err" shadows declaration at line 14
pkg/ctl/get/fargate.go:64:5 govet shadow: declaration of "err" shadows declaration at line 60
pkg/ctl/get/iamidentitymapping.go:57:5 govet shadow: declaration of "err" shadows declaration at line 52
pkg/ctl/get/iamserviceaccount.go:63:5 govet shadow: declaration of "err" shadows declaration at line 58
pkg/ctl/get/iamserviceaccount.go:67:9 govet shadow: declaration of "err" shadows declaration at line 58
pkg/ctl/get/nodegroup.go:69:5 govet shadow: declaration of "err" shadows declaration at line 64
pkg/ctl/scale/nodegroup.go:68:5 govet shadow: declaration of "err" shadows declaration at line 63
pkg/ctl/update/cluster.go:63:5 govet shadow: declaration of "err" shadows declaration at line 57
pkg/ctl/update/cluster.go:67:9 govet shadow: declaration of "err" shadows declaration at line 57
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.
Right, I wonder how this was working before 🤔 If there is a way to only allow shadowing err
and ctx
that would be nice. Otherwise let's leave it like that for now.
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.
There is no way that I am aware of. I think i just leave it for now :(
5b25726
to
d0a2357
Compare
d0a2357
to
7996a57
Compare
Description
Migrate from gometalinter to golangci-lint as mentioned in #973
Currently, I keep the same configuration as gometalinter (govet, golint, errcheck, deadcode, missspel).
gofmt
,unused
,goimports
linters are added. The goal is to migrate to golangci-lint with minimal code changes.Any improvement can be tackled based on discussion.
Checklist
README.md
, andexamples
directory)