Commit e15dc62f authored by jkarlin@chromium.org's avatar jkarlin@chromium.org

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
parent 4f52c9e1
......@@ -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 []
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment