Lann Martin | 46361ee | 2019-03-14 15:30:47 -0600 | [diff] [blame] | 1 | # Copyright 2019 The Chromium OS Authors. All rights reserved. |
David Burger | c0effc2 | 2020-03-04 08:27:07 -0700 | [diff] [blame] | 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
Lann Martin | 46361ee | 2019-03-14 15:30:47 -0600 | [diff] [blame] | 4 | |
| 5 | |
| 6 | def CommonChecks(input_api, output_api): |
| 7 | results = [] |
| 8 | |
| 9 | # recipes.py test run |
| 10 | results += input_api.RunTests([ |
| 11 | input_api.Command( |
| 12 | name='recipes test', |
| 13 | cmd=[input_api.python_executable, 'recipes.py', 'test', 'run'], |
| 14 | kwargs={}, |
| 15 | message=output_api.PresubmitError, |
| 16 | ) |
| 17 | ]) |
| 18 | |
LaMont Jones | 3cdba5c | 2020-06-02 17:10:56 -0600 | [diff] [blame] | 19 | # Python formatting issues are errors. |
Andrew Lamb | 9b2d086 | 2019-04-03 16:38:52 -0600 | [diff] [blame] | 20 | results += input_api.canned_checks.CheckPatchFormatted( |
LaMont Jones | ddba316 | 2020-06-10 15:52:09 -0600 | [diff] [blame] | 21 | input_api, output_api, check_python=True, check_clang_format=False, |
LaMont Jones | 3cdba5c | 2020-06-02 17:10:56 -0600 | [diff] [blame] | 22 | result_factory=output_api.PresubmitError) |
Andrew Lamb | 9b2d086 | 2019-04-03 16:38:52 -0600 | [diff] [blame] | 23 | |
Lann Martin | 46361ee | 2019-03-14 15:30:47 -0600 | [diff] [blame] | 24 | return results |
| 25 | |
| 26 | |
| 27 | CheckChangeOnUpload = CommonChecks |
| 28 | CheckChangeOnCommit = CommonChecks |