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

Side by Side Diff: tools/chrome_remote_control/PRESUBMIT.py

Issue 10984018: [chrome_remote_control] Add pylint to PRESUMMIT and fix lint (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for landing Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tools/chrome_remote_control/chrome_remote_control/__init__.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) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 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 import os 4 import os
5 import sys 5 import sys
6 6
7 PYLINT_BLACKLIST = [] 7 PYLINT_BLACKLIST = []
8 PYLINT_DISABLED_WARNINGS = [] 8 PYLINT_DISABLED_WARNINGS = ['R0923']
9 9
10 def CheckChangeOnUpload(input_api, output_api): 10 def _CommonChecks(input_api, output_api):
11 report = [] 11 results = []
12 report.extend(input_api.canned_checks.PanProjectChecks( 12 results.extend(input_api.canned_checks.PanProjectChecks(
13 input_api, output_api)) 13 input_api, output_api))
14 return report
15 14
16 def CheckChangeOnCommit(input_api, output_api):
17 report = []
18 report.extend(input_api.canned_checks.PanProjectChecks(input_api, output_api))
19 15
20 old_sys_path = sys.path 16 old_sys_path = sys.path
21 try: 17 try:
22 sys.path = [os.path.join('..', 'chrome_remote_control')] + sys.path 18 sys.path = [os.path.join('..', 'chrome_remote_control')] + sys.path
23 report.extend(input_api.canned_checks.RunPylint( 19 results.extend(input_api.canned_checks.RunPylint(
24 input_api, output_api, 20 input_api, output_api,
25 black_list=PYLINT_BLACKLIST, 21 black_list=PYLINT_BLACKLIST,
26 disabled_warnings=PYLINT_DISABLED_WARNINGS)) 22 disabled_warnings=PYLINT_DISABLED_WARNINGS))
27 finally: 23 finally:
28 sys.path = old_sys_path 24 sys.path = old_sys_path
29 25
26
27
28 return results
29
30 def CheckChangeOnUpload(input_api, output_api):
31 report = []
32 report.extend(_CommonChecks(input_api, output_api))
30 return report 33 return report
34
35 def CheckChangeOnCommit(input_api, output_api):
36 report = []
37 report.extend(_CommonChecks(input_api, output_api))
38 return report
OLDNEW
« no previous file with comments | « no previous file | tools/chrome_remote_control/chrome_remote_control/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698