Fix clang-format canned check warning text

input_api.basename is a function, so printing it out yields:
"The <function basename at 0x7fccd3735410> directory requires..>"

Instead, use it to resolve the local presubmit path that has
requested clang formatting.

R=dpranke@chromium.org
BUG=422332

Review URL: https://codereview.chromium.org/665493002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@292491 0039d316-1c4b-4281-b951-d872f2087c98
changes/01/332501/1
enne@chromium.org 11 years ago
parent 4593f47b06
commit 7b7b5b2e6a

@ -1107,7 +1107,9 @@ def CheckPatchFormatted(input_api, output_api):
if code == 2: if code == 2:
return [output_api.PresubmitPromptWarning( return [output_api.PresubmitPromptWarning(
'The %s directory requires clang-formatting. ' 'The %s directory requires clang-formatting. '
'Please run git cl format %s' % (input_api.basename, input_api.basename))] 'Please run git cl format %s' %
(input_api.basename(input_api.PresubmitLocalPath()),
input_api.basename(input_api.PresubmitLocalPath())))]
# As this is just a warning, ignore all other errors if the user # As this is just a warning, ignore all other errors if the user
# happens to have a broken clang-format, doesn't use git, etc etc. # happens to have a broken clang-format, doesn't use git, etc etc.
return [] return []

Loading…
Cancel
Save