-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Introducing stylecheck
linter to detect duplicate package imports in Go code
#30215
Introducing stylecheck
linter to detect duplicate package imports in Go code
#30215
Conversation
af328d0
to
566936c
Compare
566936c
to
fca0de1
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.
Thanks! 💯
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.
Hubble patch LGTM, however I have a golangci-lint / staticcheck GHA question (see below).
fca0de1
to
1f43afd
Compare
staticcheck
linter to detect duplicate package imports in Go code.stylecheck
linter to detect duplicate package imports in Go code
1f43afd
to
e784222
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.
LGTM. thanks for switching to golangci-lint. 🎉
e784222
to
8c8651f
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.
Thank you!
/test |
8c8651f
to
b8a2974
Compare
b8a2974
to
ac2c269
Compare
This will be invoked as part of the CI workflow linting. Signed-off-by: Nikolay Nikolaev <[email protected]>
After adding stylecheck in the previous commit, we do fix all the issues it found. The used command was: make golangci-lint Signed-off-by: Archisman Mridha <[email protected]> Signed-off-by: Nikolay Nikolaev <[email protected]> # Conflicts: # pkg/k8s/watchers/watcher.go # pkg/service/service.go
ac2c269
to
6d40d3a
Compare
/test |
We introduce
stylecheck
linter in.golangci.yaml
, but enable it only for duplicate imports (ST1019)Then this PR fixes all the duplicate go imports found by running:
This is a re-spin of the original (abandoned) #28062 by @Archisman-Mridha
Fixes: #27676