1# Copyright 2018 The Dawn Authors 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15import os 16import platform 17import subprocess 18 19USE_PYTHON3 = True 20 21 22def _DoCommonChecks(input_api, output_api): 23 results = [] 24 results.extend( 25 input_api.canned_checks.CheckChangedLUCIConfigs(input_api, output_api)) 26 results.extend( 27 input_api.canned_checks.CheckPatchFormatted(input_api, 28 output_api, 29 check_python=True)) 30 return results 31 32 33def CheckChangeOnUpload(input_api, output_api): 34 return _DoCommonChecks(input_api, output_api) 35 36 37def CheckChangeOnCommit(input_api, output_api): 38 return _DoCommonChecks(input_api, output_api) 39