-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Added govet to our Golang linter suite #5871
Conversation
/kind cleanup |
Thanks @bendory - running I'm unsure if we should have a dedicated CI job for it though, since we already run other go tools in the That said since GitHub actions do not add cost to our infra, I don't mind having the extra job there for now - @vdemeester @abayer wdyt? |
I also wondered if GHA or "tekton-on-tekton" is the right answer -- and concluded that GHA is quick and easy for now to keep us in integrity until we get to tekton-on-tekton later. |
.github/workflows/govet.yml
Outdated
- name: Run vet | ||
run: | | ||
# Use in-place vendored dependencies. | ||
# For now, ignore unkeyed composite fields in structs. |
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.
Note: I've already got a follow-on branch that takes care of the unkeyed composite fields. I'm holding that back as a separate PR to keep this PR small.
@bendory could we add govet to the list of linters we already run as part of the build tests: https://github.com/tektoncd/pipeline/blob/main/.golangci.yml#L15 |
🤔
|
Might be mistaken but I wonder if we shall add |
OIC, I misread the configuration -- it leads by disabling everything. OK, update to this PR coming. /hold |
/unhold |
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 @bendory
LGTM, just that we might want to update the PR comment and title once the build test passed.
Done! |
I've already got code changes ready for the composite literal issues, I'm going to add those here and also addressed the |
I decided to split out the |
/retest pull-tekton-pipeline-build-tests |
@bendory: The
The following commands are available to trigger optional jobs:
Use In response to this:
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. |
/test pull-tekton-pipeline-build-tests |
/retest |
Also: - fixed two minor issues uncovered by `go vet`: - cmd/nop/main.go:30:3: misuse of unbuffered os.Signal channel as argument to signal.Notify - internal/sidecarlogresults/sidecarlogresults_test.go:46:4: call to (*T).Fatal from a non-test goroutine - fixed unkeyed composite literal fields in various _test.go files
Note: moved this into our existing dedicated CI job. |
/assign vdemeester |
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!
/lgtm
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abayer, JeromeJu, jerop 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 |
Changes
This PR adds
govet
to our Golang linter suite. There are no expected functional changesin this PR.
Also:
go vet
:_test.go
files.Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)
/kind <type>
. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes