Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Unified Diff: third_party/WebKit/PRESUBMIT.py

Issue 1395493002: Improve error messages from checkperms PRESUBMIT check (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « PRESUBMIT.py ('k') | tools/checkperms/checkperms.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/PRESUBMIT.py
diff --git a/third_party/WebKit/PRESUBMIT.py b/third_party/WebKit/PRESUBMIT.py
index 34620ff445dbfd1d5b51dfd2f67be90e01221fbe..54025cedf6ccbbcb2494bec5917891ffc454a285 100644
--- a/third_party/WebKit/PRESUBMIT.py
+++ b/third_party/WebKit/PRESUBMIT.py
@@ -295,18 +295,20 @@ def _CheckFilePermissions(input_api, output_api):
"""Check that all files have their permissions properly set."""
if input_api.platform == 'win32':
return []
- path = input_api.os_path.join(
- '..', '..', 'tools', 'checkperms', 'checkperms.py')
- args = [sys.executable, path, '--root', input_api.change.RepositoryRoot()]
+ args = [input_api.python_executable,
+ input_api.os_path.join(
+ input_api.change.RepositoryRoot(),
+ 'tools/checkperms/checkperms.py'),
+ '--root', input_api.change.RepositoryRoot()]
for f in input_api.AffectedFiles():
args += ['--file', f.LocalPath()]
- checkperms = input_api.subprocess.Popen(
- args, stdout=input_api.subprocess.PIPE)
- errors = checkperms.communicate()[0].strip()
- if errors:
+ try:
+ input_api.subprocess.check_output(args)
+ return []
+ except input_api.subprocess.CalledProcessError as error:
return [output_api.PresubmitError(
- 'checkperms.py failed.', errors.splitlines())]
- return []
+ 'checkperms.py failed:',
+ long_text=error.output)]
def _CheckForInvalidPreferenceError(input_api, output_api):
« no previous file with comments | « PRESUBMIT.py ('k') | tools/checkperms/checkperms.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698