-
Notifications
You must be signed in to change notification settings - Fork 473
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
lint: enable go vet printf format arg checks for logging #4679
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4679 +/- ##
==========================================
- Coverage 54.38% 54.37% -0.02%
==========================================
Files 403 403
Lines 51928 51928
==========================================
- Hits 28243 28234 -9
- Misses 21308 21313 +5
- Partials 2377 2381 +4
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@@ -69,9 +104,9 @@ issues: | |||
- path: _test\.go | |||
linters: | |||
- errcheck | |||
- gofmt | |||
# - gofmt |
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 disabled?
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.
they're actually being enabled.. this is an exclude list, so the linters being commented out here are the only ones that will run on test code
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 comment them out instead of removing them?
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 believe @algojack set it up that way so it was more clear what linters were being run on tests — this way you can see that gofmt, govet, and revive are the linters we want to run on tests
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'm ok with deleting comments, just wanted to make sure that we didn't accidentally forget to ignore that excluded path on any linters. If we keep comments we can see that we enabled them there on purpose vs just forgetting to exclude them. Doesn't matter much.
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'd remove the comments, other than that LGTM.
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
Summary
While reviewing #4149 I noticed a
%d
where%s
should be and remembered we can enable go vet checks on custom logging functions by changing our linter settings. This fixes all the logging format string errors (in all files, going back before our configured new-from-rev commit) and enables the go vet configuration change.Test Plan
Code should be lint clean, only affects logging.