OLD | NEW |
| (Empty) |
1 # Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | |
2 # | |
3 # Use of this source code is governed by a BSD-style license | |
4 # that can be found in the LICENSE file in the root of the source | |
5 # tree. An additional intellectual property rights grant can be found | |
6 # in the file PATENTS. All contributing project authors may | |
7 # be found in the AUTHORS file in the root of the source tree. | |
8 | |
9 | |
10 def _CommonChecks(input_api, output_api): | |
11 results = [] | |
12 | |
13 # Validate the format of the mb_config.pyl file. | |
14 mb_script = input_api.os_path.join(input_api.PresubmitLocalPath(), '..', | |
15 '..', 'tools', 'mb', 'mb.py') | |
16 mb_config_path = input_api.os_path.join(input_api.PresubmitLocalPath(), | |
17 'mb_config.pyl') | |
18 cmd = [input_api.python_executable, mb_script, 'validate', '--config-file', | |
19 mb_config_path] | |
20 kwargs = {'cwd': input_api.PresubmitLocalPath()} | |
21 results.extend(input_api.RunTests([ | |
22 input_api.Command(name='mb_validate', | |
23 cmd=cmd, kwargs=kwargs, | |
24 message=output_api.PresubmitError)])) | |
25 | |
26 return results | |
27 | |
28 | |
29 def CheckChangeOnUpload(input_api, output_api): | |
30 return _CommonChecks(input_api, output_api) | |
31 | |
32 | |
33 def CheckChangeOnCommit(input_api, output_api): | |
34 return _CommonChecks(input_api, output_api) | |
OLD | NEW |