-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Make govet check glog.Info/Warning calls #16801
Make govet check glog.Info/Warning calls #16801
Conversation
/lgtm |
hack/verify-govet.sh
Outdated
for test_dir in $(os::util::list_go_src_dirs); do | ||
if ! result="$(go tool vet -shadow=false "${test_dir}" 2>&1)"; then | ||
if ! result="$(go tool vet ${govet_args} "${test_dir}" 2>&1)"; then |
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.
If you're using them once, just inline them here
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.
personally i like the way it's called out as a var, makes it easier to see the args and update them rather than embedding them in a messy line of bash.
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.
oops, just pushed a change. i'm fine either way
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.
no need to churn on it so i guess we'll leave it.
The default set of names covered by govet's checking of Printf-like functions includes Log, Error, and Fatal, but not Info or Warning.
5a210e7
to
a96d4d6
Compare
@@ -30,7 +30,7 @@ function govet_blacklist_contains() { | |||
} | |||
|
|||
for test_dir in $(os::util::list_go_src_dirs); do | |||
if ! result="$(go tool vet -shadow=false "${test_dir}" 2>&1)"; then | |||
if ! result="$(go tool vet -shadow=false -printfuncs=Info,Infof,Warning,Warningf "${test_dir}" 2>&1)"; then |
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 going on record as liking it better the way it was.
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.
And expecting that people understand this this one place the "${args}" are not quoted because we need word splitting for proper parameter passing for the call to go tool vet
? No thanks
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bparees, danwinship The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
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
/retest |
Automatic merge from submit-queue (batch tested with PRs 15807, 16778, 16801, 16804, 16793). |
The default set of names covered by govet's checking of Printf-like functions includes Log, Error, and Fatal, but not Info or Warning. (Noticed in #16793.)