blob: fbd1fe26d76bf45b0aede625e00ba6aa15a3d3c6 [file] [log] [blame]
Ryan Tseng85ec17e2018-09-06 17:10:05 -07001# Copyright (c) 2018 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
5
btolsch333aecd2019-04-18 16:21:23 -07006def _CommonChecks(input_api, output_api):
7 results = []
8 # TODO(issues/43): Probably convert this to python so we can give more
9 # detailed errors.
10 presubmit_sh_result = input_api.subprocess.call(
11 input_api.PresubmitLocalPath() + '/PRESUBMIT.sh')
12 if presubmit_sh_result != 0:
13 results.append(output_api.PresubmitError('PRESUBMIT.sh failed'))
14 return results
15
16
Ryan Tseng85ec17e2018-09-06 17:10:05 -070017def CheckChangeOnUpload(input_api, output_api):
btolsch333aecd2019-04-18 16:21:23 -070018 results = []
19 results.extend(_CommonChecks(input_api, output_api))
20 results.extend(
21 input_api.canned_checks.CheckChangedLUCIConfigs(input_api, output_api))
22 return results
23
24
25def CheckChangeOnCommit(input_api, output_api):
26 results = []
27 results.extend(_CommonChecks(input_api, output_api))
28 return results