Fix import error in mac_platform_backend.py
[chromium-blink-merge.git] / tools / perf / PRESUBMIT.py
blob9bb8eb1a68d2cc19372c7ed20b85a9246416c067
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
3 # found in the LICENSE file.
4 import os
5 import sys
8 PYLINT_BLACKLIST = []
9 PYLINT_DISABLED_WARNINGS = ['R0923', 'R0201', 'E1101']
12 def _CommonChecks(input_api, output_api):
13 results = []
14 old_sys_path = sys.path
15 try:
16 sys.path = [os.path.join(os.pardir, 'telemetry')] + sys.path
17 results.extend(input_api.canned_checks.RunPylint(
18 input_api, output_api,
19 black_list=PYLINT_BLACKLIST,
20 disabled_warnings=PYLINT_DISABLED_WARNINGS))
21 finally:
22 sys.path = old_sys_path
23 return results
26 def CheckChangeOnUpload(input_api, output_api):
27 report = []
28 report.extend(_CommonChecks(input_api, output_api))
29 return report
32 def CheckChangeOnCommit(input_api, output_api):
33 report = []
34 report.extend(_CommonChecks(input_api, output_api))
35 return report