From e15dc62f65855def09c70ae23624a7f5e51df59e Mon Sep 17 00:00:00 2001 From: "jkarlin@chromium.org" Date: Fri, 10 Oct 2014 17:00:37 +0000 Subject: [PATCH] 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 --- presubmit_canned_checks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py index 4f0472be1..6dfed2bf6 100644 --- a/presubmit_canned_checks.py +++ b/presubmit_canned_checks.py @@ -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 []