Change CheckPatchFormatted to report which directory failed.

If presubmit.py for a directory (such as net/) fails due to not being clang formatted, then 'git cl format' needs to be run for that directory, not the entire patch.

BUG=422332

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@292407 0039d316-1c4b-4281-b951-d872f2087c98
changes/01/332501/1
jkarlin@chromium.org 11 years ago
parent 4f52c9e114
commit e15dc62f65

@ -1106,7 +1106,8 @@ def CheckPatchFormatted(input_api, output_api):
code, _ = git_cl.RunGitWithCode(cmd, suppress_stderr=True)
if code == 2:
return [output_api.PresubmitPromptWarning(
'Your patch is not formatted, please run git cl format.')]
'The %s directory requires clang-formatting. '
'Please run git cl format %s' % (input_api.basename, input_api.basename))]
# 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.
return []

Loading…
Cancel
Save