Commit 488d0431 authored by maruel@chromium.org's avatar maruel@chromium.org

Improve PRESUBMIT.py error messages.

TEST=presubmit.py
BUG=none

Review URL: http://codereview.chromium.org/4279002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@64903 0039d316-1c4b-4281-b951-d872f2087c98
parent ed68d975
......@@ -57,15 +57,18 @@ def RunPylint(input_api, output_api):
# It uses non-standard pylint exceptions that makes pylint always fail.
files.remove('cpplint.py')
try:
proc = input_api.subprocess.Popen(['pylint', '-E'] + files)
except OSError:
proc = input_api.subprocess.Popen(['pylint', '-E'] + sorted(files))
proc.communicate()
if proc.returncode:
return [output_api.PresubmitError('Fix pylint errors first.')]
return []
except OSError, e:
if input_api.platform == 'win32':
# It's windows, give up.
return []
else:
return [output_api.PresubmitError(
'Please install pylint with "easy_install pylint"')]
proc.communicate()
if proc.returncode:
return [output_api.PresubmitError('Fix pylint errors first.')]
return []
return [output_api.PresubmitNotifyResult(
'Warning: Can\'t run pylint because it is not installed. Please '
'install manually\n'
'Cannot do static analysis of python files.')]
return [output_api.PresubmitError(
'Please install pylint with "sudo apt-get install python-setuptools; '
'sudo easy_install pylint"\n'
'Cannot do static analysis of python files.')]
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