Prathmesh Prabhu | 088771d | 2020-08-24 14:02:48 -0700 | [diff] [blame] | 1 | # Copyright 2020 The Chromium OS 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 | |
Jesse McGuire | b48591d | 2023-01-05 16:00:20 -0800 | [diff] [blame] | 5 | USE_PYTHON3 = True |
Prathmesh Prabhu | 088771d | 2020-08-24 14:02:48 -0700 | [diff] [blame] | 6 | |
| 7 | def CommonChecks(input_api, output_api): |
| 8 | """Check common to presubmit / preupload.""" |
| 9 | results = [] |
| 10 | |
| 11 | # Python formatting issues are errors. |
| 12 | results += input_api.canned_checks.CheckPatchFormatted( |
| 13 | input_api, |
| 14 | output_api, |
| 15 | # Setting check_python=None ensures that only files with a |
| 16 | # .style.yapf in a parent directory are checked. This effectively |
| 17 | # skips most of the legacy autotest codebase that is very poorly |
| 18 | # formatted. |
| 19 | check_python=None, |
| 20 | check_clang_format=False, |
| 21 | result_factory=output_api.PresubmitError) |
| 22 | return results |
| 23 | |
| 24 | |
| 25 | CheckChangeOnUpload = CommonChecks |
| 26 | CheckChangeOnCommit = CommonChecks |