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

Side by Side Diff: presubmit_canned_checks.py

Issue 7027031: Add input_api.logging. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 9 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | presubmit_support.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Generic presubmit checks that can be reused by other presubmit checks.""" 5 """Generic presubmit checks that can be reused by other presubmit checks."""
6 6
7 7
8 ### Description checks 8 ### Description checks
9 9
10 def CheckChangeHasTestField(input_api, output_api): 10 def CheckChangeHasTestField(input_api, output_api):
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 import warnings 593 import warnings
594 warnings.filterwarnings('ignore', category=DeprecationWarning) 594 warnings.filterwarnings('ignore', category=DeprecationWarning)
595 try: 595 try:
596 files = _FetchAllFiles(input_api, white_list, black_list) 596 files = _FetchAllFiles(input_api, white_list, black_list)
597 if not files: 597 if not files:
598 return [] 598 return []
599 # Now that at least one python file was modified and all the python files 599 # Now that at least one python file was modified and all the python files
600 # were listed, try to run pylint. 600 # were listed, try to run pylint.
601 try: 601 try:
602 from pylint import lint 602 from pylint import lint
603 input_api.logging.debug(
604 'Using pylint v%s from %s' % (lint.version, lint.__file__))
603 except ImportError: 605 except ImportError:
604 if input_api.platform == 'win32': 606 if input_api.platform == 'win32':
605 return [output_api.PresubmitNotifyResult( 607 return [output_api.PresubmitNotifyResult(
606 'Warning: Can\'t run pylint because it is not installed. Please ' 608 'Warning: Can\'t run pylint because it is not installed. Please '
607 'install manually\n' 609 'install manually\n'
608 'Cannot do static analysis of python files.')] 610 'Cannot do static analysis of python files.')]
609 return [output_api.PresubmitError( 611 return [output_api.PresubmitError(
610 'Please install pylint with "sudo apt-get install python-setuptools; ' 612 'Please install pylint with "sudo apt-get install python-setuptools; '
611 'sudo easy_install pylint"\n' 613 'sudo easy_install pylint"\n'
612 'or visit http://pypi.python.org/pypi/setuptools.\n' 614 'or visit http://pypi.python.org/pypi/setuptools.\n'
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 results.extend(input_api.canned_checks.CheckChangeSvnEolStyle( 910 results.extend(input_api.canned_checks.CheckChangeSvnEolStyle(
909 input_api, output_api, source_file_filter=text_files)) 911 input_api, output_api, source_file_filter=text_files))
910 snapshot("checking svn mime types") 912 snapshot("checking svn mime types")
911 results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes( 913 results.extend(input_api.canned_checks.CheckSvnForCommonMimeTypes(
912 input_api, output_api)) 914 input_api, output_api))
913 snapshot("checking license") 915 snapshot("checking license")
914 results.extend(input_api.canned_checks.CheckLicense( 916 results.extend(input_api.canned_checks.CheckLicense(
915 input_api, output_api, license_header, source_file_filter=sources)) 917 input_api, output_api, license_header, source_file_filter=sources))
916 snapshot("done") 918 snapshot("done")
917 return results 919 return results
OLDNEW
« no previous file with comments | « no previous file | presubmit_support.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698