-
Notifications
You must be signed in to change notification settings - Fork 1.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
🌱 Add loggercheck linter and fix findings #9446
🌱 Add loggercheck linter and fix findings #9446
Conversation
Signed-off-by: Stefan Büringer buringerst@vmware.com
@@ -36,6 +36,7 @@ linters: | |||
- govet | |||
- importas | |||
- ineffassign | |||
- loggercheck |
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.
Validates for complete k/v pairs (i.e. we get a finding if we have an odd number of arguments)
Example
test/infrastructure/docker/internal/docker/manager.go:175:46: odd number of arguments passed as key-value pairs for logging (loggercheck)
log.V(6).Info("Container run options: %+v", runOptions)
^
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 looks really useful.
/lgtm
LGTM label has been added. Git tree hash: d2ca99a23c158b1062e1edc906187e9463f6e74a
|
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.
/area ci
Yup especially (IIRC) because the logger panics when these cases are hit |
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
/approve Thanks! |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: killianmuldoon 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 |
Signed-off-by: Stefan Büringer buringerst@vmware.com
What this PR does / why we need it:
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #