Avi Drissman | dfd88085 | 2022-09-15 20:11:09 | [diff] [blame] | 1 | # Copyright 2012 The Chromium Authors |
maruel@chromium.org | 279d79f1 | 2012-04-25 01:25:40 | [diff] [blame] | 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
| 5 | """Top-level presubmit script for checkperms. |
| 6 | |
tfarina | 78bb92f4 | 2015-01-31 00:20:48 | [diff] [blame] | 7 | See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts |
| 8 | for more details on the presubmit API built into depot_tools. |
maruel@chromium.org | 279d79f1 | 2012-04-25 01:25:40 | [diff] [blame] | 9 | """ |
| 10 | |
| 11 | |
maruel@chromium.org | 279d79f1 | 2012-04-25 01:25:40 | [diff] [blame] | 12 | def CommonChecks(input_api, output_api): |
| 13 | output = [] |
Josip Sokcevic | 13ce867 | 2022-06-15 20:36:14 | [diff] [blame] | 14 | output.extend( |
Bruce Dawson | b2eb83c | 2022-06-23 19:20:27 | [diff] [blame] | 15 | input_api.canned_checks.RunPylint(input_api, output_api, version='2.7')) |
maruel@chromium.org | 279d79f1 | 2012-04-25 01:25:40 | [diff] [blame] | 16 | # Run it like if it were a unit test. |
| 17 | output.extend( |
Takuto Ikuta | e108f10 | 2023-06-01 21:38:30 | [diff] [blame^] | 18 | input_api.canned_checks.RunUnitTests(input_api, output_api, |
| 19 | ['./checkperms.py'])) |
maruel@chromium.org | 279d79f1 | 2012-04-25 01:25:40 | [diff] [blame] | 20 | return output |
| 21 | |
| 22 | |
| 23 | def CheckChangeOnUpload(input_api, output_api): |
| 24 | return CommonChecks(input_api, output_api) |
| 25 | |
| 26 | |
| 27 | def CheckChangeOnCommit(input_api, output_api): |
| 28 | return CommonChecks(input_api, output_api) |